summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorMoshe Benji <Moshe.Benji@intel.com>2014-12-14 04:05:50 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-12-17 09:45:16 -0500
commita5fee9cb6255b9bba5a977f92cb4807eafb89db0 (patch)
treecfd4d46e258e77e724d3c48357ada652256456c8 /net/mac80211/mlme.c
parent179b8fc7fb59ec69835f225e6c813040bbf52ba8 (diff)
mac80211: handle power constraint and country IEs in RRM
In beacons, handle the Country IE even if no Power Constraint IE is present, and, capability wise, also in case that the Radio Measurements capability is enabled. In cases where the Country IE should be handled and that the Power Constraint IE is not present, the Country IE alone will set the power limit (and not both Country and Power Constraint IEs). Signed-off-by: Moshe Benji <moshe.benji@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 877b647d3e5c..38129dc4e7ca 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1287,8 +1287,11 @@ ieee80211_find_80211h_pwr_constr(struct ieee80211_sub_if_data *sdata,
1287 country_ie_len -= 3; 1287 country_ie_len -= 3;
1288 } 1288 }
1289 1289
1290 if (have_chan_pwr) 1290 if (have_chan_pwr && pwr_constr_elem)
1291 *pwr_reduction = *pwr_constr_elem; 1291 *pwr_reduction = *pwr_constr_elem;
1292 else
1293 *pwr_reduction = 0;
1294
1292 return have_chan_pwr; 1295 return have_chan_pwr;
1293} 1296}
1294 1297
@@ -1317,10 +1320,11 @@ static u32 ieee80211_handle_pwr_constr(struct ieee80211_sub_if_data *sdata,
1317 int chan_pwr = 0, pwr_reduction_80211h = 0; 1320 int chan_pwr = 0, pwr_reduction_80211h = 0;
1318 int pwr_level_cisco, pwr_level_80211h; 1321 int pwr_level_cisco, pwr_level_80211h;
1319 int new_ap_level; 1322 int new_ap_level;
1323 __le16 capab = mgmt->u.probe_resp.capab_info;
1320 1324
1321 if (country_ie && pwr_constr_ie && 1325 if (country_ie &&
1322 mgmt->u.probe_resp.capab_info & 1326 (capab & cpu_to_le16(WLAN_CAPABILITY_SPECTRUM_MGMT) ||
1323 cpu_to_le16(WLAN_CAPABILITY_SPECTRUM_MGMT)) { 1327 capab & cpu_to_le16(WLAN_CAPABILITY_RADIO_MEASURE))) {
1324 has_80211h_pwr = ieee80211_find_80211h_pwr_constr( 1328 has_80211h_pwr = ieee80211_find_80211h_pwr_constr(
1325 sdata, channel, country_ie, country_ie_len, 1329 sdata, channel, country_ie, country_ie_len,
1326 pwr_constr_ie, &chan_pwr, &pwr_reduction_80211h); 1330 pwr_constr_ie, &chan_pwr, &pwr_reduction_80211h);