diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2010-02-18 06:25:42 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-19 15:52:43 -0500 |
commit | 152ee6e09e2ce54d7d1cc9d338b82c0bf3cbbc95 (patch) | |
tree | d6f9ffed8d59cc257f2dfd884337f946a212ea3b /drivers/net/wireless/wl12xx/wl1271_main.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_main.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 101 |
1 files changed, 6 insertions, 95 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index 6f7a7d946359..282c2bbfec86 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -229,93 +229,8 @@ static struct conf_drv_settings default_conf = { | |||
229 | .psm_entry_retries = 3 | 229 | .psm_entry_retries = 3 |
230 | }, | 230 | }, |
231 | .init = { | 231 | .init = { |
232 | .genparam = { | ||
233 | .ref_clk = CONF_REF_CLK_38_4_E, | ||
234 | .settling_time = 5, | ||
235 | .clk_valid_on_wakeup = 0, | ||
236 | .dc2dcmode = 0, | ||
237 | .single_dual_band = CONF_SINGLE_BAND, | ||
238 | .tx_bip_fem_autodetect = 1, | ||
239 | .tx_bip_fem_manufacturer = 1, | ||
240 | .settings = 1, | ||
241 | .sr_state = 1, | ||
242 | .srf1 = { 0x07, 0x03, 0x18, 0x10, 0x05, 0xfb, 0xf0, | ||
243 | 0xe8, 0, 0, 0, 0, 0, 0, 0, 0 }, | ||
244 | .srf2 = { 0x07, 0x03, 0x18, 0x10, 0x05, 0xfb, 0xf0, | ||
245 | 0xe8, 0, 0, 0, 0, 0, 0, 0, 0 }, | ||
246 | .srf3 = { 0x07, 0x03, 0x18, 0x10, 0x05, 0xfb, 0xf0, | ||
247 | 0xe8, 0, 0, 0, 0, 0, 0, 0, 0 }, | ||
248 | .sr_debug_table = { 0, 0, 0, 0, 0, 0, 0, 0, | ||
249 | 0, 0, 0, 0, 0, 0, 0, 0 }, | ||
250 | .sr_sen_n_p = 0, | ||
251 | .sr_sen_n_p_gain = 0, | ||
252 | .sr_sen_nrn = 0, | ||
253 | .sr_sen_prn = 0, | ||
254 | }, | ||
255 | .radioparam = { | 232 | .radioparam = { |
256 | .rx_trace_loss = 0x24, | 233 | .fem = 1, |
257 | .tx_trace_loss = 0x0, | ||
258 | .rx_rssi_and_proc_compens = { | ||
259 | 0xec, 0xf6, 0x00, 0x0c, 0x18, 0xf8, | ||
260 | 0xfc, 0x00, 0x80, 0x10, 0xf0, 0xf8, | ||
261 | 0x00, 0x0a, 0x14 }, | ||
262 | .rx_trace_loss_5 = { 0, 0, 0, 0, 0, 0, 0 }, | ||
263 | .tx_trace_loss_5 = { 0, 0, 0, 0, 0, 0, 0 }, | ||
264 | .rx_rssi_and_proc_compens_5 = { | ||
265 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
266 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
267 | 0x00, 0x00, 0x00 }, | ||
268 | .tx_ref_pd_voltage = 0x1a9, | ||
269 | .tx_ref_power = 0x80, | ||
270 | .tx_offset_db = 0x0, | ||
271 | .tx_rate_limits_normal = { | ||
272 | 0x1d, 0x1f, 0x24, 0x28, 0x28, 0x29 }, | ||
273 | .tx_rate_limits_degraded = { | ||
274 | 0x19, 0x1f, 0x22, 0x23, 0x27, 0x28 }, | ||
275 | .tx_rate_limits_extreme = { | ||
276 | 0x19, 0x1c, 0x1e, 0x20, 0x24, 0x25 }, | ||
277 | .tx_channel_limits_11b = { | ||
278 | 0x22, 0x50, 0x50, 0x50, 0x50, 0x50, | ||
279 | 0x50, 0x50, 0x50, 0x50, 0x22, 0x50, | ||
280 | 0x22, 0x50 }, | ||
281 | .tx_channel_limits_ofdm = { | ||
282 | 0x20, 0x50, 0x50, 0x50, 0x50, 0x50, | ||
283 | 0x50, 0x50, 0x50, 0x50, 0x20, 0x50, | ||
284 | 0x20, 0x50 }, | ||
285 | .tx_pdv_rate_offsets = { | ||
286 | 0x07, 0x08, 0x04, 0x02, 0x02, 0x00 }, | ||
287 | .tx_ibias = { | ||
288 | 0x11, 0x11, 0x15, 0x11, 0x15, 0x0f }, | ||
289 | .rx_fem_insertion_loss = 0x0e, | ||
290 | .degraded_low_to_normal_threshold = 0x1e, | ||
291 | .degraded_normal_to_high_threshold = 0x2d, | ||
292 | .tx_ref_pd_voltage_5 = { | ||
293 | 0x0190, 0x01a4, 0x01c3, 0x01d8, | ||
294 | 0x020a, 0x021c }, | ||
295 | .tx_ref_power_5 = { | ||
296 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, | ||
297 | .tx_offset_db_5 = { | ||
298 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
299 | .tx_rate_limits_normal_5 = { | ||
300 | 0x1b, 0x1e, 0x21, 0x23, 0x27, 0x00 }, | ||
301 | .tx_rate_limits_degraded_5 = { | ||
302 | 0x1b, 0x1e, 0x21, 0x23, 0x27, 0x00 }, | ||
303 | .tx_rate_limits_extreme_5 = { | ||
304 | 0x1b, 0x1e, 0x21, 0x23, 0x27, 0x00 }, | ||
305 | .tx_channel_limits_ofdm_5 = { | ||
306 | 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, | ||
307 | 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, | ||
308 | 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, | ||
309 | 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, | ||
310 | 0x50, 0x50, 0x50 }, | ||
311 | .tx_pdv_rate_offsets_5 = { | ||
312 | 0x01, 0x02, 0x02, 0x02, 0x02, 0x00 }, | ||
313 | .tx_ibias_5 = { | ||
314 | 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, | ||
315 | .rx_fem_insertion_loss_5 = { | ||
316 | 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, | ||
317 | .degraded_low_to_normal_threshold_5 = 0x00, | ||
318 | .degraded_normal_to_high_threshold_5 = 0x00 | ||
319 | } | 234 | } |
320 | }, | 235 | }, |
321 | .itrim = { | 236 | .itrim = { |
@@ -345,9 +260,6 @@ static void wl1271_conf_init(struct wl1271 *wl) | |||
345 | 260 | ||
346 | /* apply driver default configuration */ | 261 | /* apply driver default configuration */ |
347 | memcpy(&wl->conf, &default_conf, sizeof(default_conf)); | 262 | memcpy(&wl->conf, &default_conf, sizeof(default_conf)); |
348 | |||
349 | if (wl1271_11a_enabled()) | ||
350 | wl->conf.init.genparam.single_dual_band = CONF_DUAL_BAND; | ||
351 | } | 263 | } |
352 | 264 | ||
353 | 265 | ||
@@ -567,15 +479,14 @@ static int wl1271_fetch_nvs(struct wl1271 *wl) | |||
567 | return ret; | 479 | return ret; |
568 | } | 480 | } |
569 | 481 | ||
570 | if (fw->size % 4) { | 482 | if (fw->size != sizeof(struct wl1271_nvs_file)) { |
571 | wl1271_error("nvs size is not multiple of 32 bits: %zu", | 483 | wl1271_error("nvs size is not as expected: %zu != %zu", |
572 | fw->size); | 484 | fw->size, sizeof(struct wl1271_nvs_file)); |
573 | ret = -EILSEQ; | 485 | ret = -EILSEQ; |
574 | goto out; | 486 | goto out; |
575 | } | 487 | } |
576 | 488 | ||
577 | wl->nvs_len = fw->size; | 489 | wl->nvs = kmalloc(sizeof(struct wl1271_nvs_file), GFP_KERNEL); |
578 | wl->nvs = kmalloc(wl->nvs_len, GFP_KERNEL); | ||
579 | 490 | ||
580 | if (!wl->nvs) { | 491 | if (!wl->nvs) { |
581 | wl1271_error("could not allocate memory for the nvs file"); | 492 | wl1271_error("could not allocate memory for the nvs file"); |
@@ -583,7 +494,7 @@ static int wl1271_fetch_nvs(struct wl1271 *wl) | |||
583 | goto out; | 494 | goto out; |
584 | } | 495 | } |
585 | 496 | ||
586 | memcpy(wl->nvs, fw->data, wl->nvs_len); | 497 | memcpy(wl->nvs, fw->data, sizeof(struct wl1271_nvs_file)); |
587 | 498 | ||
588 | ret = 0; | 499 | ret = 0; |
589 | 500 | ||