diff options
author | Nick Kossifidis <mick@madwifi-project.org> | 2009-04-30 15:55:44 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:14:55 -0400 |
commit | a082381044ce026e83dbd17f8837722b028fc07d (patch) | |
tree | 181ef0bcdf8b69fa5aaf20da4b1e811feb57abd6 /drivers/net/wireless/ath/ath5k/base.c | |
parent | 15e469284d5e89c9113379b68566b0e059a97704 (diff) |
ath5k: Allow user/driver to set txpower
* Now that we have regulatory control enable the driver to set
txpower on hw
* Also use txpower table offset so that we can match
power range set by user/driver with indices on power table.
Tested 2 different cards (a CM9 and an RF5112-based ubnt) and got
the same output using a remote machine to measure per-packet rssi
(conected the cards using attenuators). I also switched between
various tx power levels and i saw an equal power change on the remote
machine (so txpower changes as expected) and verified that we have
the same output on each rate.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/base.c')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 7b80cebffd41..d70856a9520e 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -2747,12 +2747,21 @@ static int | |||
2747 | ath5k_config(struct ieee80211_hw *hw, u32 changed) | 2747 | ath5k_config(struct ieee80211_hw *hw, u32 changed) |
2748 | { | 2748 | { |
2749 | struct ath5k_softc *sc = hw->priv; | 2749 | struct ath5k_softc *sc = hw->priv; |
2750 | struct ath5k_hw *ah = sc->ah; | ||
2750 | struct ieee80211_conf *conf = &hw->conf; | 2751 | struct ieee80211_conf *conf = &hw->conf; |
2751 | int ret; | 2752 | int ret; |
2752 | 2753 | ||
2753 | mutex_lock(&sc->lock); | 2754 | mutex_lock(&sc->lock); |
2754 | 2755 | ||
2755 | sc->power_level = conf->power_level; | 2756 | sc->bintval = conf->beacon_int; |
2757 | |||
2758 | if ((changed & IEEE80211_CONF_CHANGE_POWER) && | ||
2759 | (sc->power_level != conf->power_level)) { | ||
2760 | sc->power_level = conf->power_level; | ||
2761 | |||
2762 | /* Half dB steps */ | ||
2763 | ath5k_hw_set_txpower_limit(ah, (conf->power_level * 2)); | ||
2764 | } | ||
2756 | 2765 | ||
2757 | ret = ath5k_chan_set(sc, conf->channel); | 2766 | ret = ath5k_chan_set(sc, conf->channel); |
2758 | 2767 | ||