mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
cfg80211/mac80211: use reduced txpower for 5 and 10 MHz
Some regulations (like germany, but also FCC) express their transmission power limit in dBm/MHz or mW/MHz. To cope with that and be on the safe side, reduce the maximum power to half (10 MHz) or quarter (5 MHz) when operating on these reduced bandwidth channels. Signed-off-by: Simon Wunderlich <[email protected]> Signed-off-by: Mathias Kretschmer <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
This commit is contained in:
parent
74608aca4d
commit
0430c88347
4 changed files with 31 additions and 3 deletions
|
|
@ -54,7 +54,7 @@ bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
|
|||
return false;
|
||||
}
|
||||
|
||||
power = chanctx_conf->def.chan->max_power;
|
||||
power = ieee80211_chandef_max_power(&chanctx_conf->def);
|
||||
rcu_read_unlock();
|
||||
|
||||
if (sdata->user_power_level != IEEE80211_UNSET_POWER_LEVEL)
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local)
|
|||
changed |= IEEE80211_CONF_CHANGE_SMPS;
|
||||
}
|
||||
|
||||
power = chandef.chan->max_power;
|
||||
power = ieee80211_chandef_max_power(&chandef);
|
||||
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(sdata, &local->interfaces, list) {
|
||||
|
|
|
|||
|
|
@ -747,7 +747,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
|
|||
*pos++ = WLAN_EID_PWR_CAPABILITY;
|
||||
*pos++ = 2;
|
||||
*pos++ = 0; /* min tx power */
|
||||
*pos++ = chan->max_power; /* max tx power */
|
||||
/* max tx power */
|
||||
*pos++ = ieee80211_chandef_max_power(&chanctx_conf->def);
|
||||
|
||||
/* 2. supported channels */
|
||||
/* TODO: get this in reg domain format */
|
||||
|
|
|
|||
Loading…
Reference in a new issue