Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
struct ieee80211_sub_if_data *sdata;
int idx, i, alg = ALG_WEP;
u8 bcaddr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
- int remove = 0;
+ int remove = 0, ret;
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
return 0;
}
- return ieee80211_set_encryption(
+ ret = ieee80211_set_encryption(
sdata, bcaddr,
idx, alg, remove,
!sdata->default_key,
keybuf, erq->length);
+
+ if (!ret) {
+ if (remove)
+ sdata->u.mgd.flags &= ~IEEE80211_STA_TKIP_WEP_USED;
+ else
+ sdata->u.mgd.flags |= IEEE80211_STA_TKIP_WEP_USED;
+ }
+
+ return ret;
}