mac80211: check if HT40+/- is allowed before sending assoc
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Sat, 2 May 2009 04:37:19 +0000 (00:37 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 20 May 2009 18:46:23 +0000 (14:46 -0400)
We weren't checking this at all.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mlme.c

index da582b643b9a6ed03a4f4878ef806bde9f7259cd..a1944b8722e93a436f2013f808e1a0efae1a1ff0 100644 (file)
@@ -121,10 +121,14 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
                    (hti->ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) {
                        switch(hti->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
                        case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
-                               channel_type = NL80211_CHAN_HT40PLUS;
+                               if (!(local->hw.conf.channel->flags &
+                                   IEEE80211_CHAN_NO_HT40PLUS))
+                                       channel_type = NL80211_CHAN_HT40PLUS;
                                break;
                        case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
-                               channel_type = NL80211_CHAN_HT40MINUS;
+                               if (!(local->hw.conf.channel->flags &
+                                   IEEE80211_CHAN_NO_HT40MINUS))
+                                       channel_type = NL80211_CHAN_HT40MINUS;
                                break;
                        }
                }