From patchwork Fri Aug 27 05:38:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Rodriguez X-Patchwork-Id: 136621 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o7R5cpNQ000954 for ; Fri, 27 Aug 2010 05:38:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752211Ab0H0Fit (ORCPT ); Fri, 27 Aug 2010 01:38:49 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:47271 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752110Ab0H0Fit (ORCPT ); Fri, 27 Aug 2010 01:38:49 -0400 Received: from mcgrof by bombadil.infradead.org with local (Exim 4.72 #1 (Red Hat Linux)) id 1OoreJ-00063t-M9; Fri, 27 Aug 2010 05:38:47 +0000 From: "Luis R. Rodriguez" To: linux-wireless@vger.kernel.org Cc: "Luis R. Rodriguez" , Kalle Valo , Amod Bodas Subject: [RFT] mac80211: fix broadcast/multicast data drop on scan Date: Fri, 27 Aug 2010 01:38:47 -0400 Message-Id: <1282887527-23259-1-git-send-email-lrodriguez@atheros.com> X-Mailer: git-send-email 1.6.2.rc1.3.g81d3f Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 27 Aug 2010 05:38:51 +0000 (UTC) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 2c7e376..e105304 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -444,6 +444,8 @@ static int ieee80211_scan_state_decision(struct ieee80211_local *local, bool tx_empty = true; bool bad_latency; bool listen_int_exceeded; + /* accounts for PM_QOS_NETWORK_LATENCY and dtim period */ + bool latency_dtim_period_exceeded = false; unsigned long min_beacon_int = 0; struct ieee80211_sub_if_data *sdata; struct ieee80211_channel *next_chan; @@ -466,6 +468,7 @@ static int ieee80211_scan_state_decision(struct ieee80211_local *local, if (sdata->vif.type == NL80211_IFTYPE_STATION) { if (sdata->u.mgd.associated) { + associated = true; if (sdata->vif.bss_conf.beacon_int < @@ -511,8 +514,16 @@ static int ieee80211_scan_state_decision(struct ieee80211_local *local, usecs_to_jiffies(min_beacon_int * 1024) * local->hw.conf.listen_interval); + if (associated && local->hw.conf.max_sleep_period) { + latency_dtim_period_exceeded = time_after(jiffies + + ieee80211_scan_get_channel_time(next_chan), + local->leave_oper_channel_time + + usecs_to_jiffies(min_beacon_int * 1024) * + local->hw.conf.max_sleep_period); + } + if (associated && ( !tx_empty || bad_latency || - listen_int_exceeded)) + listen_int_exceeded || latency_dtim_period_exceeded)) local->next_scan_state = SCAN_ENTER_OPER_CHANNEL; else local->next_scan_state = SCAN_SET_CHANNEL;