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