diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/boot.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/boot.c | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/drivers/net/wireless/wl12xx/boot.c b/drivers/net/wireless/wl12xx/boot.c index 5ebc64d89407..681337914976 100644 --- a/drivers/net/wireless/wl12xx/boot.c +++ b/drivers/net/wireless/wl12xx/boot.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/wl12xx.h> | 25 | #include <linux/wl12xx.h> |
26 | #include <linux/export.h> | ||
26 | 27 | ||
27 | #include "acx.h" | 28 | #include "acx.h" |
28 | #include "reg.h" | 29 | #include "reg.h" |
@@ -107,16 +108,6 @@ static unsigned int wl12xx_get_fw_ver_quirks(struct wl1271 *wl) | |||
107 | unsigned int quirks = 0; | 108 | unsigned int quirks = 0; |
108 | unsigned int *fw_ver = wl->chip.fw_ver; | 109 | unsigned int *fw_ver = wl->chip.fw_ver; |
109 | 110 | ||
110 | /* Only for wl127x */ | ||
111 | if ((fw_ver[FW_VER_CHIP] == FW_VER_CHIP_WL127X) && | ||
112 | /* Check STA version */ | ||
113 | (((fw_ver[FW_VER_IF_TYPE] == FW_VER_IF_TYPE_STA) && | ||
114 | (fw_ver[FW_VER_MINOR] < FW_VER_MINOR_1_SPARE_STA_MIN)) || | ||
115 | /* Check AP version */ | ||
116 | ((fw_ver[FW_VER_IF_TYPE] == FW_VER_IF_TYPE_AP) && | ||
117 | (fw_ver[FW_VER_MINOR] < FW_VER_MINOR_1_SPARE_AP_MIN)))) | ||
118 | quirks |= WL12XX_QUIRK_USE_2_SPARE_BLOCKS; | ||
119 | |||
120 | /* Only new station firmwares support routing fw logs to the host */ | 111 | /* Only new station firmwares support routing fw logs to the host */ |
121 | if ((fw_ver[FW_VER_IF_TYPE] == FW_VER_IF_TYPE_STA) && | 112 | if ((fw_ver[FW_VER_IF_TYPE] == FW_VER_IF_TYPE_STA) && |
122 | (fw_ver[FW_VER_MINOR] < FW_VER_MINOR_FWLOG_STA_MIN)) | 113 | (fw_ver[FW_VER_MINOR] < FW_VER_MINOR_FWLOG_STA_MIN)) |
@@ -304,9 +295,7 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl) | |||
304 | */ | 295 | */ |
305 | if (wl->nvs_len == sizeof(struct wl1271_nvs_file) || | 296 | if (wl->nvs_len == sizeof(struct wl1271_nvs_file) || |
306 | wl->nvs_len == WL1271_INI_LEGACY_NVS_FILE_SIZE) { | 297 | wl->nvs_len == WL1271_INI_LEGACY_NVS_FILE_SIZE) { |
307 | /* for now 11a is unsupported in AP mode */ | 298 | if (nvs->general_params.dual_mode_select) |
308 | if (wl->bss_type != BSS_TYPE_AP_BSS && | ||
309 | nvs->general_params.dual_mode_select) | ||
310 | wl->enable_11a = true; | 299 | wl->enable_11a = true; |
311 | } | 300 | } |
312 | 301 | ||
@@ -504,21 +493,19 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl) | |||
504 | wl->event_mask = BSS_LOSE_EVENT_ID | | 493 | wl->event_mask = BSS_LOSE_EVENT_ID | |
505 | SCAN_COMPLETE_EVENT_ID | | 494 | SCAN_COMPLETE_EVENT_ID | |
506 | PS_REPORT_EVENT_ID | | 495 | PS_REPORT_EVENT_ID | |
507 | JOIN_EVENT_COMPLETE_ID | | ||
508 | DISCONNECT_EVENT_COMPLETE_ID | | 496 | DISCONNECT_EVENT_COMPLETE_ID | |
509 | RSSI_SNR_TRIGGER_0_EVENT_ID | | 497 | RSSI_SNR_TRIGGER_0_EVENT_ID | |
510 | PSPOLL_DELIVERY_FAILURE_EVENT_ID | | 498 | PSPOLL_DELIVERY_FAILURE_EVENT_ID | |
511 | SOFT_GEMINI_SENSE_EVENT_ID | | 499 | SOFT_GEMINI_SENSE_EVENT_ID | |
512 | PERIODIC_SCAN_REPORT_EVENT_ID | | 500 | PERIODIC_SCAN_REPORT_EVENT_ID | |
513 | PERIODIC_SCAN_COMPLETE_EVENT_ID; | 501 | PERIODIC_SCAN_COMPLETE_EVENT_ID | |
514 | 502 | DUMMY_PACKET_EVENT_ID | | |
515 | if (wl->bss_type == BSS_TYPE_AP_BSS) | 503 | PEER_REMOVE_COMPLETE_EVENT_ID | |
516 | wl->event_mask |= STA_REMOVE_COMPLETE_EVENT_ID | | 504 | BA_SESSION_RX_CONSTRAINT_EVENT_ID | |
517 | INACTIVE_STA_EVENT_ID | | 505 | REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID | |
518 | MAX_TX_RETRY_EVENT_ID; | 506 | INACTIVE_STA_EVENT_ID | |
519 | else | 507 | MAX_TX_RETRY_EVENT_ID | |
520 | wl->event_mask |= DUMMY_PACKET_EVENT_ID | | 508 | CHANNEL_SWITCH_COMPLETE_EVENT_ID; |
521 | BA_SESSION_RX_CONSTRAINT_EVENT_ID; | ||
522 | 509 | ||
523 | ret = wl1271_event_unmask(wl); | 510 | ret = wl1271_event_unmask(wl); |
524 | if (ret < 0) { | 511 | if (ret < 0) { |
@@ -549,13 +536,13 @@ static void wl1271_boot_hw_version(struct wl1271 *wl) | |||
549 | { | 536 | { |
550 | u32 fuse; | 537 | u32 fuse; |
551 | 538 | ||
552 | fuse = wl1271_top_reg_read(wl, REG_FUSE_DATA_2_1); | 539 | if (wl->chip.id == CHIP_ID_1283_PG20) |
540 | fuse = wl1271_top_reg_read(wl, WL128X_REG_FUSE_DATA_2_1); | ||
541 | else | ||
542 | fuse = wl1271_top_reg_read(wl, WL127X_REG_FUSE_DATA_2_1); | ||
553 | fuse = (fuse & PG_VER_MASK) >> PG_VER_OFFSET; | 543 | fuse = (fuse & PG_VER_MASK) >> PG_VER_OFFSET; |
554 | 544 | ||
555 | wl->hw_pg_ver = (s8)fuse; | 545 | wl->hw_pg_ver = (s8)fuse; |
556 | |||
557 | if (((wl->hw_pg_ver & PG_MAJOR_VER_MASK) >> PG_MAJOR_VER_OFFSET) < 3) | ||
558 | wl->quirks |= WL12XX_QUIRK_END_OF_TRANSACTION; | ||
559 | } | 546 | } |
560 | 547 | ||
561 | static int wl128x_switch_tcxo_to_fref(struct wl1271 *wl) | 548 | static int wl128x_switch_tcxo_to_fref(struct wl1271 *wl) |
@@ -696,7 +683,8 @@ static int wl127x_boot_clk(struct wl1271 *wl) | |||
696 | u32 pause; | 683 | u32 pause; |
697 | u32 clk; | 684 | u32 clk; |
698 | 685 | ||
699 | wl1271_boot_hw_version(wl); | 686 | if (((wl->hw_pg_ver & PG_MAJOR_VER_MASK) >> PG_MAJOR_VER_OFFSET) < 3) |
687 | wl->quirks |= WL12XX_QUIRK_END_OF_TRANSACTION; | ||
700 | 688 | ||
701 | if (wl->ref_clock == CONF_REF_CLK_19_2_E || | 689 | if (wl->ref_clock == CONF_REF_CLK_19_2_E || |
702 | wl->ref_clock == CONF_REF_CLK_38_4_E || | 690 | wl->ref_clock == CONF_REF_CLK_38_4_E || |
@@ -750,6 +738,8 @@ int wl1271_load_firmware(struct wl1271 *wl) | |||
750 | u32 tmp, clk; | 738 | u32 tmp, clk; |
751 | int selected_clock = -1; | 739 | int selected_clock = -1; |
752 | 740 | ||
741 | wl1271_boot_hw_version(wl); | ||
742 | |||
753 | if (wl->chip.id == CHIP_ID_1283_PG20) { | 743 | if (wl->chip.id == CHIP_ID_1283_PG20) { |
754 | ret = wl128x_boot_clk(wl, &selected_clock); | 744 | ret = wl128x_boot_clk(wl, &selected_clock); |
755 | if (ret < 0) | 745 | if (ret < 0) |
@@ -781,9 +771,6 @@ int wl1271_load_firmware(struct wl1271 *wl) | |||
781 | clk |= (wl->ref_clock << 1) << 4; | 771 | clk |= (wl->ref_clock << 1) << 4; |
782 | } | 772 | } |
783 | 773 | ||
784 | if (wl->quirks & WL12XX_QUIRK_LPD_MODE) | ||
785 | clk |= SCRATCH_ENABLE_LPD; | ||
786 | |||
787 | wl1271_write32(wl, DRPW_SCRATCH_START, clk); | 774 | wl1271_write32(wl, DRPW_SCRATCH_START, clk); |
788 | 775 | ||
789 | wl1271_set_partition(wl, &part_table[PART_WORK]); | 776 | wl1271_set_partition(wl, &part_table[PART_WORK]); |
@@ -852,9 +839,6 @@ int wl1271_boot(struct wl1271 *wl) | |||
852 | /* Enable firmware interrupts now */ | 839 | /* Enable firmware interrupts now */ |
853 | wl1271_boot_enable_interrupts(wl); | 840 | wl1271_boot_enable_interrupts(wl); |
854 | 841 | ||
855 | /* set the wl1271 default filters */ | ||
856 | wl1271_set_default_filters(wl); | ||
857 | |||
858 | wl1271_event_mbox_config(wl); | 842 | wl1271_event_mbox_config(wl); |
859 | 843 | ||
860 | out: | 844 | out: |