wl1271: Increase connection reliability
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>
Fri, 24 Sep 2010 01:10:11 +0000 (03:10 +0200)
committerLuciano Coelho <luciano.coelho@nokia.com>
Tue, 28 Sep 2010 09:30:06 +0000 (12:30 +0300)
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>
drivers/net/wireless/wl12xx/wl1271_cmd.c
drivers/net/wireless/wl12xx/wl1271_conf.h
drivers/net/wireless/wl12xx/wl1271_event.c
drivers/net/wireless/wl12xx/wl1271_main.c

index 170b5a8bdabc0ed80503e1bc8cb0859a8aed16f8..4a56ab05e736779a72abe3cd0f3dc4870493ba66 100644 (file)
@@ -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->send_null_data = send;
-       ps_params->retries = 5;
-       ps_params->hang_over_period = 1;
+       ps_params->retries = wl->conf.conn.psm_entry_nullfunc_retries;
+       ps_params->hang_over_period = wl->conf.conn.psm_entry_hangover_period;
        ps_params->null_data_rate = cpu_to_le32(rates);
 
        ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params,
@@ -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,
-                                     WL1271_RATE_AUTOMATIC);
+                                     wl->basic_rate);
 
 out:
        dev_kfree_skb(skb);
@@ -507,7 +507,7 @@ int wl1271_cmd_build_klv_null_data(struct wl1271 *wl)
        ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV,
                                      skb->data, skb->len,
                                      CMD_TEMPL_KLV_IDX_NULL_DATA,
-                                     WL1271_RATE_AUTOMATIC);
+                                     wl->basic_rate);
 
 out:
        dev_kfree_skb(skb);
@@ -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,
                                       sizeof(template), 0,
-                                      WL1271_RATE_AUTOMATIC);
+                                      wl->basic_rate);
 }
 
 int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id)
index ab716f517553410f1eeb5e7f835b2b9dfadc1509..60c50d1a98353529f05ccb03e956097adde5ef82 100644 (file)
@@ -911,6 +911,22 @@ struct conf_conn_settings {
         */
        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
index e6c839af903830557ae3b63e77c2432124778cbb..7b3f503829631018630ca21e9faa67f840db10c8 100644 (file)
@@ -96,7 +96,6 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
 {
        int ret = 0;
        u32 total_retries = wl->conf.conn.psm_entry_retries;
-       u32 rates;
 
        wl1271_debug(DEBUG_EVENT, "ps_status: 0x%x", mbox->ps_status);
 
@@ -112,12 +111,8 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
 
                if (wl->psm_entry_retry < total_retries) {
                        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,
-                                                rates, true);
+                                                wl->basic_rate, true);
                } else {
                        wl1271_info("No ack to nullfunc from AP.");
                        wl->psm_entry_retry = 0;
index b2f2d457f28ceefd7319e67328444826aff7d01d..b7e9c69f3772cfa535dff8d046e4b7759b6804fd 100644 (file)
@@ -214,7 +214,9 @@ static struct conf_drv_settings default_conf = {
                .ps_poll_recovery_period     = 700,
                .bet_enable                  = CONF_BET_MODE_ENABLE,
                .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,
                .max_listen_interval         = 20,
        },
@@ -1360,7 +1362,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
                if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {
                        wl1271_debug(DEBUG_PSM, "psm enabled");
                        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) &&
                   test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) {
@@ -1370,7 +1372,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
 
                if (test_bit(WL1271_FLAG_PSM, &wl->flags))
                        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) {
@@ -1846,7 +1848,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
                            !test_bit(WL1271_FLAG_PSM, &wl->flags)) {
                                mode = STATION_POWER_SAVE_MODE;
                                ret = wl1271_ps_set_mode(wl, mode,
-                                                        wl->basic_rate_set,
+                                                        wl->basic_rate,
                                                         true);
                                if (ret < 0)
                                        goto out_sleep;