aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_main.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-05-14 03:46:23 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-02 16:13:05 -0400
commita7da74fc88bff6f82f8255f2def49907f82f4c61 (patch)
tree6868dab7321f71feada845795a4a19434fb32ada /drivers/net/wireless/wl12xx/wl1271_main.c
parenteb70eb723b489dd4e233e22e47d993f59858cdd8 (diff)
wl1271: Add support for NVS files with 5GHz band parameters
This patch adds support for NVS files with 5GHz band parameters. The change is done in a backward compatible manner - if 11a is not enabled in the driver, the driver will allow also old NVS files to be loaded. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_main.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index b7d9137851ac..5568f559a16b 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -566,14 +566,21 @@ static int wl1271_fetch_nvs(struct wl1271 *wl)
566 return ret; 566 return ret;
567 } 567 }
568 568
569 if (fw->size != sizeof(struct wl1271_nvs_file)) { 569 /*
570 * FIXME: the LEGACY NVS image support (NVS's missing the 5GHz band
571 * configurations) can be removed when those NVS files stop floating
572 * around.
573 */
574 if (fw->size != sizeof(struct wl1271_nvs_file) &&
575 (fw->size != WL1271_INI_LEGACY_NVS_FILE_SIZE ||
576 wl1271_11a_enabled())) {
570 wl1271_error("nvs size is not as expected: %zu != %zu", 577 wl1271_error("nvs size is not as expected: %zu != %zu",
571 fw->size, sizeof(struct wl1271_nvs_file)); 578 fw->size, sizeof(struct wl1271_nvs_file));
572 ret = -EILSEQ; 579 ret = -EILSEQ;
573 goto out; 580 goto out;
574 } 581 }
575 582
576 wl->nvs = kmalloc(sizeof(struct wl1271_nvs_file), GFP_KERNEL); 583 wl->nvs = kzalloc(sizeof(struct wl1271_nvs_file), GFP_KERNEL);
577 584
578 if (!wl->nvs) { 585 if (!wl->nvs) {
579 wl1271_error("could not allocate memory for the nvs file"); 586 wl1271_error("could not allocate memory for the nvs file");
@@ -581,7 +588,7 @@ static int wl1271_fetch_nvs(struct wl1271 *wl)
581 goto out; 588 goto out;
582 } 589 }
583 590
584 memcpy(wl->nvs, fw->data, sizeof(struct wl1271_nvs_file)); 591 memcpy(wl->nvs, fw->data, fw->size);
585 592
586out: 593out:
587 release_firmware(fw); 594 release_firmware(fw);