Commit 8eab7b47 authored by Juuso Oikarinen's avatar Juuso Oikarinen Committed by Luciano Coelho

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: default avatarJuuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: default avatarTeemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Tested-by: default avatarTuomas Katila <ext-tuomas.2.katila@nokia.com>
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@nokia.com>
parent bea39d6a
...@@ -408,8 +408,8 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, u32 rates, bool send) ...@@ -408,8 +408,8 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, u32 rates, bool send)
ps_params->ps_mode = ps_mode; ps_params->ps_mode = ps_mode;
ps_params->send_null_data = send; ps_params->send_null_data = send;
ps_params->retries = 5; ps_params->retries = wl->conf.conn.psm_entry_nullfunc_retries;
ps_params->hang_over_period = 1; ps_params->hang_over_period = wl->conf.conn.psm_entry_hangover_period;
ps_params->null_data_rate = cpu_to_le32(rates); ps_params->null_data_rate = cpu_to_le32(rates);
ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params, 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,7 +484,7 @@ int wl1271_cmd_build_null_data(struct wl1271 *wl)
} }
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, ptr, size, 0, ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, ptr, size, 0,
WL1271_RATE_AUTOMATIC); wl->basic_rate);
out: out:
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -507,7 +507,7 @@ int wl1271_cmd_build_klv_null_data(struct wl1271 *wl) ...@@ -507,7 +507,7 @@ int wl1271_cmd_build_klv_null_data(struct wl1271 *wl)
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV, ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV,
skb->data, skb->len, skb->data, skb->len,
CMD_TEMPL_KLV_IDX_NULL_DATA, CMD_TEMPL_KLV_IDX_NULL_DATA,
WL1271_RATE_AUTOMATIC); wl->basic_rate);
out: out:
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -584,7 +584,7 @@ int wl1271_build_qos_null_data(struct wl1271 *wl) ...@@ -584,7 +584,7 @@ int wl1271_build_qos_null_data(struct wl1271 *wl)
return wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, &template, return wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, &template,
sizeof(template), 0, sizeof(template), 0,
WL1271_RATE_AUTOMATIC); wl->basic_rate);
} }
int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id) int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id)
......
...@@ -911,6 +911,22 @@ struct conf_conn_settings { ...@@ -911,6 +911,22 @@ struct conf_conn_settings {
*/ */
u8 psm_entry_retries; u8 psm_entry_retries;
/*
* Specifies the maximum number of times to try transmit the PSM entry
* null-func frame for each PSM entry attempt
*
* Range 0 - 255
*/
u8 psm_entry_nullfunc_retries;
/*
* Specifies the time to linger in active mode after successfully
* transmitting the PSM entry null-func frame.
*
* Range 0 - 255 TU's
*/
u8 psm_entry_hangover_period;
/* /*
* *
* Specifies the interval of the connection keep-alive null-func * Specifies the interval of the connection keep-alive null-func
......
...@@ -96,7 +96,6 @@ static int wl1271_event_ps_report(struct wl1271 *wl, ...@@ -96,7 +96,6 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
{ {
int ret = 0; int ret = 0;
u32 total_retries = wl->conf.conn.psm_entry_retries; u32 total_retries = wl->conf.conn.psm_entry_retries;
u32 rates;
wl1271_debug(DEBUG_EVENT, "ps_status: 0x%x", mbox->ps_status); wl1271_debug(DEBUG_EVENT, "ps_status: 0x%x", mbox->ps_status);
...@@ -112,12 +111,8 @@ static int wl1271_event_ps_report(struct wl1271 *wl, ...@@ -112,12 +111,8 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
if (wl->psm_entry_retry < total_retries) { if (wl->psm_entry_retry < total_retries) {
wl->psm_entry_retry++; wl->psm_entry_retry++;
if (wl->psm_entry_retry == total_retries)
rates = wl->basic_rate;
else
rates = wl->basic_rate_set;
ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE,
rates, true); wl->basic_rate, true);
} else { } else {
wl1271_info("No ack to nullfunc from AP."); wl1271_info("No ack to nullfunc from AP.");
wl->psm_entry_retry = 0; wl->psm_entry_retry = 0;
......
...@@ -214,7 +214,9 @@ static struct conf_drv_settings default_conf = { ...@@ -214,7 +214,9 @@ static struct conf_drv_settings default_conf = {
.ps_poll_recovery_period = 700, .ps_poll_recovery_period = 700,
.bet_enable = CONF_BET_MODE_ENABLE, .bet_enable = CONF_BET_MODE_ENABLE,
.bet_max_consecutive = 10, .bet_max_consecutive = 10,
.psm_entry_retries = 3, .psm_entry_retries = 5,
.psm_entry_nullfunc_retries = 3,
.psm_entry_hangover_period = 1,
.keep_alive_interval = 55000, .keep_alive_interval = 55000,
.max_listen_interval = 20, .max_listen_interval = 20,
}, },
...@@ -1360,7 +1362,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) ...@@ -1360,7 +1362,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) { if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {
wl1271_debug(DEBUG_PSM, "psm enabled"); wl1271_debug(DEBUG_PSM, "psm enabled");
ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE,
wl->basic_rate_set, true); wl->basic_rate, true);
} }
} else if (!(conf->flags & IEEE80211_CONF_PS) && } else if (!(conf->flags & IEEE80211_CONF_PS) &&
test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) { test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) {
...@@ -1370,7 +1372,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) ...@@ -1370,7 +1372,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
if (test_bit(WL1271_FLAG_PSM, &wl->flags)) if (test_bit(WL1271_FLAG_PSM, &wl->flags))
ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
wl->basic_rate_set, true); wl->basic_rate, true);
} }
if (conf->power_level != wl->power_level) { if (conf->power_level != wl->power_level) {
...@@ -1846,7 +1848,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1846,7 +1848,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
!test_bit(WL1271_FLAG_PSM, &wl->flags)) { !test_bit(WL1271_FLAG_PSM, &wl->flags)) {
mode = STATION_POWER_SAVE_MODE; mode = STATION_POWER_SAVE_MODE;
ret = wl1271_ps_set_mode(wl, mode, ret = wl1271_ps_set_mode(wl, mode,
wl->basic_rate_set, wl->basic_rate,
true); true);
if (ret < 0) if (ret < 0)
goto out_sleep; goto out_sleep;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment