aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/init.c')
-rw-r--r--drivers/net/wireless/wl12xx/init.c51
1 files changed, 45 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index 6072fe457135..ab3b1e21de29 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -31,6 +31,7 @@
31#include "cmd.h" 31#include "cmd.h"
32#include "reg.h" 32#include "reg.h"
33#include "tx.h" 33#include "tx.h"
34#include "io.h"
34 35
35int wl1271_sta_init_templates_config(struct wl1271 *wl) 36int wl1271_sta_init_templates_config(struct wl1271 *wl)
36{ 37{
@@ -321,9 +322,11 @@ static int wl1271_sta_hw_init(struct wl1271 *wl)
321{ 322{
322 int ret; 323 int ret;
323 324
324 ret = wl1271_cmd_ext_radio_parms(wl); 325 if (wl->chip.id != CHIP_ID_1283_PG20) {
325 if (ret < 0) 326 ret = wl1271_cmd_ext_radio_parms(wl);
326 return ret; 327 if (ret < 0)
328 return ret;
329 }
327 330
328 /* PS config */ 331 /* PS config */
329 ret = wl1271_acx_config_ps(wl); 332 ret = wl1271_acx_config_ps(wl);
@@ -372,6 +375,10 @@ static int wl1271_sta_hw_init(struct wl1271 *wl)
372 if (ret < 0) 375 if (ret < 0)
373 return ret; 376 return ret;
374 377
378 ret = wl1271_acx_sta_max_tx_retry(wl);
379 if (ret < 0)
380 return ret;
381
375 ret = wl1271_acx_sta_mem_cfg(wl); 382 ret = wl1271_acx_sta_mem_cfg(wl);
376 if (ret < 0) 383 if (ret < 0)
377 return ret; 384 return ret;
@@ -438,7 +445,7 @@ static int wl1271_ap_hw_init(struct wl1271 *wl)
438 if (ret < 0) 445 if (ret < 0)
439 return ret; 446 return ret;
440 447
441 ret = wl1271_acx_max_tx_retry(wl); 448 ret = wl1271_acx_ap_max_tx_retry(wl);
442 if (ret < 0) 449 if (ret < 0)
443 return ret; 450 return ret;
444 451
@@ -504,6 +511,27 @@ static int wl1271_set_ba_policies(struct wl1271 *wl)
504 return ret; 511 return ret;
505} 512}
506 513
514int wl1271_chip_specific_init(struct wl1271 *wl)
515{
516 int ret = 0;
517
518 if (wl->chip.id == CHIP_ID_1283_PG20) {
519 u32 host_cfg_bitmap = HOST_IF_CFG_RX_FIFO_ENABLE;
520
521 if (wl->quirks & WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT)
522 /* Enable SDIO padding */
523 host_cfg_bitmap |= HOST_IF_CFG_TX_PAD_TO_SDIO_BLK;
524
525 /* Must be before wl1271_acx_init_mem_config() */
526 ret = wl1271_acx_host_if_cfg_bitmap(wl, host_cfg_bitmap);
527 if (ret < 0)
528 goto out;
529 }
530out:
531 return ret;
532}
533
534
507int wl1271_hw_init(struct wl1271 *wl) 535int wl1271_hw_init(struct wl1271 *wl)
508{ 536{
509 struct conf_tx_ac_category *conf_ac; 537 struct conf_tx_ac_category *conf_ac;
@@ -511,11 +539,22 @@ int wl1271_hw_init(struct wl1271 *wl)
511 int ret, i; 539 int ret, i;
512 bool is_ap = (wl->bss_type == BSS_TYPE_AP_BSS); 540 bool is_ap = (wl->bss_type == BSS_TYPE_AP_BSS);
513 541
514 ret = wl1271_cmd_general_parms(wl); 542 if (wl->chip.id == CHIP_ID_1283_PG20)
543 ret = wl128x_cmd_general_parms(wl);
544 else
545 ret = wl1271_cmd_general_parms(wl);
546 if (ret < 0)
547 return ret;
548
549 if (wl->chip.id == CHIP_ID_1283_PG20)
550 ret = wl128x_cmd_radio_parms(wl);
551 else
552 ret = wl1271_cmd_radio_parms(wl);
515 if (ret < 0) 553 if (ret < 0)
516 return ret; 554 return ret;
517 555
518 ret = wl1271_cmd_radio_parms(wl); 556 /* Chip-specific init */
557 ret = wl1271_chip_specific_init(wl);
519 if (ret < 0) 558 if (ret < 0)
520 return ret; 559 return ret;
521 560