mac80211: update brcmfmac including missing boardrev workaround
[openwrt.git] / package / kernel / mac80211 / patches / 545-ath9k_ani_ws_detect.patch
1 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
2 +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
3 @@ -956,55 +956,6 @@ static bool ar5008_hw_ani_control_new(st
4                  * on == 0 means more noise imm
5                  */
6                 u32 on = param ? 1 : 0;
7 -               /*
8 -                * make register setting for default
9 -                * (weak sig detect ON) come from INI file
10 -                */
11 -               int m1ThreshLow = on ?
12 -                       aniState->iniDef.m1ThreshLow : m1ThreshLow_off;
13 -               int m2ThreshLow = on ?
14 -                       aniState->iniDef.m2ThreshLow : m2ThreshLow_off;
15 -               int m1Thresh = on ?
16 -                       aniState->iniDef.m1Thresh : m1Thresh_off;
17 -               int m2Thresh = on ?
18 -                       aniState->iniDef.m2Thresh : m2Thresh_off;
19 -               int m2CountThr = on ?
20 -                       aniState->iniDef.m2CountThr : m2CountThr_off;
21 -               int m2CountThrLow = on ?
22 -                       aniState->iniDef.m2CountThrLow : m2CountThrLow_off;
23 -               int m1ThreshLowExt = on ?
24 -                       aniState->iniDef.m1ThreshLowExt : m1ThreshLowExt_off;
25 -               int m2ThreshLowExt = on ?
26 -                       aniState->iniDef.m2ThreshLowExt : m2ThreshLowExt_off;
27 -               int m1ThreshExt = on ?
28 -                       aniState->iniDef.m1ThreshExt : m1ThreshExt_off;
29 -               int m2ThreshExt = on ?
30 -                       aniState->iniDef.m2ThreshExt : m2ThreshExt_off;
31 -
32 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
33 -                             AR_PHY_SFCORR_LOW_M1_THRESH_LOW,
34 -                             m1ThreshLow);
35 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
36 -                             AR_PHY_SFCORR_LOW_M2_THRESH_LOW,
37 -                             m2ThreshLow);
38 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR,
39 -                             AR_PHY_SFCORR_M1_THRESH, m1Thresh);
40 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR,
41 -                             AR_PHY_SFCORR_M2_THRESH, m2Thresh);
42 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR,
43 -                             AR_PHY_SFCORR_M2COUNT_THR, m2CountThr);
44 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
45 -                             AR_PHY_SFCORR_LOW_M2COUNT_THR_LOW,
46 -                             m2CountThrLow);
47 -
48 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
49 -                             AR_PHY_SFCORR_EXT_M1_THRESH_LOW, m1ThreshLowExt);
50 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
51 -                             AR_PHY_SFCORR_EXT_M2_THRESH_LOW, m2ThreshLowExt);
52 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
53 -                             AR_PHY_SFCORR_EXT_M1_THRESH, m1ThreshExt);
54 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
55 -                             AR_PHY_SFCORR_EXT_M2_THRESH, m2ThreshExt);
56  
57                 if (on)
58                         REG_SET_BIT(ah, AR_PHY_SFCORR_LOW,
59 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
60 +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
61 @@ -41,20 +41,6 @@ static const int cycpwrThr1_table[] =
62  /* level:  0   1   2   3   4   5   6   7   8  */
63         { -6, -4, -2,  0,  2,  4,  6,  8 };     /* lvl 0-7, default 3 */
64  
65 -/*
66 - * register values to turn OFDM weak signal detection OFF
67 - */
68 -static const int m1ThreshLow_off = 127;
69 -static const int m2ThreshLow_off = 127;
70 -static const int m1Thresh_off = 127;
71 -static const int m2Thresh_off = 127;
72 -static const int m2CountThr_off =  31;
73 -static const int m2CountThrLow_off =  63;
74 -static const int m1ThreshLowExt_off = 127;
75 -static const int m2ThreshLowExt_off = 127;
76 -static const int m1ThreshExt_off = 127;
77 -static const int m2ThreshExt_off = 127;
78 -
79  static const u8 ofdm2pwr[] = {
80         ALL_TARGET_LEGACY_6_24,
81         ALL_TARGET_LEGACY_6_24,
82 @@ -1089,11 +1075,6 @@ static bool ar9003_hw_ani_control(struct
83         struct ath_common *common = ath9k_hw_common(ah);
84         struct ath9k_channel *chan = ah->curchan;
85         struct ar5416AniState *aniState = &ah->ani;
86 -       int m1ThreshLow, m2ThreshLow;
87 -       int m1Thresh, m2Thresh;
88 -       int m2CountThr, m2CountThrLow;
89 -       int m1ThreshLowExt, m2ThreshLowExt;
90 -       int m1ThreshExt, m2ThreshExt;
91         s32 value, value2;
92  
93         switch (cmd & ah->ani_function) {
94 @@ -1107,61 +1088,6 @@ static bool ar9003_hw_ani_control(struct
95                  */
96                 u32 on = param ? 1 : 0;
97  
98 -               if (AR_SREV_9462(ah) || AR_SREV_9565(ah))
99 -                       goto skip_ws_det;
100 -
101 -               m1ThreshLow = on ?
102 -                       aniState->iniDef.m1ThreshLow : m1ThreshLow_off;
103 -               m2ThreshLow = on ?
104 -                       aniState->iniDef.m2ThreshLow : m2ThreshLow_off;
105 -               m1Thresh = on ?
106 -                       aniState->iniDef.m1Thresh : m1Thresh_off;
107 -               m2Thresh = on ?
108 -                       aniState->iniDef.m2Thresh : m2Thresh_off;
109 -               m2CountThr = on ?
110 -                       aniState->iniDef.m2CountThr : m2CountThr_off;
111 -               m2CountThrLow = on ?
112 -                       aniState->iniDef.m2CountThrLow : m2CountThrLow_off;
113 -               m1ThreshLowExt = on ?
114 -                       aniState->iniDef.m1ThreshLowExt : m1ThreshLowExt_off;
115 -               m2ThreshLowExt = on ?
116 -                       aniState->iniDef.m2ThreshLowExt : m2ThreshLowExt_off;
117 -               m1ThreshExt = on ?
118 -                       aniState->iniDef.m1ThreshExt : m1ThreshExt_off;
119 -               m2ThreshExt = on ?
120 -                       aniState->iniDef.m2ThreshExt : m2ThreshExt_off;
121 -
122 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
123 -                             AR_PHY_SFCORR_LOW_M1_THRESH_LOW,
124 -                             m1ThreshLow);
125 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
126 -                             AR_PHY_SFCORR_LOW_M2_THRESH_LOW,
127 -                             m2ThreshLow);
128 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR,
129 -                             AR_PHY_SFCORR_M1_THRESH,
130 -                             m1Thresh);
131 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR,
132 -                             AR_PHY_SFCORR_M2_THRESH,
133 -                             m2Thresh);
134 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR,
135 -                             AR_PHY_SFCORR_M2COUNT_THR,
136 -                             m2CountThr);
137 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
138 -                             AR_PHY_SFCORR_LOW_M2COUNT_THR_LOW,
139 -                             m2CountThrLow);
140 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
141 -                             AR_PHY_SFCORR_EXT_M1_THRESH_LOW,
142 -                             m1ThreshLowExt);
143 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
144 -                             AR_PHY_SFCORR_EXT_M2_THRESH_LOW,
145 -                             m2ThreshLowExt);
146 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
147 -                             AR_PHY_SFCORR_EXT_M1_THRESH,
148 -                             m1ThreshExt);
149 -               REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT,
150 -                             AR_PHY_SFCORR_EXT_M2_THRESH,
151 -                             m2ThreshExt);
152 -skip_ws_det:
153                 if (on)
154                         REG_SET_BIT(ah, AR_PHY_SFCORR_LOW,
155                                     AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);