-@@ -2441,13 +2450,13 @@ void ath9k_hw_set_txpowerlimit(struct at
- struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
- struct ath9k_channel *chan = ah->curchan;
- struct ieee80211_channel *channel = chan->chan;
-- int reg_pwr = min_t(int, MAX_RATE_POWER, regulatory->power_limit);
-+ int reg_pwr = min_t(int, MAX_RATE_POWER, limit);
- int chan_pwr = channel->max_power * 2;
-
- if (test)
- reg_pwr = chan_pwr = MAX_RATE_POWER;
-
-- regulatory->power_limit = min(limit, (u32) MAX_RATE_POWER);
-+ regulatory->power_limit = reg_pwr;
-
- ah->eep_ops->set_txpower(ah, chan,
- ath9k_regd_get_ctl(regulatory, chan),
---- a/drivers/net/wireless/ath/ath9k/reg.h
-+++ b/drivers/net/wireless/ath/ath9k/reg.h
-@@ -619,6 +619,7 @@
- #define AR_D_GBL_IFS_EIFS 0x10b0
- #define AR_D_GBL_IFS_EIFS_M 0x0000FFFF
- #define AR_D_GBL_IFS_EIFS_RESV0 0xFFFF0000
-+#define AR_D_GBL_IFS_EIFS_ASYNC_FIFO 363
-
- #define AR_D_GBL_IFS_MISC 0x10f0
- #define AR_D_GBL_IFS_MISC_LFSR_SLICE_SEL 0x00000007
-@@ -1503,6 +1504,7 @@ enum {
- #define AR_USEC_TX_LAT_S 14
- #define AR_USEC_RX_LAT 0x1F800000
- #define AR_USEC_RX_LAT_S 23
-+#define AR_USEC_ASYNC_FIFO 0x12E00074
-
- #define AR_RESET_TSF 0x8020
- #define AR_RESET_TSF_ONCE 0x01000000
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -582,7 +582,10 @@ static bool ath_lookup_legacy(struct ath
- tx_info = IEEE80211_SKB_CB(skb);
- rates = tx_info->control.rates;
-
-- for (i = 3; i >= 0; i--) {
-+ for (i = 0; i < 4; i++) {
-+ if (!rates[i].count || rates[i].idx < 0)
-+ break;