Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -pur a/drivers/net/wireless/ath/ath9k/common-init.c b/drivers/net/wireless/ath/ath9k/common-init.c
- --- a/drivers/net/wireless/ath/ath9k/common-init.c 2017-01-27 03:12:57.878225039 +0100
- +++ b/drivers/net/wireless/ath/ath9k/common-init.c 2017-01-27 02:12:25.667393000 +0100
- @@ -22,7 +22,7 @@
- .band = NL80211_BAND_2GHZ, \
- .center_freq = (_freq), \
- .hw_value = (_idx), \
- - .max_power = 20, \
- + .max_power = 30, \
- }
- #define CHAN5G(_freq, _idx) { \
- @@ -37,6 +37,50 @@
- * we have calibration data for all cards though to make
- * this static */
- static const struct ieee80211_channel ath9k_2ghz_chantable[] = {
- + CHAN2G(2192, 58), /* Channel 213 */
- + CHAN2G(2197, 57), /* Channel 214 */
- + CHAN2G(2202, 56), /* Channel 215 */
- + CHAN2G(2207, 55), /* Channel 216 */
- + CHAN2G(2212, 54), /* Channel 217 */
- + CHAN2G(2217, 53), /* Channel 218 */
- + CHAN2G(2222, 52), /* Channel 219 */
- + CHAN2G(2227, 51), /* Channel 220 */
- + CHAN2G(2232, 50), /* Channel 221 */
- + CHAN2G(2237, 49), /* Channel 222 */
- + CHAN2G(2242, 48), /* Channel 223 */
- + CHAN2G(2247, 47), /* Channel 224 */
- + CHAN2G(2252, 46), /* Channel 225 */
- + CHAN2G(2257, 45), /* Channel 226 */
- + CHAN2G(2262, 44), /* Channel 227 */
- + CHAN2G(2267, 43), /* Channel 228 */
- + CHAN2G(2272, 42), /* Channel 229 */
- + CHAN2G(2277, 41), /* Channel 230 */
- + CHAN2G(2282, 40), /* Channel 231 */
- + CHAN2G(2287, 39), /* Channel 232 */
- + CHAN2G(2292, 38), /* Channel 233 */
- + CHAN2G(2297, 37), /* Channel 234 */
- + CHAN2G(2302, 36), /* Channel 235 */
- + CHAN2G(2307, 35), /* Channel 236 */
- + CHAN2G(2312, 34), /* Channel 237 */
- + CHAN2G(2317, 33), /* Channel 238 */
- + CHAN2G(2322, 32), /* Channel 239 */
- + CHAN2G(2327, 31), /* Channel 240 */
- + CHAN2G(2332, 30), /* Channel 241 */
- + CHAN2G(2337, 29), /* Channel 242 */
- + CHAN2G(2342, 28), /* Channel 243 */
- + CHAN2G(2347, 27), /* Channel 244 */
- + CHAN2G(2352, 26), /* Channel 245 */
- + CHAN2G(2357, 25), /* Channel 246 */
- + CHAN2G(2362, 24), /* Channel 247 */
- + CHAN2G(2367, 23), /* Channel 248 */
- + CHAN2G(2372, 22), /* Channel 249 */
- + CHAN2G(2377, 21), /* Channel 250 */
- + CHAN2G(2382, 20), /* Channel 251 */
- + CHAN2G(2387, 19), /* Channel 252 */
- + CHAN2G(2392, 18), /* Channel 253 */
- + CHAN2G(2397, 17), /* Channel 254 */
- + CHAN2G(2402, 16), /* Channel 255 */
- + CHAN2G(2407, 15), /* Channel 0 */
- CHAN2G(2412, 0), /* Channel 1 */
- CHAN2G(2417, 1), /* Channel 2 */
- CHAN2G(2422, 2), /* Channel 3 */
- @@ -48,6 +92,7 @@ static const struct ieee80211_channel at
- CHAN2G(2452, 8), /* Channel 9 */
- CHAN2G(2457, 9), /* Channel 10 */
- CHAN2G(2462, 10), /* Channel 11 */
- + CHAN2G(2464, 14), /* Channel 11 */
- CHAN2G(2467, 11), /* Channel 12 */
- CHAN2G(2472, 12), /* Channel 13 */
- CHAN2G(2484, 13), /* Channel 14 */
- diff -pur a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
- --- a/drivers/net/wireless/ath/ath9k/hw.h 2017-01-27 03:12:44.230158313 +0100
- +++ b/drivers/net/wireless/ath/ath9k/hw.h 2017-01-27 02:12:29.919414000 +0100
- @@ -74,7 +74,7 @@
- #define ATH9K_RSSI_BAD -128
- -#define ATH9K_NUM_CHANNELS 38
- +#define ATH9K_NUM_CHANNELS 83
- /* Register read/write primitives */
- #define REG_WRITE(_ah, _reg, _val) \
- diff -pur a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
- --- a/drivers/net/wireless/ath/regd.c 2017-01-27 03:34:37.760579834 +0100
- +++ b/drivers/net/wireless/ath/regd.c 2017-01-27 01:39:28.073725000 +0100
- @@ -33,29 +33,16 @@ static int __ath_regd_init(struct ath_re
- */
- /* Only these channels all allow active scan on all world regulatory domains */
- -#define ATH9K_2GHZ_CH01_11 REG_RULE(2412-10, 2462+10, 40, 0, 20, 0)
- -
- -/* We enable active scan on these a case by case basis by regulatory domain */
- -#define ATH9K_2GHZ_CH12_13 REG_RULE(2467-10, 2472+10, 40, 0, 20,\
- - NL80211_RRF_NO_IR)
- -#define ATH9K_2GHZ_CH14 REG_RULE(2484-10, 2484+10, 40, 0, 20,\
- - NL80211_RRF_NO_IR | \
- - NL80211_RRF_NO_OFDM)
- +#define ATH9K_2GHZ_2224 REG_RULE(2192-10, 2472+10, 40, 0, 30, 0)
- +#define ATH9K_2GHZ_CH14 REG_RULE(2484-10, 2484+10, 40, 0, 30, 0)
- +#define ATH9K_2GHZ_2527 REG_RULE(2492-10, 2732+10, 40, 0, 30, 0)
- +
- +#define ATH9K_2GHZ ATH9K_2GHZ_2224, \
- + ATH9K_2GHZ_CH14, \
- + ATH9K_2GHZ_2527
- /* We allow IBSS on these on a case by case basis by regulatory domain */
- -#define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\
- - NL80211_RRF_NO_IR)
- -#define ATH9K_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\
- - NL80211_RRF_NO_IR)
- -#define ATH9K_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 80, 0, 30,\
- - NL80211_RRF_NO_IR)
- -
- -#define ATH9K_2GHZ_ALL ATH9K_2GHZ_CH01_11, \
- - ATH9K_2GHZ_CH12_13, \
- - ATH9K_2GHZ_CH14
- -
- -#define ATH9K_5GHZ_ALL ATH9K_5GHZ_5150_5350, \
- - ATH9K_5GHZ_5470_5850
- +#define ATH9K_5GHZ REG_RULE(4900-10, 6100+10, 80, 0, 30, 0)
- /* This one skips what we call "mid band" */
- #define ATH9K_5GHZ_NO_MIDBAND ATH9K_5GHZ_5150_5350, \
- @@ -70,8 +57,8 @@ static int __ath_regd_init(struct ath_re
- static const struct ieee80211_regdomain ath_world_regdom_60_61_62 = {
- .alpha2 = "99",
- REGD_RULES(
- - ATH9K_2GHZ_ALL,
- - ATH9K_5GHZ_ALL,
- + ATH9K_2GHZ,
- + ATH9K_5GHZ,
- )
- };
- @@ -79,9 +66,8 @@ static const struct ieee80211_regdomain
- static const struct ieee80211_regdomain ath_world_regdom_63_65 = {
- .alpha2 = "99",
- REGD_RULES(
- - ATH9K_2GHZ_CH01_11,
- - ATH9K_2GHZ_CH12_13,
- - ATH9K_5GHZ_NO_MIDBAND,
- + ATH9K_2GHZ,
- + ATH9K_5GHZ,
- )
- };
- @@ -89,8 +75,8 @@ static const struct ieee80211_regdomain
- static const struct ieee80211_regdomain ath_world_regdom_64 = {
- .alpha2 = "99",
- REGD_RULES(
- - ATH9K_2GHZ_CH01_11,
- - ATH9K_5GHZ_NO_MIDBAND,
- + ATH9K_2GHZ,
- + ATH9K_5GHZ,
- )
- };
- @@ -98,8 +84,8 @@ static const struct ieee80211_regdomain
- static const struct ieee80211_regdomain ath_world_regdom_66_69 = {
- .alpha2 = "99",
- REGD_RULES(
- - ATH9K_2GHZ_CH01_11,
- - ATH9K_5GHZ_ALL,
- + ATH9K_2GHZ,
- + ATH9K_5GHZ,
- )
- };
- @@ -107,9 +93,8 @@ static const struct ieee80211_regdomain
- static const struct ieee80211_regdomain ath_world_regdom_67_68_6A_6C = {
- .alpha2 = "99",
- REGD_RULES(
- - ATH9K_2GHZ_CH01_11,
- - ATH9K_2GHZ_CH12_13,
- - ATH9K_5GHZ_ALL,
- + ATH9K_2GHZ,
- + ATH9K_5GHZ,
- )
- };
- diff -pur a/net/wireless/reg.c b/net/wireless/reg.c
- --- a/net/wireless/reg.c 2017-01-24 21:54:57.121925000 +0100
- +++ b/net/wireless/reg.c 2017-01-27 02:07:42.950011000 +0100
- @@ -220,15 +220,8 @@ static const struct ieee80211_regdomain
- .alpha2 = "00",
- .reg_rules = {
- /* IEEE 802.11b/g, channels 1..11 */
- - REG_RULE(2412-10, 2462+10, 40, 6, 20, 0),
- - /* IEEE 802.11b/g, channels 12..13. */
- - REG_RULE(2467-10, 2472+10, 20, 6, 20,
- - NL80211_RRF_NO_IR | NL80211_RRF_AUTO_BW),
- - /* IEEE 802.11 channel 14 - Only JP enables
- - * this and for 802.11b only */
- - REG_RULE(2484-10, 2484+10, 20, 6, 20,
- - NL80211_RRF_NO_IR |
- - NL80211_RRF_NO_OFDM),
- + REG_RULE(2192-10, 2472+10, 40, 6, 30, 0),
- + REG_RULE(2484-10, 2484+10, 40, 6, 30, 0),
- /* IEEE 802.11a, channel 36..48 */
- REG_RULE(5180-10, 5240+10, 80, 6, 20,
- NL80211_RRF_NO_IR |
- @@ -2812,13 +2805,6 @@ static int reg_set_rd_user(const struct
- if (!regdom_changes(rd->alpha2))
- return -EALREADY;
- - if (!is_valid_rd(rd)) {
- - pr_err("Invalid regulatory domain detected: %c%c\n",
- - rd->alpha2[0], rd->alpha2[1]);
- - print_regdomain_info(rd);
- - return -EINVAL;
- - }
- -
- if (!user_request->intersect) {
- reset_regdomains(false, rd);
- return 0;
- @@ -2849,13 +2835,6 @@ static int reg_set_rd_driver(const struc
- if (!regdom_changes(rd->alpha2))
- return -EALREADY;
- - if (!is_valid_rd(rd)) {
- - pr_err("Invalid regulatory domain detected: %c%c\n",
- - rd->alpha2[0], rd->alpha2[1]);
- - print_regdomain_info(rd);
- - return -EINVAL;
- - }
- -
- request_wiphy = wiphy_idx_to_wiphy(driver_request->wiphy_idx);
- if (!request_wiphy)
- return -ENODEV;
- @@ -2908,13 +2887,6 @@ static int reg_set_rd_country_ie(const s
- * and the pending request came in from a country IE
- */
- - if (!is_valid_rd(rd)) {
- - pr_err("Invalid regulatory domain detected: %c%c\n",
- - rd->alpha2[0], rd->alpha2[1]);
- - print_regdomain_info(rd);
- - return -EINVAL;
- - }
- -
- request_wiphy = wiphy_idx_to_wiphy(country_ie_request->wiphy_idx);
- if (!request_wiphy)
- return -ENODEV;
- @@ -3013,11 +2985,6 @@ static int __regulatory_set_wiphy_regd(s
- "wiphy should have REGULATORY_WIPHY_SELF_MANAGED\n"))
- return -EPERM;
- - if (WARN(!is_valid_rd(rd), "Invalid regulatory domain detected\n")) {
- - print_regdomain_info(rd);
- - return -EINVAL;
- - }
- -
- regd = reg_copy_regd(rd);
- if (IS_ERR(regd))
- return PTR_ERR(regd);
- diff -pur a/net/wireless/util.c b/net/wireless/util.c
- --- a/net/wireless/util.c 2017-01-27 03:07:40.868675258 +0100
- +++ b/net/wireless/util.c 2017-01-27 00:53:41.599777000 +0100
- @@ -73,6 +73,7 @@ int ieee80211_channel_to_frequency(int c
- return 0; /* not supported */
- switch (band) {
- case NL80211_BAND_2GHZ:
- + chan = (int)(char)chan;
- if (chan == 14)
- return 2484;
- else if (chan < 14)
- @@ -1449,7 +1450,14 @@ bool ieee80211_chandef_to_operating_clas
- if (chandef->width > NL80211_CHAN_WIDTH_40)
- return false;
- - *op_class = 82; /* channel 14 */
- + if (chandef->width == NL80211_CHAN_WIDTH_40) {
- + if (freq > chandef->chan->center_freq)
- + *op_class = 83; /* HT40+ */
- + else
- + *op_class = 84; /* HT40- */
- + } else {
- + *op_class = 81;
- + }
- return true;
- }
Add Comment
Please, Sign In to add comment