aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/521-ath9k_cur_txpower.patch
blob: ab59411db9d9c85283b39d20001a7f6522416a13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -313,8 +313,12 @@ static int ath_reset_internal(struct ath
 	    (sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL))
 		ath9k_mci_set_txpower(sc, true, false);
 
-	if (!ath_complete_reset(sc, true))
+	if (!ath_complete_reset(sc, true)) {
 		r = -EIO;
+		goto out;
+	}
+
+	sc->hw->cur_power_level = sc->curtxpow / 2;
 
 out:
 	spin_unlock_bh(&sc->sc_pcu_lock);
@@ -1340,6 +1344,7 @@ static int ath9k_config(struct ieee80211
 		sc->config.txpowlimit = 2 * conf->power_level;
 		ath9k_cmn_update_txpow(ah, sc->curtxpow,
 				       sc->config.txpowlimit, &sc->curtxpow);
+		hw->cur_power_level = sc->curtxpow / 2;
 	}
 
 	mutex_unlock(&sc->mutex);