mac80211: try to workaround some brcmfmac bug with handling interfaces
[15.05/openwrt.git] / package / kernel / mac80211 / patches / 330-ath9k-use-rmw-buffer-in-ath9k_hw_set_operating_mode-.patch
1 From: Oleksij Rempel <linux@rempel-privat.de>
2 Date: Sun, 22 Mar 2015 19:29:57 +0100
3 Subject: [PATCH] ath9k: use rmw buffer in ath9k_hw_set_operating_mode
4  and ath9k_hw_reset
5
6 Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
7 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 ---
9
10 --- a/drivers/net/wireless/ath/ath9k/hw.c
11 +++ b/drivers/net/wireless/ath/ath9k/hw.c
12 @@ -1227,6 +1227,7 @@ static void ath9k_hw_set_operating_mode(
13         u32 mask = AR_STA_ID1_STA_AP | AR_STA_ID1_ADHOC;
14         u32 set = AR_STA_ID1_KSRCH_MODE;
15  
16 +       ENABLE_REG_RMW_BUFFER(ah);
17         switch (opmode) {
18         case NL80211_IFTYPE_ADHOC:
19                 if (!AR_SREV_9340_13(ah)) {
20 @@ -1248,6 +1249,7 @@ static void ath9k_hw_set_operating_mode(
21                 break;
22         }
23         REG_RMW(ah, AR_STA_ID1, set, mask);
24 +       REG_RMW_BUFFER_FLUSH(ah);
25  }
26  
27  void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled,
28 @@ -1960,6 +1962,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
29         if (!ath9k_hw_mci_is_enabled(ah))
30                 REG_WRITE(ah, AR_OBS, 8);
31  
32 +       ENABLE_REG_RMW_BUFFER(ah);
33         if (ah->config.rx_intr_mitigation) {
34                 REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, ah->config.rimt_last);
35                 REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, ah->config.rimt_first);
36 @@ -1969,6 +1972,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
37                 REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_LAST, 300);
38                 REG_RMW_FIELD(ah, AR_TIMT, AR_TIMT_FIRST, 750);
39         }
40 +       REG_RMW_BUFFER_FLUSH(ah);
41  
42         ath9k_hw_init_bb(ah, chan);
43