ath9k: fix tx queueing issues after background scans
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 524-ath9k_use_configured_antenna_gain.patch
1 --- a/drivers/net/wireless/ath/ath.h
2 +++ b/drivers/net/wireless/ath/ath.h
3 @@ -73,6 +73,7 @@ struct ath_regulatory {
4 u16 max_power_level;
5 u16 current_rd;
6 int16_t power_limit;
7 + int16_t max_antenna_gain;
8 struct reg_dmn_pair_mapping *regpair;
9 };
10
11 --- a/drivers/net/wireless/ath/ath9k/hw.c
12 +++ b/drivers/net/wireless/ath/ath9k/hw.c
13 @@ -2847,7 +2847,7 @@ void ath9k_hw_apply_txpower(struct ath_h
14 channel = chan->chan;
15 chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER);
16 new_pwr = min_t(int, chan_pwr, reg->power_limit);
17 - max_gain = chan_pwr - new_pwr + channel->max_antenna_gain * 2;
18 + max_gain = chan_pwr - new_pwr + reg->max_antenna_gain * 2;
19
20 ant_gain = get_antenna_gain(ah, chan);
21 if (ant_gain > max_gain)
22 --- a/drivers/net/wireless/ath/ath9k/main.c
23 +++ b/drivers/net/wireless/ath/ath9k/main.c
24 @@ -1291,7 +1291,10 @@ int ath9k_config(struct ieee80211_hw *hw
25 }
26
27 if (changed & IEEE80211_CONF_CHANGE_POWER) {
28 + struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
29 +
30 ath_dbg(common, CONFIG, "Set power: %d\n", conf->power_level);
31 + reg->max_antenna_gain = conf->max_antenna_gain;
32 sc->config.txpowlimit = 2 * conf->power_level;
33 ath9k_cmn_update_txpow(ah, sc->curtxpow,
34 sc->config.txpowlimit, &sc->curtxpow);