void write_phy(struct net_device *dev, u8 adr, u8 data);
void CamResetAllEntry(struct r8192_priv *priv);
void EnableHWSecurityConfig8192(struct r8192_priv *priv);
-void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent );
+void setKey(struct r8192_priv *priv, u8 EntryNo, u8 KeyIndex, u16 KeyType,
+ const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent);
void firmware_init_param(struct net_device *dev);
RT_STATUS cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, u32 packettype, u32 buffer_len);
static void r8192e_set_hw_key(struct r8192_priv *priv, struct ieee_param *ipw)
{
struct ieee80211_device *ieee = priv->ieee80211;
- struct net_device *dev = priv->ieee80211->dev;
u8 broadcast_addr[6] = {0xff,0xff,0xff,0xff,0xff,0xff};
u32 key[4];
* key as in IPW interface, adhoc will only get here,
* so we need index entry for its default key serching!
*/
- setKey(dev, 4, ipw->u.crypt.idx,
+ setKey(priv, 4, ipw->u.crypt.idx,
ieee->pairwise_key_type,
(u8*)ieee->ap_mac_addr, 0, key);
/* LEAP WEP will never set this. */
if (ieee->auth_mode != 2)
- setKey(dev, ipw->u.crypt.idx, ipw->u.crypt.idx,
+ setKey(priv, ipw->u.crypt.idx, ipw->u.crypt.idx,
ieee->pairwise_key_type,
(u8*)ieee->ap_mac_addr, 0, key);
}
ieee->group_key_type = KEY_TYPE_NA;
if (ieee->group_key_type) {
- setKey(dev, ipw->u.crypt.idx, ipw->u.crypt.idx,
+ setKey(priv, ipw->u.crypt.idx, ipw->u.crypt.idx,
ieee->group_key_type, broadcast_addr, 0, key);
}
}
}
#define TOTAL_CAM_ENTRY 32
//#define CAM_CONTENT_COUNT 8
-void setKey( struct net_device *dev,
- u8 EntryNo,
- u8 KeyIndex,
- u16 KeyType,
- const u8 *MacAddr,
- u8 DefaultKey,
- u32 *KeyContent )
+void setKey(struct r8192_priv *priv, u8 EntryNo, u8 KeyIndex, u16 KeyType,
+ const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent)
{
u32 TargetCommand = 0;
u32 TargetContent = 0;
u16 usConfig = 0;
u8 i;
#ifdef ENABLE_IPS
- struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
RT_RF_POWER_STATE rtState;
+
rtState = priv->eRFPowerState;
if (priv->PowerSaveControl.bInactivePs){
if(rtState == eRfOff){
if (EntryNo >= TOTAL_CAM_ENTRY)
RT_TRACE(COMP_ERR, "cam entry exceeds in setKey()\n");
- RT_TRACE(COMP_SEC, "====>to setKey(), dev:%p, EntryNo:%d, KeyIndex:%d, KeyType:%d, MacAddr%pM\n", dev,EntryNo, KeyIndex, KeyType, MacAddr);
+ RT_TRACE(COMP_SEC, "====>to setKey(), priv:%p, EntryNo:%d, KeyIndex:%d, KeyType:%d, MacAddr%pM\n", priv, EntryNo, KeyIndex, KeyType, MacAddr);
if (DefaultKey)
usConfig |= BIT15 | (KeyType<<2);
if(wrqu->encoding.length==0x5){
ieee->pairwise_key_type = KEY_TYPE_WEP40;
EnableHWSecurityConfig8192(priv);
- setKey( dev,
- key_idx, //EntryNo
- key_idx, //KeyIndex
- KEY_TYPE_WEP40, //KeyType
- zero_addr[key_idx],
- 0, //DefaultKey
- hwkey); //KeyContent
+ setKey(priv, key_idx, key_idx, KEY_TYPE_WEP40,
+ zero_addr[key_idx], 0, hwkey);
}
else if(wrqu->encoding.length==0xd){
ieee->pairwise_key_type = KEY_TYPE_WEP104;
EnableHWSecurityConfig8192(priv);
- setKey( dev,
- key_idx, //EntryNo
- key_idx, //KeyIndex
- KEY_TYPE_WEP104, //KeyType
- zero_addr[key_idx],
- 0, //DefaultKey
- hwkey); //KeyContent
+ setKey(priv, key_idx, key_idx, KEY_TYPE_WEP104,
+ zero_addr[key_idx], 0, hwkey);
}
else printk("wrong type in WEP, not WEP40 and WEP104\n");
}
{
if (ext->key_len == 13)
ieee->pairwise_key_type = alg = KEY_TYPE_WEP104;
- setKey( dev,
- idx,//EntryNo
- idx, //KeyIndex
- alg, //KeyType
- zero, //MacAddr
- 0, //DefaultKey
- key); //KeyContent
+ setKey(priv, idx, idx, alg, zero, 0, key);
}
else if (group)
{
ieee->group_key_type = alg;
- setKey( dev,
- idx,//EntryNo
- idx, //KeyIndex
- alg, //KeyType
- broadcast_addr, //MacAddr
- 0, //DefaultKey
- key); //KeyContent
+ setKey(priv, idx, idx, alg, broadcast_addr, 0, key);
}
else //pairwise key
{
if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) && ieee->pHTInfo->bCurrentHTSupport){
write_nic_byte(priv, 0x173, 1); //fix aes bug
}
- setKey( dev,
- 4,//EntryNo
- idx, //KeyIndex
- alg, //KeyType
- (u8*)ieee->ap_mac_addr, //MacAddr
- 0, //DefaultKey
- key); //KeyContent
+ setKey(priv, 4, idx, alg,
+ (u8*)ieee->ap_mac_addr, 0, key);
}