-
Notifications
You must be signed in to change notification settings - Fork 203
/
Copy pathlinux-4.9.28-ath9k_htc-misc.patch
319 lines (295 loc) · 11.9 KB
/
linux-4.9.28-ath9k_htc-misc.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
diff -Naur linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/common-init.c linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/common-init.c
--- linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/common-init.c 2017-05-15 17:23:14.000000000 +0200
+++ linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/common-init.c 2017-07-05 22:29:13.285134611 +0200
@@ -22,14 +22,14 @@
.band = NL80211_BAND_2GHZ, \
.center_freq = (_freq), \
.hw_value = (_idx), \
- .max_power = 20, \
+ .max_power = 30, \
}
#define CHAN5G(_freq, _idx) { \
.band = NL80211_BAND_5GHZ, \
.center_freq = (_freq), \
.hw_value = (_idx), \
- .max_power = 20, \
+ .max_power = 30, \
}
/* Some 2 GHz radios are actually tunable on 2312-2732
@@ -37,6 +37,27 @@
* we have calibration data for all cards though to make
* this static */
static const struct ieee80211_channel ath9k_2ghz_chantable[] = {
+ CHAN2G(2312, 34), /* Channel XX */
+ CHAN2G(2317, 35), /* Channel XX */
+ CHAN2G(2322, 36), /* Channel XX */
+ CHAN2G(2327, 37), /* Channel XX */
+ CHAN2G(2332, 38), /* Channel XX */
+ CHAN2G(2337, 39), /* Channel XX */
+ CHAN2G(2342, 40), /* Channel XX */
+ CHAN2G(2347, 41), /* Channel XX */
+ CHAN2G(2352, 42), /* Channel XX */
+ CHAN2G(2357, 43), /* Channel XX */
+ CHAN2G(2362, 44), /* Channel XX */
+ CHAN2G(2367, 45), /* Channel XX */
+ CHAN2G(2372, 46), /* Channel XX */
+ CHAN2G(2377, 47), /* Channel XX */
+ CHAN2G(2382, 48), /* Channel XX */
+ CHAN2G(2387, 49), /* Channel XX */
+ CHAN2G(2392, 50), /* Channel XX */
+ CHAN2G(2397, 51), /* Channel XX */
+ CHAN2G(2402, 52), /* Channel XX */
+ CHAN2G(2407, 53), /* Channel XX */
+
CHAN2G(2412, 0), /* Channel 1 */
CHAN2G(2417, 1), /* Channel 2 */
CHAN2G(2422, 2), /* Channel 3 */
@@ -50,7 +71,31 @@
CHAN2G(2462, 10), /* Channel 11 */
CHAN2G(2467, 11), /* Channel 12 */
CHAN2G(2472, 12), /* Channel 13 */
- CHAN2G(2484, 13), /* Channel 14 */
+
+ CHAN2G(2477, 13), /* Channel XX */
+ CHAN2G(2478, 14), /* Channel XX */
+ CHAN2G(2482, 15), /* Channel XX */
+
+ CHAN2G(2484, 16), /* Channel 14 */
+
+ CHAN2G(2487, 17), /* Channel XX */
+ CHAN2G(2489, 18), /* Channel XX */
+ CHAN2G(2492, 19), /* Channel XX */
+ CHAN2G(2494, 20), /* Channel XX */
+ CHAN2G(2497, 21), /* Channel XX */
+ CHAN2G(2499, 22), /* Channel XX */
+ CHAN2G(2512, 23), /* Channel XX */
+ CHAN2G(2532, 24), /* Channel XX */
+ CHAN2G(2572, 25), /* Channel XX */
+ CHAN2G(2592, 26), /* Channel XX */
+ CHAN2G(2612, 27), /* Channel XX */
+ CHAN2G(2632, 28), /* Channel XX */
+ CHAN2G(2652, 29), /* Channel XX */
+ CHAN2G(2672, 30), /* Channel XX */
+ CHAN2G(2692, 31), /* Channel XX */
+ CHAN2G(2712, 32), /* Channel XX */
+ CHAN2G(2732, 33), /* Channel XX */
+
};
/* Some 5 GHz radios are actually tunable on XXXX-YYYY
@@ -58,34 +103,39 @@
* we have calibration data for all cards though to make
* this static */
static const struct ieee80211_channel ath9k_5ghz_chantable[] = {
+ CHAN5G(4920, 54), /* Channel XX */
+ CHAN5G(4940, 55), /* Channel XX */
+ CHAN5G(4960, 56), /* Channel XX */
+ CHAN5G(4980, 57), /* Channel XX */
+
/* _We_ call this UNII 1 */
- CHAN5G(5180, 14), /* Channel 36 */
- CHAN5G(5200, 15), /* Channel 40 */
- CHAN5G(5220, 16), /* Channel 44 */
- CHAN5G(5240, 17), /* Channel 48 */
+ CHAN5G(5180, 58), /* Channel 36 */
+ CHAN5G(5200, 59), /* Channel 40 */
+ CHAN5G(5220, 60), /* Channel 44 */
+ CHAN5G(5240, 61), /* Channel 48 */
/* _We_ call this UNII 2 */
- CHAN5G(5260, 18), /* Channel 52 */
- CHAN5G(5280, 19), /* Channel 56 */
- CHAN5G(5300, 20), /* Channel 60 */
- CHAN5G(5320, 21), /* Channel 64 */
+ CHAN5G(5260, 62), /* Channel 52 */
+ CHAN5G(5280, 63), /* Channel 56 */
+ CHAN5G(5300, 64), /* Channel 60 */
+ CHAN5G(5320, 65), /* Channel 64 */
/* _We_ call this "Middle band" */
- CHAN5G(5500, 22), /* Channel 100 */
- CHAN5G(5520, 23), /* Channel 104 */
- CHAN5G(5540, 24), /* Channel 108 */
- CHAN5G(5560, 25), /* Channel 112 */
- CHAN5G(5580, 26), /* Channel 116 */
- CHAN5G(5600, 27), /* Channel 120 */
- CHAN5G(5620, 28), /* Channel 124 */
- CHAN5G(5640, 29), /* Channel 128 */
- CHAN5G(5660, 30), /* Channel 132 */
- CHAN5G(5680, 31), /* Channel 136 */
- CHAN5G(5700, 32), /* Channel 140 */
+ CHAN5G(5500, 66), /* Channel 100 */
+ CHAN5G(5520, 67), /* Channel 104 */
+ CHAN5G(5540, 68), /* Channel 108 */
+ CHAN5G(5560, 69), /* Channel 112 */
+ CHAN5G(5580, 70), /* Channel 116 */
+ CHAN5G(5600, 71), /* Channel 120 */
+ CHAN5G(5620, 72), /* Channel 124 */
+ CHAN5G(5640, 73), /* Channel 128 */
+ CHAN5G(5660, 74), /* Channel 132 */
+ CHAN5G(5680, 75), /* Channel 136 */
+ CHAN5G(5700, 76), /* Channel 140 */
/* _We_ call this UNII 3 */
- CHAN5G(5745, 33), /* Channel 149 */
- CHAN5G(5765, 34), /* Channel 153 */
- CHAN5G(5785, 35), /* Channel 157 */
- CHAN5G(5805, 36), /* Channel 161 */
- CHAN5G(5825, 37), /* Channel 165 */
+ CHAN5G(5745, 77), /* Channel 149 */
+ CHAN5G(5765, 78), /* Channel 153 */
+ CHAN5G(5785, 79), /* Channel 157 */
+ CHAN5G(5805, 80), /* Channel 161 */
+ CHAN5G(5825, 81), /* Channel 165 */
};
/* Atheros hardware rate code addition for short premble */
diff -Naur linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/eeprom_4k.c linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/eeprom_4k.c
--- linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/eeprom_4k.c 2017-05-15 17:23:14.000000000 +0200
+++ linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/eeprom_4k.c 2017-07-08 10:26:46.864373518 +0200
@@ -18,6 +18,9 @@
#include "hw.h"
#include "ar9002_phy.h"
+extern u8 tx_power_man;
+extern u8 thresh62_man;
+
static int ath9k_hw_4k_get_eeprom_ver(struct ath_hw *ah)
{
return ((ah->eeprom.map4k.baseEepHeader.version >> 12) & 0xF);
@@ -636,8 +639,12 @@
if (test)
return;
- for (i = 0; i < Ar5416RateSize; i++)
- ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2;
+ for (i = 0; i < Ar5416RateSize; i++) {
+// ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2;
+ ratesArray[i] = tx_power_man;
+ }
+
+ printk("ATH: TX Power set: %d\n",tx_power_man);
ENABLE_REGWRITE_BUFFER(ah);
@@ -1009,10 +1016,8 @@
if (AR_SREV_9271_10(ah))
REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON,
pModal->txEndToRxOn);
- REG_RMW_FIELD(ah, AR_PHY_CCA, AR9280_PHY_CCA_THRESH62,
- pModal->thresh62);
- REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0, AR_PHY_EXT_CCA0_THRESH62,
- pModal->thresh62);
+ REG_RMW_FIELD(ah, AR_PHY_CCA, AR9280_PHY_CCA_THRESH62, thresh62_man);
+ REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0, AR_PHY_EXT_CCA0_THRESH62, thresh62_man);
if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >=
AR5416_EEP_MINOR_VER_2) {
diff -Naur linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/eeprom_9287.c linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/eeprom_9287.c
--- linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/eeprom_9287.c 2017-05-15 17:23:14.000000000 +0200
+++ linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/eeprom_9287.c 2017-07-08 09:12:25.724306578 +0200
@@ -18,6 +18,8 @@
#include "hw.h"
#include "ar9002_phy.h"
+extern u8 tx_power_man;
+
#define SIZE_EEPROM_AR9287 (sizeof(struct ar9287_eeprom) / sizeof(u16))
static int ath9k_hw_ar9287_get_eeprom_ver(struct ath_hw *ah)
@@ -762,8 +764,12 @@
if (test)
return;
- for (i = 0; i < Ar5416RateSize; i++)
- ratesArray[i] -= AR9287_PWR_TABLE_OFFSET_DB * 2;
+ for (i = 0; i < Ar5416RateSize; i++) {
+// ratesArray[i] -= AR9287_PWR_TABLE_OFFSET_DB * 2;
+ ratesArray[i] = tx_power_man;
+ }
+
+ printk("ATH: TX Power set: %d\n",tx_power_man);
ENABLE_REGWRITE_BUFFER(ah);
diff -Naur linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/hif_usb.h linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/hif_usb.h
--- linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/hif_usb.h 2017-05-15 17:23:14.000000000 +0200
+++ linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/hif_usb.h 2017-07-05 22:45:17.405149078 +0200
@@ -61,7 +61,7 @@
#define MAX_PKT_NUM_IN_TRANSFER 10
#define MAX_REG_OUT_URB_NUM 1
-#define MAX_REG_IN_URB_NUM 64
+#define MAX_REG_IN_URB_NUM 8
#define MAX_REG_IN_BUF_SIZE 64
diff -Naur linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/hw.c linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/hw.c
--- linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/hw.c 2017-05-15 17:23:14.000000000 +0200
+++ linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/hw.c 2017-07-08 10:33:39.816379714 +0200
@@ -37,6 +37,40 @@
MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards");
MODULE_LICENSE("Dual BSD/GPL");
+u8 tx_power_man = 58; //manual power
+u8 cwmin_man = 7;
+u8 cwmax_man = 15;
+u8 aifs_man = 2;
+u8 cck_sifs_man = 10;
+u8 ofdm_sifs_man = 16;
+u8 slottime_man = 9;
+u8 thresh62_man = 28;
+
+module_param_named(txpower,tx_power_man,byte,0444);
+MODULE_PARM_DESC(txpower,"Manual TX power setting, default 58, max 63");
+
+module_param_named(cwmin,cwmin_man,byte,0444);
+MODULE_PARM_DESC(cwmin,"CWMIN setting, 0-255, default 7");
+
+module_param_named(cwmax,cwmax_man,byte,0444);
+MODULE_PARM_DESC(cwmax,"CWMAX setting, 0-255, default 15");
+
+module_param_named(aifs,aifs_man,byte,0444);
+MODULE_PARM_DESC(aifs,"AIFS setting, default 2");
+
+module_param_named(cck_sifs,cck_sifs_man,byte,0444);
+MODULE_PARM_DESC(cck_sifs,"CCK SIFS setting, default 10");
+
+module_param_named(ofdm_sifs,ofdm_sifs_man,byte,0444);
+MODULE_PARM_DESC(ofdm_sifs,"OFDM SIFS setting, default 16");
+
+module_param_named(slottime,slottime_man,byte,0444);
+MODULE_PARM_DESC(slottime,"Slottime setting, default 9");
+
+module_param_named(thresh62,thresh62_man,byte,0444);
+MODULE_PARM_DESC(thresh62,"CCA THRESH62 setting, default 28");
+
+
static void ath9k_hw_set_clockrate(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
@@ -1076,7 +1110,8 @@
}
/* As defined by IEEE 802.11-2007 17.3.8.6 */
- slottime += 3 * ah->coverage_class;
+// slottime += 3 * ah->coverage_class;
+ slottime = slottime_man;
acktimeout = slottime + sifstime + ack_offset;
ctstimeout = acktimeout;
diff -Naur linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/hw.h linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/hw.h
--- linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/hw.h 2017-05-15 17:23:14.000000000 +0200
+++ linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/hw.h 2017-07-05 22:50:22.949153662 +0200
@@ -73,7 +73,7 @@
#define ATH9K_RSSI_BAD -128
-#define ATH9K_NUM_CHANNELS 38
+#define ATH9K_NUM_CHANNELS 82
/* Register read/write primitives */
#define REG_WRITE(_ah, _reg, _val) \
diff -Naur linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/mac.c linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/mac.c
--- linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367/drivers/net/wireless/ath/ath9k/mac.c 2017-05-15 17:23:14.000000000 +0200
+++ linux-1423ac8bfbfb2a9d092b604c676e7a58a5fa3367.patched/drivers/net/wireless/ath/ath9k/mac.c 2017-07-08 10:12:18.540360489 +0200
@@ -18,6 +18,14 @@
#include "hw-ops.h"
#include <linux/export.h>
+extern u8 cwmin_man;
+extern u8 cwmax_man;
+extern u8 aifs_man;
+extern u8 cck_sifs;
+extern u8 ofdm_sifs;
+
+
+
static void ath9k_hw_set_txq_interrupts(struct ath_hw *ah,
struct ath9k_tx_queue_info *qi)
{
@@ -216,7 +224,8 @@
if (qinfo->tqi_aifs != ATH9K_TXQ_USEDEFAULT)
qi->tqi_aifs = min(qinfo->tqi_aifs, 255U);
else
- qi->tqi_aifs = INIT_AIFS;
+// qi->tqi_aifs = INIT_AIFS;
+ qi->tqi_aifs = aifs_man;
if (qinfo->tqi_cwmin != ATH9K_TXQ_USEDEFAULT) {
cw = min(qinfo->tqi_cwmin, 1024U);
qi->tqi_cwmin = 1;