diff options
author | Luciano Coelho <luciano.coelho@nokia.com> | 2010-02-18 06:25:44 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-19 15:52:44 -0500 |
commit | 12419cce88fa591a846a542d35cff43b69d9e271 (patch) | |
tree | 4742d959d7015bda6bd0e98bb60020badda7df17 /drivers/net/wireless/wl12xx/wl1271_main.c | |
parent | 7b21b6f8216494ab6b8b4dc9d15e48051a0f0a66 (diff) |
wl1271: add most of the normal initialization commands to PLT mode
We need to configure PLT mode almost in the same way as normal mode. Most of
the configuration functions need to be called also when entering PLT, with
the exception of a few RX and TX configuration (which cause mac80211 warnings
if enable while runnning PLT tests).
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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 | 85 |
1 files changed, 78 insertions, 7 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index b5d53a3fcc5d..e698dec40511 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -265,7 +265,9 @@ static void wl1271_conf_init(struct wl1271 *wl) | |||
265 | 265 | ||
266 | static int wl1271_plt_init(struct wl1271 *wl) | 266 | static int wl1271_plt_init(struct wl1271 *wl) |
267 | { | 267 | { |
268 | int ret; | 268 | struct conf_tx_ac_category *conf_ac; |
269 | struct conf_tx_tid *conf_tid; | ||
270 | int ret, i; | ||
269 | 271 | ||
270 | ret = wl1271_cmd_general_parms(wl); | 272 | ret = wl1271_cmd_general_parms(wl); |
271 | if (ret < 0) | 273 | if (ret < 0) |
@@ -275,15 +277,89 @@ static int wl1271_plt_init(struct wl1271 *wl) | |||
275 | if (ret < 0) | 277 | if (ret < 0) |
276 | return ret; | 278 | return ret; |
277 | 279 | ||
280 | ret = wl1271_init_templates_config(wl); | ||
281 | if (ret < 0) | ||
282 | return ret; | ||
283 | |||
278 | ret = wl1271_acx_init_mem_config(wl); | 284 | ret = wl1271_acx_init_mem_config(wl); |
279 | if (ret < 0) | 285 | if (ret < 0) |
280 | return ret; | 286 | return ret; |
281 | 287 | ||
288 | /* PHY layer config */ | ||
289 | ret = wl1271_init_phy_config(wl); | ||
290 | if (ret < 0) | ||
291 | goto out_free_memmap; | ||
292 | |||
293 | ret = wl1271_acx_dco_itrim_params(wl); | ||
294 | if (ret < 0) | ||
295 | goto out_free_memmap; | ||
296 | |||
297 | /* Initialize connection monitoring thresholds */ | ||
298 | ret = wl1271_acx_conn_monit_params(wl); | ||
299 | if (ret < 0) | ||
300 | goto out_free_memmap; | ||
301 | |||
302 | /* Bluetooth WLAN coexistence */ | ||
303 | ret = wl1271_init_pta(wl); | ||
304 | if (ret < 0) | ||
305 | goto out_free_memmap; | ||
306 | |||
307 | /* Energy detection */ | ||
308 | ret = wl1271_init_energy_detection(wl); | ||
309 | if (ret < 0) | ||
310 | goto out_free_memmap; | ||
311 | |||
312 | /* Default fragmentation threshold */ | ||
313 | ret = wl1271_acx_frag_threshold(wl); | ||
314 | if (ret < 0) | ||
315 | goto out_free_memmap; | ||
316 | |||
317 | /* Default TID configuration */ | ||
318 | for (i = 0; i < wl->conf.tx.tid_conf_count; i++) { | ||
319 | conf_tid = &wl->conf.tx.tid_conf[i]; | ||
320 | ret = wl1271_acx_tid_cfg(wl, conf_tid->queue_id, | ||
321 | conf_tid->channel_type, | ||
322 | conf_tid->tsid, | ||
323 | conf_tid->ps_scheme, | ||
324 | conf_tid->ack_policy, | ||
325 | conf_tid->apsd_conf[0], | ||
326 | conf_tid->apsd_conf[1]); | ||
327 | if (ret < 0) | ||
328 | goto out_free_memmap; | ||
329 | } | ||
330 | |||
331 | /* Default AC configuration */ | ||
332 | for (i = 0; i < wl->conf.tx.ac_conf_count; i++) { | ||
333 | conf_ac = &wl->conf.tx.ac_conf[i]; | ||
334 | ret = wl1271_acx_ac_cfg(wl, conf_ac->ac, conf_ac->cw_min, | ||
335 | conf_ac->cw_max, conf_ac->aifsn, | ||
336 | conf_ac->tx_op_limit); | ||
337 | if (ret < 0) | ||
338 | goto out_free_memmap; | ||
339 | } | ||
340 | |||
341 | /* Enable data path */ | ||
282 | ret = wl1271_cmd_data_path(wl, 1); | 342 | ret = wl1271_cmd_data_path(wl, 1); |
283 | if (ret < 0) | 343 | if (ret < 0) |
284 | return ret; | 344 | goto out_free_memmap; |
345 | |||
346 | /* Configure for CAM power saving (ie. always active) */ | ||
347 | ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_CAM); | ||
348 | if (ret < 0) | ||
349 | goto out_free_memmap; | ||
350 | |||
351 | /* configure PM */ | ||
352 | ret = wl1271_acx_pm_config(wl); | ||
353 | if (ret < 0) | ||
354 | goto out_free_memmap; | ||
285 | 355 | ||
286 | return 0; | 356 | return 0; |
357 | |||
358 | out_free_memmap: | ||
359 | kfree(wl->target_mem_map); | ||
360 | wl->target_mem_map = NULL; | ||
361 | |||
362 | return ret; | ||
287 | } | 363 | } |
288 | 364 | ||
289 | static void wl1271_disable_interrupts(struct wl1271 *wl) | 365 | static void wl1271_disable_interrupts(struct wl1271 *wl) |
@@ -653,11 +729,6 @@ int wl1271_plt_start(struct wl1271 *wl) | |||
653 | if (ret < 0) | 729 | if (ret < 0) |
654 | goto irq_disable; | 730 | goto irq_disable; |
655 | 731 | ||
656 | /* Make sure power saving is disabled */ | ||
657 | ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_CAM); | ||
658 | if (ret < 0) | ||
659 | goto irq_disable; | ||
660 | |||
661 | wl->state = WL1271_STATE_PLT; | 732 | wl->state = WL1271_STATE_PLT; |
662 | wl1271_notice("firmware booted in PLT mode (%s)", | 733 | wl1271_notice("firmware booted in PLT mode (%s)", |
663 | wl->chip.fw_ver); | 734 | wl->chip.fw_ver); |