@@ -43,8 +43,8 @@ static const u32 ar9003_wlan_weights[ATH_BTCOEX_STOMP_MAX]
43
43
{ 0x00000000 , 0x00000000 , 0x00000000 , 0x00000000 }, /* STOMP_NONE */
44
44
};
45
45
46
- static const u32 ar9462_wlan_weights [ATH_BTCOEX_STOMP_MAX ]
47
- [AR9300_NUM_WLAN_WEIGHTS ] = {
46
+ static const u32 mci_wlan_weights [ATH_BTCOEX_STOMP_MAX ]
47
+ [AR9300_NUM_WLAN_WEIGHTS ] = {
48
48
{ 0x01017d01 , 0x41414101 , 0x41414101 , 0x41414141 }, /* STOMP_ALL */
49
49
{ 0x01017d01 , 0x3b3b3b01 , 0x3b3b3b01 , 0x3b3b3b3b }, /* STOMP_LOW */
50
50
{ 0x01017d01 , 0x01010101 , 0x01010101 , 0x01010101 }, /* STOMP_NONE */
@@ -208,14 +208,37 @@ static void ath9k_hw_btcoex_enable_2wire(struct ath_hw *ah)
208
208
AR_GPIO_OUTPUT_MUX_AS_TX_FRAME );
209
209
}
210
210
211
+ /*
212
+ * For AR9002, bt_weight/wlan_weight are used.
213
+ * For AR9003 and above, stomp_type is used.
214
+ */
211
215
void ath9k_hw_btcoex_set_weight (struct ath_hw * ah ,
212
216
u32 bt_weight ,
213
- u32 wlan_weight )
217
+ u32 wlan_weight ,
218
+ enum ath_stomp_type stomp_type )
214
219
{
215
220
struct ath_btcoex_hw * btcoex_hw = & ah -> btcoex_hw ;
216
221
217
- btcoex_hw -> bt_coex_weights = SM (bt_weight , AR_BTCOEX_BT_WGHT ) |
218
- SM (wlan_weight , AR_BTCOEX_WL_WGHT );
222
+ if (AR_SREV_9300_20_OR_LATER (ah )) {
223
+ const u32 * weight = ar9003_wlan_weights [stomp_type ];
224
+ int i ;
225
+
226
+ if (AR_SREV_9462 (ah ) || AR_SREV_9565 (ah )) {
227
+ if ((stomp_type == ATH_BTCOEX_STOMP_LOW ) &&
228
+ btcoex_hw -> mci .stomp_ftp )
229
+ stomp_type = ATH_BTCOEX_STOMP_LOW_FTP ;
230
+ weight = mci_wlan_weights [stomp_type ];
231
+ }
232
+
233
+ for (i = 0 ; i < AR9300_NUM_WLAN_WEIGHTS ; i ++ ) {
234
+ btcoex_hw -> bt_weight [i ] = AR9300_BT_WGHT ;
235
+ btcoex_hw -> wlan_weight [i ] = weight [i ];
236
+ }
237
+ } else {
238
+ btcoex_hw -> bt_coex_weights =
239
+ SM (bt_weight , AR_BTCOEX_BT_WGHT ) |
240
+ SM (wlan_weight , AR_BTCOEX_WL_WGHT );
241
+ }
219
242
}
220
243
EXPORT_SYMBOL (ath9k_hw_btcoex_set_weight );
221
244
@@ -332,49 +355,29 @@ void ath9k_hw_btcoex_disable(struct ath_hw *ah)
332
355
}
333
356
EXPORT_SYMBOL (ath9k_hw_btcoex_disable );
334
357
335
- static void ar9003_btcoex_bt_stomp (struct ath_hw * ah ,
336
- enum ath_stomp_type stomp_type )
337
- {
338
- struct ath_btcoex_hw * btcoex = & ah -> btcoex_hw ;
339
- const u32 * weight = ar9003_wlan_weights [stomp_type ];
340
- int i ;
341
-
342
- if (AR_SREV_9462 (ah ) || AR_SREV_9565 (ah )) {
343
- if ((stomp_type == ATH_BTCOEX_STOMP_LOW ) &&
344
- btcoex -> mci .stomp_ftp )
345
- stomp_type = ATH_BTCOEX_STOMP_LOW_FTP ;
346
- weight = ar9462_wlan_weights [stomp_type ];
347
- }
348
-
349
- for (i = 0 ; i < AR9300_NUM_WLAN_WEIGHTS ; i ++ ) {
350
- btcoex -> bt_weight [i ] = AR9300_BT_WGHT ;
351
- btcoex -> wlan_weight [i ] = weight [i ];
352
- }
353
- }
354
-
355
358
/*
356
359
* Configures appropriate weight based on stomp type.
357
360
*/
358
361
void ath9k_hw_btcoex_bt_stomp (struct ath_hw * ah ,
359
362
enum ath_stomp_type stomp_type )
360
363
{
361
364
if (AR_SREV_9300_20_OR_LATER (ah )) {
362
- ar9003_btcoex_bt_stomp (ah , stomp_type );
365
+ ath9k_hw_btcoex_set_weight (ah , 0 , 0 , stomp_type );
363
366
return ;
364
367
}
365
368
366
369
switch (stomp_type ) {
367
370
case ATH_BTCOEX_STOMP_ALL :
368
371
ath9k_hw_btcoex_set_weight (ah , AR_BT_COEX_WGHT ,
369
- AR_STOMP_ALL_WLAN_WGHT );
372
+ AR_STOMP_ALL_WLAN_WGHT , 0 );
370
373
break ;
371
374
case ATH_BTCOEX_STOMP_LOW :
372
375
ath9k_hw_btcoex_set_weight (ah , AR_BT_COEX_WGHT ,
373
- AR_STOMP_LOW_WLAN_WGHT );
376
+ AR_STOMP_LOW_WLAN_WGHT , 0 );
374
377
break ;
375
378
case ATH_BTCOEX_STOMP_NONE :
376
379
ath9k_hw_btcoex_set_weight (ah , AR_BT_COEX_WGHT ,
377
- AR_STOMP_NONE_WLAN_WGHT );
380
+ AR_STOMP_NONE_WLAN_WGHT , 0 );
378
381
break ;
379
382
default :
380
383
ath_dbg (ath9k_hw_common (ah ), BTCOEX , "Invalid Stomptype\n" );
0 commit comments