diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-12-14 17:07:08 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-12-14 17:07:08 +0000 |
commit | 43122f092ee5588d9f826d9ea470be8929b5be35 (patch) | |
tree | dcc6a45966b84db519841a242ff46181ef8943fa /package/kernel/mac80211/patches/523-ath9k_use_configured_antenna_gain.patch | |
parent | c411d7e762f2bd12685e86e0b162b88ec7432759 (diff) | |
download | upstream-43122f092ee5588d9f826d9ea470be8929b5be35.tar.gz upstream-43122f092ee5588d9f826d9ea470be8929b5be35.tar.bz2 upstream-43122f092ee5588d9f826d9ea470be8929b5be35.zip |
ath9k: merge another round of cleanups and fixes submitted to linux-wireless
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39054 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/mac80211/patches/523-ath9k_use_configured_antenna_gain.patch')
-rw-r--r-- | package/kernel/mac80211/patches/523-ath9k_use_configured_antenna_gain.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/523-ath9k_use_configured_antenna_gain.patch b/package/kernel/mac80211/patches/523-ath9k_use_configured_antenna_gain.patch new file mode 100644 index 0000000000..afc5ba64c1 --- /dev/null +++ b/package/kernel/mac80211/patches/523-ath9k_use_configured_antenna_gain.patch @@ -0,0 +1,34 @@ +--- a/drivers/net/wireless/ath/ath.h ++++ b/drivers/net/wireless/ath/ath.h +@@ -73,6 +73,7 @@ struct ath_regulatory { + u16 max_power_level; + u16 current_rd; + int16_t power_limit; ++ int16_t max_antenna_gain; + struct reg_dmn_pair_mapping *regpair; + }; + +--- a/drivers/net/wireless/ath/ath9k/hw.c ++++ b/drivers/net/wireless/ath/ath9k/hw.c +@@ -2841,7 +2841,7 @@ void ath9k_hw_apply_txpower(struct ath_h + channel = chan->chan; + chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER); + new_pwr = min_t(int, chan_pwr, reg->power_limit); +- max_gain = chan_pwr - new_pwr + channel->max_antenna_gain * 2; ++ max_gain = chan_pwr - new_pwr + reg->max_antenna_gain * 2; + + ant_gain = get_antenna_gain(ah, chan); + if (ant_gain > max_gain) +--- a/drivers/net/wireless/ath/ath9k/main.c ++++ b/drivers/net/wireless/ath/ath9k/main.c +@@ -1345,7 +1345,10 @@ static int ath9k_config(struct ieee80211 + } + + if (changed & IEEE80211_CONF_CHANGE_POWER) { ++ struct ath_regulatory *reg = ath9k_hw_regulatory(ah); ++ + ath_dbg(common, CONFIG, "Set power: %d\n", conf->power_level); ++ reg->max_antenna_gain = conf->max_antenna_gain; + sc->config.txpowlimit = 2 * conf->power_level; + ath9k_cmn_update_txpow(ah, sc->curtxpow, + sc->config.txpowlimit, &sc->curtxpow); |