aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/init.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2011-04-18 07:15:25 -0400
committerLuciano Coelho <coelho@ti.com>2011-05-02 03:31:13 -0400
commit70f474241b3d5fb633635a2ce39ea9da4afeea6c (patch)
treed2452d25284fe8a4a518c1c9986275109826140b /drivers/net/wireless/wl12xx/init.c
parent52dcaf577f3b6d878a337a44a99a122017c85ff6 (diff)
wl12xx: AP-mode - overhaul rate policy configuration
Use the minimal rate configured in the basic rates set as the AP broadcast and multicast rate. The minimal rate is used to ensure weak links can still communicate. When the basic rates contains at least one OFDM rate, configure all unicast TX rates to OFDM only. Unify rate configuration on initialization and on change notification into a single function. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/init.c')
-rw-r--r--drivers/net/wireless/wl12xx/init.c71
1 files changed, 53 insertions, 18 deletions
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index e0de041e38f1..5d0ecd2018bf 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -417,7 +417,7 @@ static int wl1271_sta_hw_init_post_mem(struct wl1271 *wl)
417 417
418static int wl1271_ap_hw_init(struct wl1271 *wl) 418static int wl1271_ap_hw_init(struct wl1271 *wl)
419{ 419{
420 int ret, i; 420 int ret;
421 421
422 ret = wl1271_ap_init_templates_config(wl); 422 ret = wl1271_ap_init_templates_config(wl);
423 if (ret < 0) 423 if (ret < 0)
@@ -428,23 +428,7 @@ static int wl1271_ap_hw_init(struct wl1271 *wl)
428 if (ret < 0) 428 if (ret < 0)
429 return ret; 429 return ret;
430 430
431 /* Configure initial TX rate classes */ 431 ret = wl1271_init_ap_rates(wl);
432 for (i = 0; i < wl->conf.tx.ac_conf_count; i++) {
433 ret = wl1271_acx_ap_rate_policy(wl,
434 &wl->conf.tx.ap_rc_conf[i], i);
435 if (ret < 0)
436 return ret;
437 }
438
439 ret = wl1271_acx_ap_rate_policy(wl,
440 &wl->conf.tx.ap_mgmt_conf,
441 ACX_TX_AP_MODE_MGMT_RATE);
442 if (ret < 0)
443 return ret;
444
445 ret = wl1271_acx_ap_rate_policy(wl,
446 &wl->conf.tx.ap_bcst_conf,
447 ACX_TX_AP_MODE_BCST_RATE);
448 if (ret < 0) 432 if (ret < 0)
449 return ret; 433 return ret;
450 434
@@ -486,6 +470,57 @@ static int wl1271_ap_hw_init_post_mem(struct wl1271 *wl)
486 return 0; 470 return 0;
487} 471}
488 472
473int wl1271_init_ap_rates(struct wl1271 *wl)
474{
475 int i, ret;
476 struct conf_tx_rate_class rc;
477 u32 supported_rates;
478
479 wl1271_debug(DEBUG_AP, "AP basic rate set: 0x%x", wl->basic_rate_set);
480
481 if (wl->basic_rate_set == 0)
482 return -EINVAL;
483
484 rc.enabled_rates = wl->basic_rate_set;
485 rc.long_retry_limit = 10;
486 rc.short_retry_limit = 10;
487 rc.aflags = 0;
488 ret = wl1271_acx_ap_rate_policy(wl, &rc, ACX_TX_AP_MODE_MGMT_RATE);
489 if (ret < 0)
490 return ret;
491
492 /* use the min basic rate for AP broadcast/multicast */
493 rc.enabled_rates = wl1271_tx_min_rate_get(wl);
494 rc.short_retry_limit = 10;
495 rc.long_retry_limit = 10;
496 rc.aflags = 0;
497 ret = wl1271_acx_ap_rate_policy(wl, &rc, ACX_TX_AP_MODE_BCST_RATE);
498 if (ret < 0)
499 return ret;
500
501 /*
502 * If the basic rates contain OFDM rates, use OFDM only
503 * rates for unicast TX as well. Else use all supported rates.
504 */
505 if ((wl->basic_rate_set & CONF_TX_OFDM_RATES))
506 supported_rates = CONF_TX_OFDM_RATES;
507 else
508 supported_rates = CONF_TX_AP_ENABLED_RATES;
509
510 /* configure unicast TX rate classes */
511 for (i = 0; i < wl->conf.tx.ac_conf_count; i++) {
512 rc.enabled_rates = supported_rates;
513 rc.short_retry_limit = 10;
514 rc.long_retry_limit = 10;
515 rc.aflags = 0;
516 ret = wl1271_acx_ap_rate_policy(wl, &rc, i);
517 if (ret < 0)
518 return ret;
519 }
520
521 return 0;
522}
523
489static void wl1271_check_ba_support(struct wl1271 *wl) 524static void wl1271_check_ba_support(struct wl1271 *wl)
490{ 525{
491 /* validate FW cose ver x.x.x.50-60.x */ 526 /* validate FW cose ver x.x.x.50-60.x */