diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2010-02-18 13:25:42 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-19 15:52:43 -0500 |
commit | 152ee6e09e2ce54d7d1cc9d338b82c0bf3cbbc95 (patch) | |
tree | d6f9ffed8d59cc257f2dfd884337f946a212ea3b /drivers/net/wireless/wl12xx/wl1271_boot.c | |
parent | c6999d831ab9ae5e368b20f3bc11b0ca9c17a7ec (diff) |
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.c | 29 |
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 e803b876f3f..bc3fe0275ca 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, |