Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c020dc6 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville
Browse files

ath9k: Allow user to change tx power when asked



We were also changing tx power even when we were not asked to,
this enforces the change only when we are asked nicely. When
not asked we simply try to use the max power, we don't tx power
at all for rate control.

Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f97e4007
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1250,6 +1250,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
		sc->sc_ah->ah_channels[pos].chanmode =
			ath_get_extchanmode(sc, curchan);

	if (changed & IEEE80211_CONF_CHANGE_POWER)
		sc->sc_config.txpowlimit = 2 * conf->power_level;

	/* set h/w channel */
+7 −1
Original line number Diff line number Diff line
@@ -230,7 +230,13 @@ static int ath_tx_prepare(struct ath_softc *sc,

	txctl->if_id = 0;
	txctl->frmlen = skb->len + FCS_LEN - (hdrlen & 3);
	txctl->txpower = MAX_RATE_POWER; /* FIXME */

	/* Always try at highest power possible unless the the device
	 * was configured by the user to use another power. */
	if (likely(sc->sc_config.txpowlimit == ATH_TXPOWER_MAX))
		txctl->txpower = ATH_TXPOWER_MAX;
	else
		txctl->txpower = sc->sc_config.txpowlimit;

	/* Fill Key related fields */