rpcd: iwinfo plugin fixes
[openwrt.git] / package / kernel / mac80211 / patches / 305-ath9k-clean-up-ANI-per-channel-pointer-checking.patch
1 From: Miaoqing Pan <miaoqing@codeaurora.org>
2 Date: Fri, 15 Jan 2016 18:17:18 +0800
3 Subject: [PATCH] ath9k: clean up ANI per-channel pointer checking
4
5 commit c24bd3620c50 ("ath9k: Do not maintain ANI state per-channel")
6 removed per-channel handling, the code to check 'curchan' also
7 should be removed as never used.
8
9 Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>
10 ---
11
12 --- a/drivers/net/wireless/ath/ath9k/ani.c
13 +++ b/drivers/net/wireless/ath/ath9k/ani.c
14 @@ -126,12 +126,8 @@ static void ath9k_hw_update_mibstats(str
15  
16  static void ath9k_ani_restart(struct ath_hw *ah)
17  {
18 -       struct ar5416AniState *aniState;
19 -
20 -       if (!ah->curchan)
21 -               return;
22 +       struct ar5416AniState *aniState = &ah->ani;
23  
24 -       aniState = &ah->ani;
25         aniState->listenTime = 0;
26  
27         ENABLE_REGWRITE_BUFFER(ah);
28 @@ -221,12 +217,7 @@ static void ath9k_hw_set_ofdm_nil(struct
29  
30  static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
31  {
32 -       struct ar5416AniState *aniState;
33 -
34 -       if (!ah->curchan)
35 -               return;
36 -
37 -       aniState = &ah->ani;
38 +       struct ar5416AniState *aniState = &ah->ani;
39  
40         if (aniState->ofdmNoiseImmunityLevel < ATH9K_ANI_OFDM_MAX_LEVEL)
41                 ath9k_hw_set_ofdm_nil(ah, aniState->ofdmNoiseImmunityLevel + 1, false);
42 @@ -281,12 +272,7 @@ static void ath9k_hw_set_cck_nil(struct
43  
44  static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah)
45  {
46 -       struct ar5416AniState *aniState;
47 -
48 -       if (!ah->curchan)
49 -               return;
50 -
51 -       aniState = &ah->ani;
52 +       struct ar5416AniState *aniState = &ah->ani;
53  
54         if (aniState->cckNoiseImmunityLevel < ATH9K_ANI_CCK_MAX_LEVEL)
55                 ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel + 1,
56 @@ -299,9 +285,7 @@ static void ath9k_hw_ani_cck_err_trigger
57   */
58  static void ath9k_hw_ani_lower_immunity(struct ath_hw *ah)
59  {
60 -       struct ar5416AniState *aniState;
61 -
62 -       aniState = &ah->ani;
63 +       struct ar5416AniState *aniState = &ah->ani;
64  
65         /* lower OFDM noise immunity */
66         if (aniState->ofdmNoiseImmunityLevel > 0 &&
67 @@ -329,7 +313,7 @@ void ath9k_ani_reset(struct ath_hw *ah,
68         struct ath_common *common = ath9k_hw_common(ah);
69         int ofdm_nil, cck_nil;
70  
71 -       if (!ah->curchan)
72 +       if (!chan)
73                 return;
74  
75         BUG_ON(aniState == NULL);
76 @@ -416,14 +400,10 @@ static bool ath9k_hw_ani_read_counters(s
77  
78  void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
79  {
80 -       struct ar5416AniState *aniState;
81 +       struct ar5416AniState *aniState = &ah->ani;
82         struct ath_common *common = ath9k_hw_common(ah);
83         u32 ofdmPhyErrRate, cckPhyErrRate;
84  
85 -       if (!ah->curchan)
86 -               return;
87 -
88 -       aniState = &ah->ani;
89         if (!ath9k_hw_ani_read_counters(ah))
90                 return;
91