diff options
-rw-r--r-- | include/net/cfg80211.h | 4 | ||||
-rw-r--r-- | net/wireless/reg.c | 20 |
2 files changed, 19 insertions, 5 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 5eda5933ae01..9f85fca0b676 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1699,7 +1699,9 @@ struct cfg80211_ops { | |||
1699 | * regulatory domain no user regulatory domain can enable these channels | 1699 | * regulatory domain no user regulatory domain can enable these channels |
1700 | * at a later time. This can be used for devices which do not have | 1700 | * at a later time. This can be used for devices which do not have |
1701 | * calibration information guaranteed for frequencies or settings | 1701 | * calibration information guaranteed for frequencies or settings |
1702 | * outside of its regulatory domain. | 1702 | * outside of its regulatory domain. If used in combination with |
1703 | * WIPHY_FLAG_CUSTOM_REGULATORY the inspected country IE power settings | ||
1704 | * will be followed. | ||
1703 | * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure | 1705 | * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure |
1704 | * that passive scan flags and beaconing flags may not be lifted by | 1706 | * that passive scan flags and beaconing flags may not be lifted by |
1705 | * cfg80211 due to regulatory beacon hints. For more information on beacon | 1707 | * cfg80211 due to regulatory beacon hints. For more information on beacon |
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 | ||