strWIDList[1].size = sizeof(char);
strWIDList[1].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.auth_type;
- strWIDList[2].id = (u16)WID_KEY_ID;
- strWIDList[2].type = WID_CHAR;
-
- strWIDList[2].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.index;
- strWIDList[2].size = sizeof(char);
-
- pu8keybuf = kmemdup(pstrHostIFkeyAttr->attr.wep.key,
- pstrHostIFkeyAttr->attr.wep.key_len,
+ pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len + 2,
GFP_KERNEL);
if (pu8keybuf == NULL) {
return -ENOMEM;
}
+ pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
+ pu8keybuf[1] = pstrHostIFkeyAttr->attr.wep.key_len;
+
+ memcpy(&pu8keybuf[2], pstrHostIFkeyAttr->attr.wep.key,
+ pstrHostIFkeyAttr->attr.wep.key_len);
+
kfree(pstrHostIFkeyAttr->attr.wep.key);
- strWIDList[3].id = (u16)WID_WEP_KEY_VALUE;
- strWIDList[3].type = WID_STR;
- strWIDList[3].size = pstrHostIFkeyAttr->attr.wep.key_len;
- strWIDList[3].val = (s8 *)pu8keybuf;
+ strWIDList[2].id = (u16)WID_WEP_KEY_VALUE;
+ strWIDList[2].type = WID_STR;
+ strWIDList[2].size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
+ strWIDList[2].val = (s8 *)pu8keybuf;
result = wilc_send_config_pkt(vif->wilc, SET_CFG,
- strWIDList, 4,
+ strWIDList, 3,
wilc_get_vif_idx(vif));
kfree(pu8keybuf);
} else if (pstrHostIFkeyAttr->action & ADDKEY) {
result = wilc_send_config_pkt(vif->wilc, SET_CFG,
&wid, 1,
wilc_get_vif_idx(vif));
- } else {
+ } else if (pstrHostIFkeyAttr->action & DEFAULTKEY) {
wid.id = (u16)WID_KEY_ID;
wid.type = WID_CHAR;
wid.val = (s8 *)&pstrHostIFkeyAttr->attr.wep.index;
return s32Error;
}
- priv->WILC_WFI_wep_default = 0;
memset(priv->WILC_WFI_wep_key, 0, sizeof(priv->WILC_WFI_wep_key));
memset(priv->WILC_WFI_wep_key_len, 0, sizeof(priv->WILC_WFI_wep_key_len));
for (i = 0; i < sme->key_len; i++)
PRINT_D(CORECONFIG_DBG, "WEP Key Value[%d] = %d\n", i, sme->key[i]);
}
- priv->WILC_WFI_wep_default = sme->key_idx;
priv->WILC_WFI_wep_key_len[sme->key_idx] = sme->key_len;
memcpy(priv->WILC_WFI_wep_key[sme->key_idx], sme->key, sme->key_len);
pcgroup_encrypt_val = "WEP104";
pccipher_group = "WLAN_CIPHER_SUITE_WEP104";
- priv->WILC_WFI_wep_default = sme->key_idx;
priv->WILC_WFI_wep_key_len[sme->key_idx] = sme->key_len;
memcpy(priv->WILC_WFI_wep_key[sme->key_idx], sme->key, sme->key_len);
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104:
if (priv->wdev->iftype == NL80211_IFTYPE_AP) {
- priv->WILC_WFI_wep_default = key_index;
priv->WILC_WFI_wep_key_len[key_index] = params->key_len;
memcpy(priv->WILC_WFI_wep_key[key_index], params->key, params->key_len);
break;
}
if (memcmp(params->key, priv->WILC_WFI_wep_key[key_index], params->key_len)) {
- priv->WILC_WFI_wep_default = key_index;
priv->WILC_WFI_wep_key_len[key_index] = params->key_len;
memcpy(priv->WILC_WFI_wep_key[key_index], params->key, params->key_len);
PRINT_D(CFG80211_DBG, "Setting default key with idx = %d\n", key_index);
- if (key_index != priv->WILC_WFI_wep_default) {
- wilc_set_wep_default_keyid(vif, key_index);
- }
+ wilc_set_wep_default_keyid(vif, key_index);
return 0;
}
struct host_if_drv *hWILCWFIDrv;
struct host_if_pmkid_attr pmkid_list;
struct WILC_WFI_stats netstats;
- u8 WILC_WFI_wep_default;
u8 WILC_WFI_wep_key[4][WLAN_KEY_LEN_WEP104];
u8 WILC_WFI_wep_key_len[4];
/* The real interface that the monitor is on */