We recently increased the probe retry count for beacon monitoring
in order to make challenging channel conditions less volatile. In
doing so, we made the system slower to respond to a lost AP when the
system resumes from suspend. Mitigate this by using a different
try-count for the resume-from-suspend case.
BUG=chromium-os:28576
TEST=Manual: Suspend, unplug AP, resume. Observe disconnection in < 1sec
Change-Id: I206d4b2838da2ce7da00739412e5fcda63a27a2c
Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/19234
Reviewed-by: Gary Morain <gmorain@chromium.org>
IEEE80211_STA_UAPSD_ENABLED = BIT(7),
IEEE80211_STA_NULLFUNC_ACKED = BIT(8),
IEEE80211_STA_RESET_SIGNAL_AVE = BIT(9),
IEEE80211_STA_UAPSD_ENABLED = BIT(7),
IEEE80211_STA_NULLFUNC_ACKED = BIT(8),
IEEE80211_STA_RESET_SIGNAL_AVE = BIT(9),
+ IEEE80211_STA_RESUME_POLL = BIT(10),
};
struct ieee80211_mgd_auth_data {
};
struct ieee80211_mgd_auth_data {
MODULE_PARM_DESC(max_nullfunc_tries,
"Maximum nullfunc tx tries before disconnecting (reason 4).");
MODULE_PARM_DESC(max_nullfunc_tries,
"Maximum nullfunc tx tries before disconnecting (reason 4).");
+static int max_nullfunc_tries_resume = 2;
+module_param(max_nullfunc_tries_resume, int, 0644);
+MODULE_PARM_DESC(max_nullfunc_tries_resume,
+ "Maximum nullfunc tx tries on resume before disconnecting "
+ "(reason 4).");
+
static int max_probe_tries = 5;
module_param(max_probe_tries, int, 0644);
MODULE_PARM_DESC(max_probe_tries,
static int max_probe_tries = 5;
module_param(max_probe_tries, int, 0644);
MODULE_PARM_DESC(max_probe_tries,
/* just to be sure */
sdata->u.mgd.flags &= ~(IEEE80211_STA_CONNECTION_POLL |
/* just to be sure */
sdata->u.mgd.flags &= ~(IEEE80211_STA_CONNECTION_POLL |
- IEEE80211_STA_BEACON_POLL);
+ IEEE80211_STA_BEACON_POLL |
+ IEEE80211_STA_RESUME_POLL);
ieee80211_led_assoc(local, 1);
ieee80211_led_assoc(local, 1);
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
if (!(ifmgd->flags & (IEEE80211_STA_BEACON_POLL |
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
if (!(ifmgd->flags & (IEEE80211_STA_BEACON_POLL |
- IEEE80211_STA_CONNECTION_POLL)))
+ IEEE80211_STA_CONNECTION_POLL |
+ IEEE80211_STA_RESUME_POLL)))
return;
ifmgd->flags &= ~(IEEE80211_STA_CONNECTION_POLL |
return;
ifmgd->flags &= ~(IEEE80211_STA_CONNECTION_POLL |
- IEEE80211_STA_BEACON_POLL);
+ IEEE80211_STA_BEACON_POLL |
+ IEEE80211_STA_RESUME_POLL);
mutex_lock(&sdata->local->iflist_mtx);
ieee80211_recalc_ps(sdata->local, -1);
mutex_unlock(&sdata->local->iflist_mtx);
mutex_lock(&sdata->local->iflist_mtx);
ieee80211_recalc_ps(sdata->local, -1);
mutex_unlock(&sdata->local->iflist_mtx);
u8 frame_buf[DEAUTH_DISASSOC_LEN];
ifmgd->flags &= ~(IEEE80211_STA_CONNECTION_POLL |
u8 frame_buf[DEAUTH_DISASSOC_LEN];
ifmgd->flags &= ~(IEEE80211_STA_CONNECTION_POLL |
- IEEE80211_STA_BEACON_POLL);
+ IEEE80211_STA_BEACON_POLL |
+ IEEE80211_STA_RESUME_POLL);
ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason,
false, frame_buf);
ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason,
false, frame_buf);
run_again(ifmgd, ifmgd->assoc_data->timeout);
if (ifmgd->flags & (IEEE80211_STA_BEACON_POLL |
run_again(ifmgd, ifmgd->assoc_data->timeout);
if (ifmgd->flags & (IEEE80211_STA_BEACON_POLL |
- IEEE80211_STA_CONNECTION_POLL) &&
+ IEEE80211_STA_CONNECTION_POLL |
+ IEEE80211_STA_RESUME_POLL) &&
ifmgd->associated) {
u8 bssid[ETH_ALEN];
int max_tries;
memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
ifmgd->associated) {
u8 bssid[ETH_ALEN];
int max_tries;
memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
- if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)
- max_tries = max_nullfunc_tries;
- else
+ if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) {
+ if (ifmgd->flags & IEEE80211_STA_RESUME_POLL)
+ max_tries = max_nullfunc_tries_resume;
+ else
+ max_tries = max_nullfunc_tries;
+ } else
max_tries = max_probe_tries;
/* ACK received for nullfunc probing frame */
max_tries = max_probe_tries;
/* ACK received for nullfunc probing frame */
if (sdata->vif.type == NL80211_IFTYPE_STATION) {
sdata->u.mgd.flags &= ~(IEEE80211_STA_BEACON_POLL |
if (sdata->vif.type == NL80211_IFTYPE_STATION) {
sdata->u.mgd.flags &= ~(IEEE80211_STA_BEACON_POLL |
- IEEE80211_STA_CONNECTION_POLL);
+ IEEE80211_STA_CONNECTION_POLL |
+ IEEE80211_STA_RESUME_POLL);
/* let's probe the connection once */
flags = sdata->local->hw.flags;
/* let's probe the connection once */
flags = sdata->local->hw.flags;
add_timer(&ifmgd->chswitch_timer);
ieee80211_sta_reset_beacon_monitor(sdata);
ieee80211_restart_sta_timer(sdata);
add_timer(&ifmgd->chswitch_timer);
ieee80211_sta_reset_beacon_monitor(sdata);
ieee80211_restart_sta_timer(sdata);
+ ifmgd->flags |= IEEE80211_STA_RESUME_POLL;
+ ieee80211_queue_work(&sdata->local->hw, &sdata->u.mgd.monitor_work);