Skip to contentSkip to conversation

mac80211: Optimize scans on current operating channel.

PATCH Superseded [email protected] 1 participant 2 messages Jan 21, 2011

Subsystems (3)

v2 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mac80211: Optimize scans on current operating channel.

From: Ben Greear <[email protected]>

This should decrease un-necessary flushes, on/off channel work, and channel changes in cases where the only scanned channel is the current operating channel.

---

v2: Check channels instead of flag when determining if we should
do a channel change in scan_completed_finish.

:100644 100644 c47d7c0... 59fe5e7... M net/mac80211/ieee80211_i.h
:100644 100644 1236710... e6de0e7... M net/mac80211/rx.c
:100644 100644 3e660db... fa0aeb9... M net/mac80211/scan.c

 net/mac80211/ieee80211_i.h |    5 +++++
 net/mac80211/rx.c          |   11 ++++++++---
 net/mac80211/scan.c        |   41 +++++++++++++++++++++++++----------------
 3 files changed, 38 insertions(+), 19 deletions(-)
net/mac80211/ieee80211_i.h +5 -0
index c47d7c0..59fe5e7 100644
@@ -660,6 +660,10 @@ struct tpt_led_trigger {
  *	that the scan completed.
  * @SCAN_ABORTED: Set for our scan work function when the driver reported
  *	a scan complete for an aborted scan.
+ * @SCAN_LEFT_OPER_CHANNEL:  Set this flag if the scan process leaves the
+ *      operating channel at any time.  If scanning ONLY the current operating
+ *      channel this flag should not be set, and this will allow fewer
+ *      offchannel changes.
  */
 enum {
 	SCAN_SW_SCANNING,
@@ -667,6 +671,7 @@ enum {
 	SCAN_OFF_CHANNEL,
 	SCAN_COMPLETED,
 	SCAN_ABORTED,
+	SCAN_LEFT_OPER_CHANNEL,
 };
 
 /**
net/mac80211/rx.c +8 -3
index 1236710..e6de0e7 100644
@@ -388,6 +388,7 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx)
 	struct ieee80211_local *local = rx->local;
 	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb);
 	struct sk_buff *skb = rx->skb;
+	int ret;
 
 	if (likely(!(status->rx_flags & IEEE80211_RX_IN_SCAN)))
 		return RX_CONTINUE;
@@ -396,10 +397,14 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx)
 		return ieee80211_scan_rx(rx->sdata, skb);
 
 	if (test_bit(SCAN_SW_SCANNING, &local->scanning)) {
-		/* drop all the other packets during a software scan anyway */
-		if (ieee80211_scan_rx(rx->sdata, skb) != RX_QUEUED)
+		ret = ieee80211_scan_rx(rx->sdata, skb);
+		/* drop all the other packets while scanning off channel */
+		if (ret != RX_QUEUED &&
+		    test_bit(SCAN_OFF_CHANNEL, &local->scanning)) {
 			dev_kfree_skb(skb);
-		return RX_QUEUED;
+			return RX_QUEUED;
+		}
+		return ret;
 	}
 
 	/* scanning finished during invoking of handlers */
net/mac80211/scan.c +25 -16

92 lines not on this page · raw message

Signature · 1 line
1.7.2.3
author
#1 lore raw
Quoted 5 lines · On 01/21/2011 10:03 AM, [email protected] wrote:

From: Ben Greear<[email protected]>

This should decrease un-necessary flushes, on/off channel work, and channel changes in cases where the only scanned channel is the current operating channel.

Sorry..meant to send this to linux-wireless....

Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com