From 7b9f58234a044de39fe72d184a17e1130a05af9f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 19 Nov 2010 22:55:38 +0100 Subject: [PATCH] --- yaml --- r: 224685 b: refs/heads/master c: 7ccc8bd7593634d827e8bc55898a5038e29848b5 h: refs/heads/master i: 224683: 3e3178fb8fa35d5721e36f40cf6436acbc52e7a2 v: v3 --- [refs] | 2 +- trunk/net/mac80211/ieee80211_i.h | 1 + trunk/net/mac80211/mlme.c | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 10e4f7027706..ac034fef202c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c8a7972c3b3633bf90daf50b135665d8ca4838c4 +refs/heads/master: 7ccc8bd7593634d827e8bc55898a5038e29848b5 diff --git a/trunk/net/mac80211/ieee80211_i.h b/trunk/net/mac80211/ieee80211_i.h index 3598abf21844..ff7bc307827b 100644 --- a/trunk/net/mac80211/ieee80211_i.h +++ b/trunk/net/mac80211/ieee80211_i.h @@ -349,6 +349,7 @@ struct ieee80211_if_managed { struct work_struct chswitch_work; struct work_struct beacon_connection_loss_work; + unsigned long beacon_timeout; unsigned long probe_timeout; int probe_send_count; diff --git a/trunk/net/mac80211/mlme.c b/trunk/net/mac80211/mlme.c index 84e24df234e2..729aba49cf98 100644 --- a/trunk/net/mac80211/mlme.c +++ b/trunk/net/mac80211/mlme.c @@ -31,10 +31,15 @@ #define IEEE80211_MAX_PROBE_TRIES 5 /* - * beacon loss detection timeout - * XXX: should depend on beacon interval + * Beacon loss timeout is calculated as N frames times the + * advertised beacon interval. This may need to be somewhat + * higher than what hardware might detect to account for + * delays in the host processing frames. But since we also + * probe on beacon miss before declaring the connection lost + * default to what we want. */ -#define IEEE80211_BEACON_LOSS_TIME (2 * HZ) +#define IEEE80211_BEACON_LOSS_COUNT 7 + /* * Time the connection can be idle before we probe * it to see if we can still talk to the AP. @@ -121,7 +126,7 @@ void ieee80211_sta_reset_beacon_monitor(struct ieee80211_sub_if_data *sdata) return; mod_timer(&sdata->u.mgd.bcn_mon_timer, - round_jiffies_up(jiffies + IEEE80211_BEACON_LOSS_TIME)); + round_jiffies_up(jiffies + sdata->u.mgd.beacon_timeout)); } void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata) @@ -871,6 +876,9 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata, bss_info_changed |= ieee80211_handle_bss_capability(sdata, cbss->capability, bss->has_erp_value, bss->erp_value); + sdata->u.mgd.beacon_timeout = usecs_to_jiffies(ieee80211_tu_to_usec( + IEEE80211_BEACON_LOSS_COUNT * bss_conf->beacon_int)); + sdata->u.mgd.associated = cbss; memcpy(sdata->u.mgd.bssid, cbss->bssid, ETH_ALEN);