[PATCH 8/8 v3.1] mac80211: re-add HT disabling

Johannes Berg
2009-07-01T07:39:17Z

The IEEE80211_STA_TKIP_WEP_USED flag is used internally to
disable HT when WEP or TKIP are used. Now that cfg80211 is
giving us the required information, we can set the flag
appropriately again.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/cfg.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

--- wireless-testing.orig/net/mac80211/cfg.c 2009-07-01 09:01:25.000000000 +0200
+++ wireless-testing/net/mac80211/cfg.c 2009-07-01 09:09:01.000000000 +0200
@@ -1228,7 +1228,7 @@ static int ieee80211_assoc(struct wiphy
struct cfg80211_assoc_request *req)
{
struct ieee80211_sub_if_data *sdata;
- int ret;
+ int ret, i;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

@@ -1236,6 +1236,14 @@ static int ieee80211_assoc(struct wiphy
!(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED))
return -ENOLINK; /* not authenticated */

+ sdata->u.mgd.flags &= ~IEEE80211_STA_TKIP_WEP_USED;
+
+ for (i = 0; i < req->crypto.n_ciphers_pairwise; i++)
+ if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 ||
+ req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_TKIP ||
+ req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP104)
+ sdata->u.mgd.flags |= IEEE80211_STA_TKIP_WEP_USED;
+
sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL;
sdata->u.mgd.flags |= IEEE80211_STA_BSSID_SET;