diff options
author | Luciano Coelho <coelho@ti.com> | 2011-11-30 12:30:01 +0200 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-04-12 08:43:57 +0300 |
commit | d203e59c4b56d56916a804ebeb04b0e6d92adf4c (patch) | |
tree | ebfbc24683a39b47d40d9262872a125a4cbcdf88 /drivers/net/wireless/ti/wlcore/boot.c | |
parent | f16ff75872b04fa6c779367ae24146c8a1729f2e (diff) | |
download | blackbird-op-linux-d203e59c4b56d56916a804ebeb04b0e6d92adf4c.tar.gz blackbird-op-linux-d203e59c4b56d56916a804ebeb04b0e6d92adf4c.zip |
wlcore/wl12xx: add quirk for legacy NVS support
Instead of checking the chip ID directly in the wlcore code to decide
whether to use the new or the old NVS format, we now use a quirk that
should be set by the low level driver to say that it needs to use the
old format.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/boot.c')
-rw-r--r-- | drivers/net/wireless/ti/wlcore/boot.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/drivers/net/wireless/ti/wlcore/boot.c b/drivers/net/wireless/ti/wlcore/boot.c index 7d49870982df..9520073cab55 100644 --- a/drivers/net/wireless/ti/wlcore/boot.c +++ b/drivers/net/wireless/ti/wlcore/boot.c @@ -215,27 +215,7 @@ int wlcore_boot_upload_nvs(struct wl1271 *wl) if (wl->nvs == NULL) return -ENODEV; - if (wl->chip.id == CHIP_ID_1283_PG20) { - struct wl128x_nvs_file *nvs = (struct wl128x_nvs_file *)wl->nvs; - - if (wl->nvs_len == sizeof(struct wl128x_nvs_file)) { - if (nvs->general_params.dual_mode_select) - wl->enable_11a = true; - } else { - wl1271_error("nvs size is not as expected: %zu != %zu", - wl->nvs_len, - sizeof(struct wl128x_nvs_file)); - kfree(wl->nvs); - wl->nvs = NULL; - wl->nvs_len = 0; - return -EILSEQ; - } - - /* only the first part of the NVS needs to be uploaded */ - nvs_len = sizeof(nvs->nvs); - nvs_ptr = (u8 *)nvs->nvs; - - } else { + if (wl->quirks & WLCORE_QUIRK_LEGACY_NVS) { struct wl1271_nvs_file *nvs = (struct wl1271_nvs_file *)wl->nvs; /* @@ -263,6 +243,25 @@ int wlcore_boot_upload_nvs(struct wl1271 *wl) /* only the first part of the NVS needs to be uploaded */ nvs_len = sizeof(nvs->nvs); nvs_ptr = (u8 *) nvs->nvs; + } else { + struct wl128x_nvs_file *nvs = (struct wl128x_nvs_file *)wl->nvs; + + if (wl->nvs_len == sizeof(struct wl128x_nvs_file)) { + if (nvs->general_params.dual_mode_select) + wl->enable_11a = true; + } else { + wl1271_error("nvs size is not as expected: %zu != %zu", + wl->nvs_len, + sizeof(struct wl128x_nvs_file)); + kfree(wl->nvs); + wl->nvs = NULL; + wl->nvs_len = 0; + return -EILSEQ; + } + + /* only the first part of the NVS needs to be uploaded */ + nvs_len = sizeof(nvs->nvs); + nvs_ptr = (u8 *)nvs->nvs; } /* update current MAC address to NVS */ |