Back-port of the following upstream commit... commit ad935687dbe7307f5abd9e3f610a965a287324a9 Author: Kalle Valo Date: Sun Apr 19 08:47:19 2009 +0300 mac80211: fix beacon loss detection after scan Currently beacon loss detection triggers after a scan. A probe request is sent and a message like this is printed to the log: wlan0: beacon loss from AP 00:12:17:e7:98:de - sending probe request But in fact there is no beacon loss, the beacons are just not received because of the ongoing scan. Fix it by updating last_beacon after the scan has finished. Reported-by: Jaswinder Singh Rajput Signed-off-by: Kalle Valo Acked-by: Johannes Berg Signed-off-by: John W. Linville diff -up linux-2.6.29.noarch/net/mac80211/mlme.c.orig linux-2.6.29.noarch/net/mac80211/mlme.c --- linux-2.6.29.noarch/net/mac80211/mlme.c.orig 2009-04-22 10:28:59.000000000 -0400 +++ linux-2.6.29.noarch/net/mac80211/mlme.c 2009-04-22 10:36:24.000000000 -0400 @@ -2364,9 +2364,30 @@ static void ieee80211_sta_work(struct wo static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) { - if (sdata->vif.type == NL80211_IFTYPE_STATION) + struct ieee80211_local *local = sdata->local; + struct sta_info *sta; + + rcu_read_lock(); + + sta = sta_info_get(local, sdata->u.sta.bssid); + if (!sta) { + rcu_read_unlock(); + return; + } + + if (sdata->vif.type == NL80211_IFTYPE_STATION) { + /* + * Need to update last_rx to avoid beacon loss + * test to trigger. + */ + sta->last_rx = jiffies; + + queue_work(sdata->local->hw.workqueue, &sdata->u.sta.work); + } + + rcu_read_unlock(); } /* interface setup */