diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-12-12 11:50:39 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-15 03:41:38 -0500 |
commit | c7a6ee27abd46247c1c7edfc49fb935138da7875 (patch) | |
tree | 716d3e489fbf1d5f34fd362ef09c985e4de033bf /net/wireless/reg.c | |
parent | 30eb1dc2c43039e0fe278e6f3a288de9f216d70d (diff) |
cfg80211: allow drivers to selectively disable 80/160 MHz
Some drivers might support 80 or 160 MHz only on some
channels for whatever reason, so allow them to disable
these channel widths. Also maintain the new flags when
regulatory bandwidth limitations would disable these
wide channels.
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r-- | net/wireless/reg.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index e97d5b071ab6..93ab840957a0 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -866,6 +866,10 @@ static void handle_channel(struct wiphy *wiphy, | |||
866 | 866 | ||
867 | if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(40)) | 867 | if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(40)) |
868 | bw_flags = IEEE80211_CHAN_NO_HT40; | 868 | bw_flags = IEEE80211_CHAN_NO_HT40; |
869 | if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(80)) | ||
870 | bw_flags |= IEEE80211_CHAN_NO_80MHZ; | ||
871 | if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(160)) | ||
872 | bw_flags |= IEEE80211_CHAN_NO_160MHZ; | ||
869 | 873 | ||
870 | if (lr->initiator == NL80211_REGDOM_SET_BY_DRIVER && | 874 | if (lr->initiator == NL80211_REGDOM_SET_BY_DRIVER && |
871 | request_wiphy && request_wiphy == wiphy && | 875 | request_wiphy && request_wiphy == wiphy && |
@@ -1264,6 +1268,10 @@ static void handle_channel_custom(struct wiphy *wiphy, | |||
1264 | 1268 | ||
1265 | if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(40)) | 1269 | if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(40)) |
1266 | bw_flags = IEEE80211_CHAN_NO_HT40; | 1270 | bw_flags = IEEE80211_CHAN_NO_HT40; |
1271 | if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(80)) | ||
1272 | bw_flags |= IEEE80211_CHAN_NO_80MHZ; | ||
1273 | if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(160)) | ||
1274 | bw_flags |= IEEE80211_CHAN_NO_160MHZ; | ||
1267 | 1275 | ||
1268 | chan->flags |= map_regdom_flags(reg_rule->flags) | bw_flags; | 1276 | chan->flags |= map_regdom_flags(reg_rule->flags) | bw_flags; |
1269 | chan->max_antenna_gain = (int) MBI_TO_DBI(power_rule->max_antenna_gain); | 1277 | chan->max_antenna_gain = (int) MBI_TO_DBI(power_rule->max_antenna_gain); |