summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/wl1271_boot.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-02-18 14:25:42 +0300
committerJohn W. Linville <linville@tuxdriver.com>2010-02-19 23:52:43 +0300
commit152ee6e09e2ce54d7d1cc9d338b82c0bf3cbbc95 (patch)
treed6f9ffed8d59cc257f2dfd884337f946a212ea3b /drivers/net/wireless/wl12xx/wl1271_boot.c
parentc6999d831ab9ae5e368b20f3bc11b0ca9c17a7ec (diff)
downloadlinux-152ee6e09e2ce54d7d1cc9d338b82c0bf3cbbc95.tar.xz
wl1271: Use NVS INI file configuration
Replace the hardcoded general and radio parameter configuration in the driver with configuration taken from the NVS file directly. Also remove the driver dependency to the structures with the parameter data. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_boot.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_boot.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.c b/drivers/net/wireless/wl12xx/wl1271_boot.c
index e803b876f3f0..bc3fe0275cac 100644
--- a/drivers/net/wireless/wl12xx/wl1271_boot.c
+++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
@@ -219,29 +219,22 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
size_t nvs_len, burst_len;
int i;
u32 dest_addr, val;
- u8 *nvs_ptr, *nvs, *nvs_aligned;
+ u8 *nvs_ptr, *nvs_aligned;
- nvs = wl->nvs;
- if (nvs == NULL)
+ if (wl->nvs == NULL)
return -ENODEV;
- if (wl->nvs_len < WL1271_NVS_LEN)
- return -EINVAL;
-
- nvs_ptr = nvs;
-
/* only the first part of the NVS needs to be uploaded */
- nvs_len = WL1271_NVS_LEN;
-
- /* FIXME: read init settings from the remaining part of the NVS */
+ nvs_len = sizeof(wl->nvs->nvs);
+ nvs_ptr = (u8 *)wl->nvs->nvs;
/* Update the device MAC address into the nvs */
- nvs[11] = wl->mac_addr[0];
- nvs[10] = wl->mac_addr[1];
- nvs[6] = wl->mac_addr[2];
- nvs[5] = wl->mac_addr[3];
- nvs[4] = wl->mac_addr[4];
- nvs[3] = wl->mac_addr[5];
+ nvs_ptr[11] = wl->mac_addr[0];
+ nvs_ptr[10] = wl->mac_addr[1];
+ nvs_ptr[6] = wl->mac_addr[2];
+ nvs_ptr[5] = wl->mac_addr[3];
+ nvs_ptr[4] = wl->mac_addr[4];
+ nvs_ptr[3] = wl->mac_addr[5];
/*
* Layout before the actual NVS tables:
@@ -283,7 +276,7 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
* is 7 bytes further.
*/
nvs_ptr += 7;
- nvs_len -= nvs_ptr - nvs;
+ nvs_len -= nvs_ptr - (u8 *)wl->nvs->nvs;
nvs_len = ALIGN(nvs_len, 4);
/* FIXME: The driver sets the partition here, but this is not needed,