aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorHong Wu <Hong.Wu@dspg.com>2012-01-11 13:33:39 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-01-24 14:16:54 -0500
commiteccc068e8e84c8fe997115629925e0422a98e4de (patch)
tree399c387868028130d6d9ca530cb23557103de4dc /net/wireless/reg.c
parente2d75c136f8df4a4e28ece75c475a65b9292729a (diff)
wireless: Save original maximum regulatory transmission power for the calucation of the local maximum transmit power
The local maximum transmit power is the maximum power a wireless device allowed to transmit. If Power Constraint is presented, the local maximum power equals to the maximum allowed power defined in regulatory domain minus power constraint. The maximum transmit power is maximum power a wireless device capable of transmitting, and should be used in Power Capability element (7.3.2.16 IEEE802.11 2007). The transmit power from a wireless device should not greater than the local maximum transmit power. The maximum transmit power was not calculated correctly in the current Linux wireless/mac80211 when Power Constraint is presented. Signed-off-by: Hong Wu <hong.wu@dspg.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index f65feaad155f..e9a0ac83b84c 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -882,23 +882,8 @@ static void handle_channel(struct wiphy *wiphy,
882 chan->flags = flags | bw_flags | map_regdom_flags(reg_rule->flags); 882 chan->flags = flags | bw_flags | map_regdom_flags(reg_rule->flags);
883 chan->max_antenna_gain = min(chan->orig_mag, 883 chan->max_antenna_gain = min(chan->orig_mag,
884 (int) MBI_TO_DBI(power_rule->max_antenna_gain)); 884 (int) MBI_TO_DBI(power_rule->max_antenna_gain));
885 if (chan->orig_mpwr) { 885 chan->max_reg_power = (int) MBM_TO_DBM(power_rule->max_eirp);
886 /* 886 chan->max_power = min(chan->max_power, chan->max_reg_power);
887 * Devices that have their own custom regulatory domain
888 * but also use WIPHY_FLAG_STRICT_REGULATORY will follow the
889 * passed country IE power settings.
890 */
891 if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE &&
892 wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY &&
893 wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) {
894 chan->max_power =
895 MBM_TO_DBM(power_rule->max_eirp);
896 } else {
897 chan->max_power = min(chan->orig_mpwr,
898 (int) MBM_TO_DBM(power_rule->max_eirp));
899 }
900 } else
901 chan->max_power = (int) MBM_TO_DBM(power_rule->max_eirp);
902} 887}
903 888
904static void handle_band(struct wiphy *wiphy, 889static void handle_band(struct wiphy *wiphy,