mac80211: really fix the long standing wds ap tx power regression (#14153)
authorFelix Fietkau <nbd@openwrt.org>
Sun, 29 Sep 2013 12:53:21 +0000 (12:53 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 29 Sep 2013 12:53:21 +0000 (12:53 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 38255

package/kernel/mac80211/patches/300-pending_work.patch
package/kernel/mac80211/patches/523-mac80211_configure_antenna_gain.patch

index 53884e53dc471913a8401cd0e96b9fd196afdfdf..2a96b6adafbadb78477db984c4671fb211d2c482 100644 (file)
  #define AR_SREV_9485_OR_LATER(_ah) \
        (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9485))
  
+--- a/net/mac80211/main.c
++++ b/net/mac80211/main.c
+@@ -101,7 +101,7 @@ static u32 ieee80211_hw_conf_chan(struct
+       struct ieee80211_sub_if_data *sdata;
+       struct cfg80211_chan_def chandef = {};
+       u32 changed = 0;
+-      int power;
++      int power = 0;
+       u32 offchannel_flag;
+       offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
+@@ -155,16 +155,16 @@ static u32 ieee80211_hw_conf_chan(struct
+               changed |= IEEE80211_CONF_CHANGE_SMPS;
+       }
+-      power = chandef.chan->max_power;
+-
+       rcu_read_lock();
+       list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+               if (!rcu_access_pointer(sdata->vif.chanctx_conf))
+                       continue;
+-              power = min(power, sdata->vif.bss_conf.txpower);
++              power = max(power, sdata->vif.bss_conf.txpower);
+       }
+       rcu_read_unlock();
++      power = min(power, chandef.chan->max_power);
++
+       if (local->hw.conf.power_level != power) {
+               changed |= IEEE80211_CONF_CHANGE_POWER;
+               local->hw.conf.power_level = power;
index 54da9f692f4765e06b6f6e4bb99e1b8105fdde33..f223f7e78b760253067330ad1af046e87a9190ec 100644 (file)
                                const u8 *addr);
 --- a/net/mac80211/main.c
 +++ b/net/mac80211/main.c
-@@ -101,7 +101,7 @@ static u32 ieee80211_hw_conf_chan(struct
-       struct ieee80211_sub_if_data *sdata;
+@@ -102,6 +102,7 @@ static u32 ieee80211_hw_conf_chan(struct
        struct cfg80211_chan_def chandef = {};
        u32 changed = 0;
--      int power;
-+      int power, ant_gain, max_power;
+       int power = 0;
++      int ant_gain, max_power;
        u32 offchannel_flag;
  
        offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
-@@ -165,8 +165,21 @@ static u32 ieee80211_hw_conf_chan(struct
-       }
-       rcu_read_unlock();
+@@ -165,8 +166,21 @@ static u32 ieee80211_hw_conf_chan(struct
+       power = min(power, chandef.chan->max_power);
  
 -      if (local->hw.conf.power_level != power) {
 +      max_power = chandef.chan->max_reg_power;
                local->hw.cur_power_level = power;
                local->hw.conf.power_level = power;
        }
-@@ -597,6 +610,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(
+@@ -597,6 +611,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(
                                         IEEE80211_RADIOTAP_MCS_HAVE_BW;
        local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI |
                                         IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH;