diff options
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/reg.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 2f5b0505c95d..481caafc6ba5 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -873,10 +873,22 @@ static void handle_channel(struct wiphy *wiphy, | |||
873 | chan->flags = flags | bw_flags | map_regdom_flags(reg_rule->flags); | 873 | chan->flags = flags | bw_flags | map_regdom_flags(reg_rule->flags); |
874 | chan->max_antenna_gain = min(chan->orig_mag, | 874 | chan->max_antenna_gain = min(chan->orig_mag, |
875 | (int) MBI_TO_DBI(power_rule->max_antenna_gain)); | 875 | (int) MBI_TO_DBI(power_rule->max_antenna_gain)); |
876 | if (chan->orig_mpwr) | 876 | if (chan->orig_mpwr) { |
877 | chan->max_power = min(chan->orig_mpwr, | 877 | /* |
878 | (int) MBM_TO_DBM(power_rule->max_eirp)); | 878 | * Devices that have their own custom regulatory domain |
879 | else | 879 | * but also use WIPHY_FLAG_STRICT_REGULATORY will follow the |
880 | * passed country IE power settings. | ||
881 | */ | ||
882 | if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE && | ||
883 | wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY && | ||
884 | wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) { | ||
885 | chan->max_power = | ||
886 | MBM_TO_DBM(power_rule->max_eirp); | ||
887 | } else { | ||
888 | chan->max_power = min(chan->orig_mpwr, | ||
889 | (int) MBM_TO_DBM(power_rule->max_eirp)); | ||
890 | } | ||
891 | } else | ||
880 | chan->max_power = (int) MBM_TO_DBM(power_rule->max_eirp); | 892 | chan->max_power = (int) MBM_TO_DBM(power_rule->max_eirp); |
881 | } | 893 | } |
882 | 894 | ||