aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_boot.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-02-18 06:25:42 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-19 15:52:43 -0500
commit152ee6e09e2ce54d7d1cc9d338b82c0bf3cbbc95 (patch)
treed6f9ffed8d59cc257f2dfd884337f946a212ea3b /drivers/net/wireless/wl12xx/wl1271_boot.c
parentc6999d831ab9ae5e368b20f3bc11b0ca9c17a7ec (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.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 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)
219 size_t nvs_len, burst_len; 219 size_t nvs_len, burst_len;
220 int i; 220 int i;
221 u32 dest_addr, val; 221 u32 dest_addr, val;
222 u8 *nvs_ptr, *nvs, *nvs_aligned; 222 u8 *nvs_ptr, *nvs_aligned;
223 223
224 nvs = wl->nvs; 224 if (wl->nvs == NULL)
225 if (nvs == NULL)
226 return -ENODEV; 225 return -ENODEV;
227 226
228 if (wl->nvs_len < WL1271_NVS_LEN)
229 return -EINVAL;
230
231 nvs_ptr = nvs;
232
233 /* only the first part of the NVS needs to be uploaded */ 227 /* only the first part of the NVS needs to be uploaded */
234 nvs_len = WL1271_NVS_LEN; 228 nvs_len = sizeof(wl->nvs->nvs);
235 229 nvs_ptr = (u8 *)wl->nvs->nvs;
236 /* FIXME: read init settings from the remaining part of the NVS */
237 230
238 /* Update the device MAC address into the nvs */ 231 /* Update the device MAC address into the nvs */
239 nvs[11] = wl->mac_addr[0]; 232 nvs_ptr[11] = wl->mac_addr[0];
240 nvs[10] = wl->mac_addr[1]; 233 nvs_ptr[10] = wl->mac_addr[1];
241 nvs[6] = wl->mac_addr[2]; 234 nvs_ptr[6] = wl->mac_addr[2];
242 nvs[5] = wl->mac_addr[3]; 235 nvs_ptr[5] = wl->mac_addr[3];
243 nvs[4] = wl->mac_addr[4]; 236 nvs_ptr[4] = wl->mac_addr[4];
244 nvs[3] = wl->mac_addr[5]; 237 nvs_ptr[3] = wl->mac_addr[5];
245 238
246 /* 239 /*
247 * Layout before the actual NVS tables: 240 * Layout before the actual NVS tables:
@@ -283,7 +276,7 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
283 * is 7 bytes further. 276 * is 7 bytes further.
284 */ 277 */
285 nvs_ptr += 7; 278 nvs_ptr += 7;
286 nvs_len -= nvs_ptr - nvs; 279 nvs_len -= nvs_ptr - (u8 *)wl->nvs->nvs;
287 nvs_len = ALIGN(nvs_len, 4); 280 nvs_len = ALIGN(nvs_len, 4);
288 281
289 /* FIXME: The driver sets the partition here, but this is not needed, 282 /* FIXME: The driver sets the partition here, but this is not needed,