FIX: [mac80211] recognize ant gain also for chipsets without chanctx (ath9k)
FIX: [mac80211] do not try to get the max allowed output power if antgain was set BugzId: 75261 BugzId: 72714
This commit is contained in:
parent
6bf77c5803
commit
f25f37d343
|
|
@ -764,40 +764,42 @@ diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
|
|||
index bf305b2..7998620 100644
|
||||
--- a/net/mac80211/iface.c
|
||||
+++ b/net/mac80211/iface.c
|
||||
@@ -47,7 +47,7 @@ static void ieee80211_iface_work(struct work_struct *work);
|
||||
bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
|
||||
{
|
||||
struct ieee80211_chanctx_conf *chanctx_conf;
|
||||
- int power;
|
||||
+ int power, max_power;
|
||||
|
||||
rcu_read_lock();
|
||||
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
|
||||
@@ -56,7 +56,7 @@ bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
|
||||
return false;
|
||||
}
|
||||
|
||||
- power = ieee80211_chandef_max_power(&chanctx_conf->def);
|
||||
+ power = max_power = ieee80211_chandef_max_power(&chanctx_conf->def);
|
||||
rcu_read_unlock();
|
||||
|
||||
if (sdata->user_power_level != IEEE80211_UNSET_POWER_LEVEL)
|
||||
@@ -65,6 +65,11 @@ bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
|
||||
@@ -65,6 +65,10 @@ bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
|
||||
if (sdata->ap_power_level != IEEE80211_UNSET_POWER_LEVEL)
|
||||
power = min(power, sdata->ap_power_level);
|
||||
|
||||
+ if (sdata->local->user_antenna_gain > 0 && sdata->local->use_chanctx) {
|
||||
+ max_power -= sdata->local->user_antenna_gain;
|
||||
+ power = min(power, max_power);
|
||||
+ if (sdata->local->user_antenna_gain > 0) {
|
||||
+ power -= sdata->local->user_antenna_gain;
|
||||
+ }
|
||||
+
|
||||
if (power != sdata->vif.bss_conf.txpower) {
|
||||
sdata->vif.bss_conf.txpower = power;
|
||||
ieee80211_hw_config(sdata->local, 0);
|
||||
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
|
||||
index 44076fb..293bfec 100644
|
||||
index 293bfec..5513370 100644
|
||||
--- a/net/mac80211/main.c
|
||||
+++ b/net/mac80211/main.c
|
||||
@@ -96,7 +96,7 @@ static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local)
|
||||
struct ieee80211_sub_if_data *sdata;
|
||||
struct cfg80211_chan_def chandef = {};
|
||||
u32 changed = 0;
|
||||
- int power, max_power;
|
||||
+ int power;
|
||||
u32 offchannel_flag;
|
||||
|
||||
offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
|
||||
@@ -157,10 +157,8 @@ static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local)
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
- max_power = chandef.chan->max_reg_power;
|
||||
if (local->user_antenna_gain > 0) {
|
||||
- max_power -= local->user_antenna_gain;
|
||||
- power = min(power, max_power);
|
||||
+ power -= local->user_antenna_gain;
|
||||
}
|
||||
|
||||
if (local->hw.conf.power_level != power) {
|
||||
@@ -532,7 +532,7 @@ static const struct ieee80211_vht_cap mac80211_vht_capa_mod_mask = {
|
||||
|
||||
struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
|
||||
|
|
|
|||
Loading…
Reference in New Issue