diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-05-03 21:14:45 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-05-03 21:14:45 +0000 |
commit | 7bf399a87a9e9afad7292767ea9027eff16055b6 (patch) | |
tree | 50d52852c41dd6bcdd5d3346123ec4eda6bd1c11 /package/kernel/mac80211/patches | |
parent | 09aa3ae9f684194c63d054705f865023e4d2e298 (diff) | |
download | mtk-20170518-7bf399a87a9e9afad7292767ea9027eff16055b6.zip mtk-20170518-7bf399a87a9e9afad7292767ea9027eff16055b6.tar.gz mtk-20170518-7bf399a87a9e9afad7292767ea9027eff16055b6.tar.bz2 |
mac80211: restrict ath9k/ath10k DFS support to ETSI
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40689
Diffstat (limited to 'package/kernel/mac80211/patches')
-rw-r--r-- | package/kernel/mac80211/patches/570-restrict_dfs_regions.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/570-restrict_dfs_regions.patch b/package/kernel/mac80211/patches/570-restrict_dfs_regions.patch new file mode 100644 index 0000000..10157dc --- /dev/null +++ b/package/kernel/mac80211/patches/570-restrict_dfs_regions.patch @@ -0,0 +1,82 @@ +--- a/drivers/net/wireless/ath/ath10k/mac.c ++++ b/drivers/net/wireless/ath/ath10k/mac.c +@@ -4321,6 +4321,7 @@ static const struct ieee80211_iface_comb + BIT(NL80211_CHAN_WIDTH_20) | + BIT(NL80211_CHAN_WIDTH_40) | + BIT(NL80211_CHAN_WIDTH_80), ++ .radar_detect_regions = BIT(NL80211_DFS_ETSI), + #endif + }, + }; +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -688,6 +688,7 @@ static const struct ieee80211_iface_comb + .beacon_int_infra_match = true, + .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | + BIT(NL80211_CHAN_WIDTH_20), ++ .radar_detect_regions = BIT(NL80211_DFS_ETSI), + } + #endif + }; +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -2620,6 +2620,7 @@ struct ieee80211_iface_limit { + * between infrastructure and AP types must match. This is required + * only in special cases. + * @radar_detect_widths: bitmap of channel widths supported for radar detection ++ * @radar_detect_regions: bitmap of regions supported for radar detection + * + * With this structure the driver can describe which interface + * combinations it supports concurrently. +@@ -2677,6 +2678,7 @@ struct ieee80211_iface_combination { + u8 n_limits; + bool beacon_int_infra_match; + u8 radar_detect_widths; ++ u8 radar_detect_regions; + }; + + struct ieee80211_txrx_stypes { +--- a/net/wireless/util.c ++++ b/net/wireless/util.c +@@ -1259,6 +1259,7 @@ int cfg80211_can_use_iftype_chan(struct + enum cfg80211_chan_mode chanmode, + u8 radar_detect) + { ++ const struct ieee80211_regdomain *regdom; + struct wireless_dev *wdev_iter; + u32 used_iftypes = BIT(iftype); + int num[NUM_NL80211_IFTYPES]; +@@ -1267,6 +1268,7 @@ int cfg80211_can_use_iftype_chan(struct + struct ieee80211_channel *ch; + enum cfg80211_chan_mode chmode; + int num_different_channels = 0; ++ enum nl80211_dfs_regions region = 0; + int total = 1; + int i, j; + +@@ -1285,6 +1287,14 @@ int cfg80211_can_use_iftype_chan(struct + return 0; + } + ++ if (radar_detect) { ++ rcu_read_lock(); ++ regdom = rcu_dereference(cfg80211_regdomain); ++ if (regdom) ++ region = regdom->dfs_region; ++ rcu_read_unlock(); ++ } ++ + memset(num, 0, sizeof(num)); + memset(used_channels, 0, sizeof(used_channels)); + +@@ -1392,6 +1402,10 @@ int cfg80211_can_use_iftype_chan(struct + if (radar_detect && !(c->radar_detect_widths & radar_detect)) + goto cont; + ++ if (radar_detect && c->radar_detect_regions && ++ !(c->radar_detect_regions & BIT(region))) ++ goto cont; ++ + /* + * Finally check that all iftypes that we're currently + * using are actually part of this combination. If they |