aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-03-26 06:53:23 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-31 14:39:14 -0400
commit6ccbb92ead9379d7de2cc25cd950d15a8d22e0c9 (patch)
tree51c618b5c033cde8317f62a1763259047d8ff4ce /drivers/net/wireless/wl12xx
parente7942235f2496587cb4af86168e54d588ffcbd4f (diff)
wl1271: Disable connection monitoring while not associated
The wl1271 does not support disabling the connection monitor feature. Perform the next best thing by increasing the beacon-loss threshold and BSS_LOSE event timeout to the maximum values. This is needed, because we really don't want any random probe-requests during scanning or especially while in ad-hoc mode and not beaconing. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_acx.c18
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_acx.h2
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_init.c2
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c12
4 files changed, 27 insertions, 7 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c
index 7e337cea9905..e7d11811a907 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.c
@@ -504,12 +504,17 @@ out:
504 return ret; 504 return ret;
505} 505}
506 506
507int wl1271_acx_conn_monit_params(struct wl1271 *wl) 507#define ACX_CONN_MONIT_DISABLE_VALUE 0xffffffff
508
509int wl1271_acx_conn_monit_params(struct wl1271 *wl, bool enable)
508{ 510{
509 struct acx_conn_monit_params *acx; 511 struct acx_conn_monit_params *acx;
512 u32 threshold = ACX_CONN_MONIT_DISABLE_VALUE;
513 u32 timeout = ACX_CONN_MONIT_DISABLE_VALUE;
510 int ret; 514 int ret;
511 515
512 wl1271_debug(DEBUG_ACX, "acx connection monitor parameters"); 516 wl1271_debug(DEBUG_ACX, "acx connection monitor parameters: %s",
517 enable ? "enabled" : "disabled");
513 518
514 acx = kzalloc(sizeof(*acx), GFP_KERNEL); 519 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
515 if (!acx) { 520 if (!acx) {
@@ -517,8 +522,13 @@ int wl1271_acx_conn_monit_params(struct wl1271 *wl)
517 goto out; 522 goto out;
518 } 523 }
519 524
520 acx->synch_fail_thold = cpu_to_le32(wl->conf.conn.synch_fail_thold); 525 if (enable) {
521 acx->bss_lose_timeout = cpu_to_le32(wl->conf.conn.bss_lose_timeout); 526 threshold = wl->conf.conn.synch_fail_thold;
527 timeout = wl->conf.conn.bss_lose_timeout;
528 }
529
530 acx->synch_fail_thold = cpu_to_le32(threshold);
531 acx->bss_lose_timeout = cpu_to_le32(timeout);
522 532
523 ret = wl1271_cmd_configure(wl, ACX_CONN_MONIT_PARAMS, 533 ret = wl1271_cmd_configure(wl, ACX_CONN_MONIT_PARAMS,
524 acx, sizeof(*acx)); 534 acx, sizeof(*acx));
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h
index 8e5870fa9609..b6eb0c1b6c78 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.h
@@ -1004,7 +1004,7 @@ int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold);
1004int wl1271_acx_dco_itrim_params(struct wl1271 *wl); 1004int wl1271_acx_dco_itrim_params(struct wl1271 *wl);
1005int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter); 1005int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter);
1006int wl1271_acx_beacon_filter_table(struct wl1271 *wl); 1006int wl1271_acx_beacon_filter_table(struct wl1271 *wl);
1007int wl1271_acx_conn_monit_params(struct wl1271 *wl); 1007int wl1271_acx_conn_monit_params(struct wl1271 *wl, bool enable);
1008int wl1271_acx_sg_enable(struct wl1271 *wl, bool enable); 1008int wl1271_acx_sg_enable(struct wl1271 *wl, bool enable);
1009int wl1271_acx_sg_cfg(struct wl1271 *wl); 1009int wl1271_acx_sg_cfg(struct wl1271 *wl);
1010int wl1271_acx_cca_threshold(struct wl1271 *wl); 1010int wl1271_acx_cca_threshold(struct wl1271 *wl);
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c
index d9335fc2a575..987978c3bce0 100644
--- a/drivers/net/wireless/wl12xx/wl1271_init.c
+++ b/drivers/net/wireless/wl12xx/wl1271_init.c
@@ -236,7 +236,7 @@ int wl1271_hw_init(struct wl1271 *wl)
236 goto out_free_memmap; 236 goto out_free_memmap;
237 237
238 /* Initialize connection monitoring thresholds */ 238 /* Initialize connection monitoring thresholds */
239 ret = wl1271_acx_conn_monit_params(wl); 239 ret = wl1271_acx_conn_monit_params(wl, false);
240 if (ret < 0) 240 if (ret < 0)
241 goto out_free_memmap; 241 goto out_free_memmap;
242 242
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 4a2f1d772adc..00e856c4a611 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -348,7 +348,7 @@ static int wl1271_plt_init(struct wl1271 *wl)
348 goto out_free_memmap; 348 goto out_free_memmap;
349 349
350 /* Initialize connection monitoring thresholds */ 350 /* Initialize connection monitoring thresholds */
351 ret = wl1271_acx_conn_monit_params(wl); 351 ret = wl1271_acx_conn_monit_params(wl, false);
352 if (ret < 0) 352 if (ret < 0)
353 goto out_free_memmap; 353 goto out_free_memmap;
354 354
@@ -1651,6 +1651,11 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1651 if (ret < 0) 1651 if (ret < 0)
1652 goto out_sleep; 1652 goto out_sleep;
1653 1653
1654 /* enable the connection monitoring feature */
1655 ret = wl1271_acx_conn_monit_params(wl, true);
1656 if (ret < 0)
1657 goto out_sleep;
1658
1654 /* If we want to go in PSM but we're not there yet */ 1659 /* If we want to go in PSM but we're not there yet */
1655 if (test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags) && 1660 if (test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags) &&
1656 !test_bit(WL1271_FLAG_PSM, &wl->flags)) { 1661 !test_bit(WL1271_FLAG_PSM, &wl->flags)) {
@@ -1663,6 +1668,11 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1663 /* use defaults when not associated */ 1668 /* use defaults when not associated */
1664 clear_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags); 1669 clear_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags);
1665 wl->aid = 0; 1670 wl->aid = 0;
1671
1672 /* disable connection monitor features */
1673 ret = wl1271_acx_conn_monit_params(wl, false);
1674 if (ret < 0)
1675 goto out_sleep;
1666 } 1676 }
1667 1677
1668 } 1678 }