aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/boot.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/boot.c')
-rw-r--r--drivers/net/wireless/wl12xx/boot.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/boot.c b/drivers/net/wireless/wl12xx/boot.c
index 4df04f84d7f..1ffbad67d2d 100644
--- a/drivers/net/wireless/wl12xx/boot.c
+++ b/drivers/net/wireless/wl12xx/boot.c
@@ -28,6 +28,7 @@
28#include "boot.h" 28#include "boot.h"
29#include "io.h" 29#include "io.h"
30#include "event.h" 30#include "event.h"
31#include "rx.h"
31 32
32static struct wl1271_partition_set part_table[PART_TABLE_LEN] = { 33static struct wl1271_partition_set part_table[PART_TABLE_LEN] = {
33 [PART_DOWN] = { 34 [PART_DOWN] = {
@@ -100,6 +101,22 @@ static void wl1271_boot_set_ecpu_ctrl(struct wl1271 *wl, u32 flag)
100 wl1271_write32(wl, ACX_REG_ECPU_CONTROL, cpu_ctrl); 101 wl1271_write32(wl, ACX_REG_ECPU_CONTROL, cpu_ctrl);
101} 102}
102 103
104static void wl1271_parse_fw_ver(struct wl1271 *wl)
105{
106 int ret;
107
108 ret = sscanf(wl->chip.fw_ver_str + 4, "%u.%u.%u.%u.%u",
109 &wl->chip.fw_ver[0], &wl->chip.fw_ver[1],
110 &wl->chip.fw_ver[2], &wl->chip.fw_ver[3],
111 &wl->chip.fw_ver[4]);
112
113 if (ret != 5) {
114 wl1271_warning("fw version incorrect value");
115 memset(wl->chip.fw_ver, 0, sizeof(wl->chip.fw_ver));
116 return;
117 }
118}
119
103static void wl1271_boot_fw_version(struct wl1271 *wl) 120static void wl1271_boot_fw_version(struct wl1271 *wl)
104{ 121{
105 struct wl1271_static_data static_data; 122 struct wl1271_static_data static_data;
@@ -107,11 +124,13 @@ static void wl1271_boot_fw_version(struct wl1271 *wl)
107 wl1271_read(wl, wl->cmd_box_addr, &static_data, sizeof(static_data), 124 wl1271_read(wl, wl->cmd_box_addr, &static_data, sizeof(static_data),
108 false); 125 false);
109 126
110 strncpy(wl->chip.fw_ver, static_data.fw_version, 127 strncpy(wl->chip.fw_ver_str, static_data.fw_version,
111 sizeof(wl->chip.fw_ver)); 128 sizeof(wl->chip.fw_ver_str));
112 129
113 /* make sure the string is NULL-terminated */ 130 /* make sure the string is NULL-terminated */
114 wl->chip.fw_ver[sizeof(wl->chip.fw_ver) - 1] = '\0'; 131 wl->chip.fw_ver_str[sizeof(wl->chip.fw_ver_str) - 1] = '\0';
132
133 wl1271_parse_fw_ver(wl);
115} 134}
116 135
117static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf, 136static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
@@ -231,7 +250,9 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
231 */ 250 */
232 if (wl->nvs_len == sizeof(struct wl1271_nvs_file) || 251 if (wl->nvs_len == sizeof(struct wl1271_nvs_file) ||
233 wl->nvs_len == WL1271_INI_LEGACY_NVS_FILE_SIZE) { 252 wl->nvs_len == WL1271_INI_LEGACY_NVS_FILE_SIZE) {
234 if (wl->nvs->general_params.dual_mode_select) 253 /* for now 11a is unsupported in AP mode */
254 if (wl->bss_type != BSS_TYPE_AP_BSS &&
255 wl->nvs->general_params.dual_mode_select)
235 wl->enable_11a = true; 256 wl->enable_11a = true;
236 } 257 }
237 258
@@ -431,6 +452,9 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl)
431 PSPOLL_DELIVERY_FAILURE_EVENT_ID | 452 PSPOLL_DELIVERY_FAILURE_EVENT_ID |
432 SOFT_GEMINI_SENSE_EVENT_ID; 453 SOFT_GEMINI_SENSE_EVENT_ID;
433 454
455 if (wl->bss_type == BSS_TYPE_AP_BSS)
456 wl->event_mask |= STA_REMOVE_COMPLETE_EVENT_ID;
457
434 ret = wl1271_event_unmask(wl); 458 ret = wl1271_event_unmask(wl);
435 if (ret < 0) { 459 if (ret < 0) {
436 wl1271_error("EVENT mask setting failed"); 460 wl1271_error("EVENT mask setting failed");
@@ -595,8 +619,7 @@ int wl1271_boot(struct wl1271 *wl)
595 wl1271_boot_enable_interrupts(wl); 619 wl1271_boot_enable_interrupts(wl);
596 620
597 /* set the wl1271 default filters */ 621 /* set the wl1271 default filters */
598 wl->rx_config = WL1271_DEFAULT_RX_CONFIG; 622 wl1271_set_default_filters(wl);
599 wl->rx_filter = WL1271_DEFAULT_RX_FILTER;
600 623
601 wl1271_event_mbox_config(wl); 624 wl1271_event_mbox_config(wl);
602 625