aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-09-23 21:10:11 -0400
committerLuciano Coelho <luciano.coelho@nokia.com>2010-09-28 05:30:06 -0400
commit8eab7b4708b5ef4701ecbe5d659f99743b77b668 (patch)
tree5106fc508abdd4f0049e9ed7892086f02ffdb2ae /drivers/net
parentbea39d6a60b62f16e904be5a520bf55714d73021 (diff)
wl1271: Increase connection reliability
This patch improves connection reliability by choosing the lowest basic rate for null-func frames (which increases their range, as the firmware does not do rate fall-back for null-func frames.) Also, increase the PSM entry retry-counter. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Tested-by: Tuomas Katila <ext-tuomas.2.katila@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.c10
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_conf.h16
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_event.c7
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c10
4 files changed, 28 insertions, 15 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 170b5a8bdabc..4a56ab05e736 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -408,8 +408,8 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, u32 rates, bool send)
408 408
409 ps_params->ps_mode = ps_mode; 409 ps_params->ps_mode = ps_mode;
410 ps_params->send_null_data = send; 410 ps_params->send_null_data = send;
411 ps_params->retries = 5; 411 ps_params->retries = wl->conf.conn.psm_entry_nullfunc_retries;
412 ps_params->hang_over_period = 1; 412 ps_params->hang_over_period = wl->conf.conn.psm_entry_hangover_period;
413 ps_params->null_data_rate = cpu_to_le32(rates); 413 ps_params->null_data_rate = cpu_to_le32(rates);
414 414
415 ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params, 415 ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params,
@@ -484,7 +484,7 @@ int wl1271_cmd_build_null_data(struct wl1271 *wl)
484 } 484 }
485 485
486 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, ptr, size, 0, 486 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, ptr, size, 0,
487 WL1271_RATE_AUTOMATIC); 487 wl->basic_rate);
488 488
489out: 489out:
490 dev_kfree_skb(skb); 490 dev_kfree_skb(skb);
@@ -507,7 +507,7 @@ int wl1271_cmd_build_klv_null_data(struct wl1271 *wl)
507 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV, 507 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV,
508 skb->data, skb->len, 508 skb->data, skb->len,
509 CMD_TEMPL_KLV_IDX_NULL_DATA, 509 CMD_TEMPL_KLV_IDX_NULL_DATA,
510 WL1271_RATE_AUTOMATIC); 510 wl->basic_rate);
511 511
512out: 512out:
513 dev_kfree_skb(skb); 513 dev_kfree_skb(skb);
@@ -584,7 +584,7 @@ int wl1271_build_qos_null_data(struct wl1271 *wl)
584 584
585 return wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, &template, 585 return wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, &template,
586 sizeof(template), 0, 586 sizeof(template), 0,
587 WL1271_RATE_AUTOMATIC); 587 wl->basic_rate);
588} 588}
589 589
590int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id) 590int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id)
diff --git a/drivers/net/wireless/wl12xx/wl1271_conf.h b/drivers/net/wireless/wl12xx/wl1271_conf.h
index ab716f517553..60c50d1a9835 100644
--- a/drivers/net/wireless/wl12xx/wl1271_conf.h
+++ b/drivers/net/wireless/wl12xx/wl1271_conf.h
@@ -912,6 +912,22 @@ struct conf_conn_settings {
912 u8 psm_entry_retries; 912 u8 psm_entry_retries;
913 913
914 /* 914 /*
915 * Specifies the maximum number of times to try transmit the PSM entry
916 * null-func frame for each PSM entry attempt
917 *
918 * Range 0 - 255
919 */
920 u8 psm_entry_nullfunc_retries;
921
922 /*
923 * Specifies the time to linger in active mode after successfully
924 * transmitting the PSM entry null-func frame.
925 *
926 * Range 0 - 255 TU's
927 */
928 u8 psm_entry_hangover_period;
929
930 /*
915 * 931 *
916 * Specifies the interval of the connection keep-alive null-func 932 * Specifies the interval of the connection keep-alive null-func
917 * frame in ms. 933 * frame in ms.
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.c b/drivers/net/wireless/wl12xx/wl1271_event.c
index e6c839af9038..7b3f50382963 100644
--- a/drivers/net/wireless/wl12xx/wl1271_event.c
+++ b/drivers/net/wireless/wl12xx/wl1271_event.c
@@ -96,7 +96,6 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
96{ 96{
97 int ret = 0; 97 int ret = 0;
98 u32 total_retries = wl->conf.conn.psm_entry_retries; 98 u32 total_retries = wl->conf.conn.psm_entry_retries;
99 u32 rates;
100 99
101 wl1271_debug(DEBUG_EVENT, "ps_status: 0x%x", mbox->ps_status); 100 wl1271_debug(DEBUG_EVENT, "ps_status: 0x%x", mbox->ps_status);
102 101
@@ -112,12 +111,8 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
112 111
113 if (wl->psm_entry_retry < total_retries) { 112 if (wl->psm_entry_retry < total_retries) {
114 wl->psm_entry_retry++; 113 wl->psm_entry_retry++;
115 if (wl->psm_entry_retry == total_retries)
116 rates = wl->basic_rate;
117 else
118 rates = wl->basic_rate_set;
119 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, 114 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE,
120 rates, true); 115 wl->basic_rate, true);
121 } else { 116 } else {
122 wl1271_info("No ack to nullfunc from AP."); 117 wl1271_info("No ack to nullfunc from AP.");
123 wl->psm_entry_retry = 0; 118 wl->psm_entry_retry = 0;
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index b2f2d457f28c..b7e9c69f3772 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -214,7 +214,9 @@ static struct conf_drv_settings default_conf = {
214 .ps_poll_recovery_period = 700, 214 .ps_poll_recovery_period = 700,
215 .bet_enable = CONF_BET_MODE_ENABLE, 215 .bet_enable = CONF_BET_MODE_ENABLE,
216 .bet_max_consecutive = 10, 216 .bet_max_consecutive = 10,
217 .psm_entry_retries = 3, 217 .psm_entry_retries = 5,
218 .psm_entry_nullfunc_retries = 3,
219 .psm_entry_hangover_period = 1,
218 .keep_alive_interval = 55000, 220 .keep_alive_interval = 55000,
219 .max_listen_interval = 20, 221 .max_listen_interval = 20,
220 }, 222 },
@@ -1360,7 +1362,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
1360 if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) { 1362 if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {
1361 wl1271_debug(DEBUG_PSM, "psm enabled"); 1363 wl1271_debug(DEBUG_PSM, "psm enabled");
1362 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, 1364 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE,
1363 wl->basic_rate_set, true); 1365 wl->basic_rate, true);
1364 } 1366 }
1365 } else if (!(conf->flags & IEEE80211_CONF_PS) && 1367 } else if (!(conf->flags & IEEE80211_CONF_PS) &&
1366 test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) { 1368 test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) {
@@ -1370,7 +1372,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
1370 1372
1371 if (test_bit(WL1271_FLAG_PSM, &wl->flags)) 1373 if (test_bit(WL1271_FLAG_PSM, &wl->flags))
1372 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, 1374 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
1373 wl->basic_rate_set, true); 1375 wl->basic_rate, true);
1374 } 1376 }
1375 1377
1376 if (conf->power_level != wl->power_level) { 1378 if (conf->power_level != wl->power_level) {
@@ -1846,7 +1848,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1846 !test_bit(WL1271_FLAG_PSM, &wl->flags)) { 1848 !test_bit(WL1271_FLAG_PSM, &wl->flags)) {
1847 mode = STATION_POWER_SAVE_MODE; 1849 mode = STATION_POWER_SAVE_MODE;
1848 ret = wl1271_ps_set_mode(wl, mode, 1850 ret = wl1271_ps_set_mode(wl, mode,
1849 wl->basic_rate_set, 1851 wl->basic_rate,
1850 true); 1852 true);
1851 if (ret < 0) 1853 if (ret < 0)
1852 goto out_sleep; 1854 goto out_sleep;