aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2013-05-16 07:00:31 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-06-18 10:17:11 -0400
commit0418a445838749c51cf1e31a9c7ace6685ae87cd (patch)
tree17efafeb21d138dbd8f7a7af01e07a8446298126 /net/mac80211/mlme.c
parent30e747326378caec9ad13515bc9bde2e41b1fee3 (diff)
mac80211: fix various components for the new 5 and 10 MHz widths
This is a collection of minor fixes: * don't allow HT IEs in IBSS for 5/10 MHz * don't allow HT IEs in Mesh for 5/10 MHz * don't downgrade from/to 5 and 10 MHz channels * don't try HT rates for 5 and 10 MHz channels when selecting rates Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 87f2d4df31f8..e0939eb79060 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -190,6 +190,12 @@ static u32 chandef_downgrade(struct cfg80211_chan_def *c)
190 c->width = NL80211_CHAN_WIDTH_20_NOHT; 190 c->width = NL80211_CHAN_WIDTH_20_NOHT;
191 ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_VHT; 191 ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_VHT;
192 break; 192 break;
193 case NL80211_CHAN_WIDTH_5:
194 case NL80211_CHAN_WIDTH_10:
195 WARN_ON_ONCE(1);
196 /* keep c->width */
197 ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_VHT;
198 break;
193 } 199 }
194 200
195 WARN_ON_ONCE(!cfg80211_chandef_valid(c)); 201 WARN_ON_ONCE(!cfg80211_chandef_valid(c));
@@ -3771,6 +3777,12 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
3771 */ 3777 */
3772 ret = ieee80211_vif_use_channel(sdata, &chandef, 3778 ret = ieee80211_vif_use_channel(sdata, &chandef,
3773 IEEE80211_CHANCTX_SHARED); 3779 IEEE80211_CHANCTX_SHARED);
3780
3781 /* don't downgrade for 5 and 10 MHz channels, though. */
3782 if (chandef.width == NL80211_CHAN_WIDTH_5 ||
3783 chandef.width == NL80211_CHAN_WIDTH_10)
3784 return ret;
3785
3774 while (ret && chandef.width != NL80211_CHAN_WIDTH_20_NOHT) { 3786 while (ret && chandef.width != NL80211_CHAN_WIDTH_20_NOHT) {
3775 ifmgd->flags |= chandef_downgrade(&chandef); 3787 ifmgd->flags |= chandef_downgrade(&chandef);
3776 ret = ieee80211_vif_use_channel(sdata, &chandef, 3788 ret = ieee80211_vif_use_channel(sdata, &chandef,