linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: wireless <linux-wireless@vger.kernel.org>
Cc: Jouni Malinen <j@w1.fi>, Christian Lamparter <chunkeey@googlemail.com>
Subject: [RFC] mac80211: fix release_reorder_timeout in scan
Date: Thu, 23 Sep 2010 20:27:51 +0200	[thread overview]
Message-ID: <1285266471.3770.384.camel@jlt3.sipsolutions.net> (raw)

From: Johannes Berg <johannes.berg@intel.com>

Even if the reorder timeout timer fires while
scanning, the frames weren't received during
scanning and therefore shouldn't be dropped.
To implement this, changes to the passive scan
RX handler are necessary.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
Should we go for the frequency checks? Or just accept potential
off-channel RX like we used to for hw scan (we have to for hw scan since
hw scan might go back to operating channel on its own, and we don't even
stop queues)

 net/mac80211/rx.c |   28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

--- wireless-testing.orig/net/mac80211/rx.c	2010-09-23 16:13:40.000000000 +0200
+++ wireless-testing/net/mac80211/rx.c	2010-09-23 16:58:02.000000000 +0200
@@ -388,20 +388,20 @@ ieee80211_rx_h_passive_scan(struct ieee8
 {
 	struct ieee80211_local *local = rx->local;
 	struct sk_buff *skb = rx->skb;
+	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
+	ieee80211_rx_result ret;
 
-	if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning)))
-		return ieee80211_scan_rx(rx->sdata, skb);
-
-	if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning) &&
-		     (rx->flags & IEEE80211_RX_IN_SCAN))) {
-		/* drop all the other packets during a software scan anyway */
-		if (ieee80211_scan_rx(rx->sdata, skb) != RX_QUEUED)
-			dev_kfree_skb(skb);
-		return RX_QUEUED;
-	}
+	if (likely(!(rx->flags & IEEE80211_RX_IN_SCAN)))
+		return RX_CONTINUE;
 
-	if (unlikely(rx->flags & IEEE80211_RX_IN_SCAN)) {
-		/* scanning finished during invoking of handlers */
+	ret = ieee80211_scan_rx(rx->sdata, skb);
+	if (ret != RX_CONTINUE)
+		return ret;
+
+	if (status->freq != local->oper_channel->center_freq &&
+	    (!local->tmp_channel ||
+	     status->freq != local->tmp_channel->center_freq)) {
+		/* ignore scan channel RX */
 		I802_DEBUG_INC(local->rx_handlers_drop_passive_scan);
 		return RX_DROP_UNUSABLE;
 	}
@@ -2500,10 +2500,6 @@ void ieee80211_release_reorder_timeout(s
 	rx.queue = tid;
 	rx.flags |= IEEE80211_RX_RA_MATCH;
 
-	if (unlikely(test_bit(SCAN_HW_SCANNING, &sta->local->scanning) ||
-		     test_bit(SCAN_OFF_CHANNEL, &sta->local->scanning)))
-		rx.flags |= IEEE80211_RX_IN_SCAN;
-
 	spin_lock(&tid_agg_rx->reorder_lock);
 	ieee80211_sta_reorder_release(&sta->local->hw, tid_agg_rx, &frames);
 	spin_unlock(&tid_agg_rx->reorder_lock);



             reply	other threads:[~2010-09-23 18:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23 18:27 Johannes Berg [this message]
2010-09-27 18:14 ` [RFC] mac80211: fix release_reorder_timeout in scan Luis R. Rodriguez
2010-09-27 18:20   ` Johannes Berg
2010-09-27 18:49     ` Luis R. Rodriguez
2010-09-27 18:54       ` Johannes Berg
2010-09-27 19:03         ` Luis R. Rodriguez
2010-09-27 19:06           ` Johannes Berg
2010-09-27 19:09             ` Luis R. Rodriguez
2010-09-27 19:10               ` Johannes Berg
2010-09-27 19:12                 ` Luis R. Rodriguez
2010-09-27 22:34                   ` Matt Smith
2010-10-05 23:07                     ` Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1285266471.3770.384.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=chunkeey@googlemail.com \
    --cc=j@w1.fi \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).