diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2017-01-21 01:33:48 +0100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2017-01-21 01:33:48 +0100 |
commit | 68e6d7d60c0b35990cb8056e317ba97f0fe73047 (patch) | |
tree | 92a7e8745a05aefdb0464eefb0691ae568ca2367 /net/mac80211/chan.c | |
parent | 3619db98361964903b81cfad1df177ba2545adb3 (diff) | |
download | kernel_samsung_smdk4412-68e6d7d60c0b35990cb8056e317ba97f0fe73047.zip kernel_samsung_smdk4412-68e6d7d60c0b35990cb8056e317ba97f0fe73047.tar.gz kernel_samsung_smdk4412-68e6d7d60c0b35990cb8056e317ba97f0fe73047.tar.bz2 |
Backport mac80211 from 3.4 kernel
The ath9k_htc driver depends on mac80211, but mac80211 can't be
build. The reason is that net/wireless is almost completely backported
from a 3.4 kernel. To follow suit, mac80211 is also backported from
3.4, more precisely from 3.4.113. This makes mac80211 build.
Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Diffstat (limited to 'net/mac80211/chan.c')
-rw-r--r-- | net/mac80211/chan.c | 55 |
1 files changed, 44 insertions, 11 deletions
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index 889c3e9..e00ce8c 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -3,6 +3,7 @@ */ #include <linux/nl80211.h> +#include <net/cfg80211.h> #include "ieee80211_i.h" static enum ieee80211_chan_mode @@ -20,23 +21,29 @@ __ieee80211_get_channel_mode(struct ieee80211_local *local, if (!ieee80211_sdata_running(sdata)) continue; - if (sdata->vif.type == NL80211_IFTYPE_MONITOR) + switch (sdata->vif.type) { + case NL80211_IFTYPE_MONITOR: continue; - - if (sdata->vif.type == NL80211_IFTYPE_STATION && - !sdata->u.mgd.associated) - continue; - - if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { + case NL80211_IFTYPE_STATION: + if (!sdata->u.mgd.associated) + continue; + break; + case NL80211_IFTYPE_ADHOC: if (!sdata->u.ibss.ssid_len) continue; if (!sdata->u.ibss.fixed_channel) return CHAN_MODE_HOPPING; - } - - if (sdata->vif.type == NL80211_IFTYPE_AP && - !sdata->u.ap.beacon) + break; + case NL80211_IFTYPE_AP_VLAN: + /* will also have _AP interface */ continue; + case NL80211_IFTYPE_AP: + if (!sdata->u.ap.beacon) + continue; + break; + default: + break; + } return CHAN_MODE_FIXED; } @@ -128,3 +135,29 @@ bool ieee80211_set_channel_type(struct ieee80211_local *local, return result; } + +/* + * ieee80211_get_tx_channel_type returns the channel type we should + * use for packet transmission, given the channel capability and + * whatever regulatory flags we have been given. + */ +enum nl80211_channel_type ieee80211_get_tx_channel_type( + struct ieee80211_local *local, + enum nl80211_channel_type channel_type) +{ + switch (channel_type) { + case NL80211_CHAN_HT40PLUS: + if (local->hw.conf.channel->flags & + IEEE80211_CHAN_NO_HT40PLUS) + return NL80211_CHAN_HT20; + break; + case NL80211_CHAN_HT40MINUS: + if (local->hw.conf.channel->flags & + IEEE80211_CHAN_NO_HT40MINUS) + return NL80211_CHAN_HT20; + break; + default: + break; + } + return channel_type; +} |