Skip to contentSkip to conversation

mac80211: Support on-channel scan option.

RFC New [email protected] 1 participant 1 message Mar 31, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 mac80211: Support on-channel scan option.

From: Ben Greear <[email protected]>

This based on an idea posted by Stanislaw Gruszka, though I accept full blame for the implementation!

This is compile-tested only at this point.

The idea is to let users scan on the current operating channel without interrupting normal traffic more than absolutely necessary (changing power level might reset some hardware, for instance).

---
:100644 100644 d9798a3... b64d3c3... M net/mac80211/ieee80211_i.h
:100644 100644 1633648... 5bee3ea... M net/mac80211/main.c
:100644 100644 bcfe8c7... c4d7a50... M net/mac80211/rx.c
:100644 100644 c70e176... 591fdea... M net/mac80211/scan.c

 net/mac80211/ieee80211_i.h |    3 ++
 net/mac80211/main.c        |    4 ++-
 net/mac80211/rx.c          |    2 +
 net/mac80211/scan.c        |   80 ++++++++++++++++++++++++++++++-------------
 4 files changed, 64 insertions(+), 25 deletions(-)
net/mac80211/ieee80211_i.h +3 -0
index d9798a3..b64d3c3 100644
@@ -785,6 +785,8 @@ struct tpt_led_trigger {
  *	well be on the operating channel
  * @SCAN_HW_SCANNING: The hardware is scanning for us, we have no way to
  *	determine if we are on the operating channel or not
+ * @SCAN_ONCHANNEL_SCANNING:  Do a software scan on only the current operating
+ *	channel. This should not interrupt normal traffic.
  * @SCAN_COMPLETED: Set for our scan work function when the driver reported
  *	that the scan completed.
  * @SCAN_ABORTED: Set for our scan work function when the driver reported
@@ -793,6 +795,7 @@ struct tpt_led_trigger {
 enum {
 	SCAN_SW_SCANNING,
 	SCAN_HW_SCANNING,
+	SCAN_ONCHANNEL_SCANNING,
 	SCAN_COMPLETED,
 	SCAN_ABORTED,
 };
net/mac80211/main.c +3 -1
index 1633648..5bee3ea 100644
@@ -47,7 +47,8 @@ void ieee80211_configure_filter(struct ieee80211_local *local)
 	if (atomic_read(&local->iff_allmultis))
 		new_flags |= FIF_ALLMULTI;
 
-	if (local->monitors || test_bit(SCAN_SW_SCANNING, &local->scanning))
+	if (local->monitors || test_bit(SCAN_SW_SCANNING, &local->scanning) ||
+	    test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning))
 		new_flags |= FIF_BCN_PRBRESP_PROMISC;
 
 	if (local->fif_probe_req || local->probe_req_reg)
@@ -148,6 +149,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
 	}
 
 	if (test_bit(SCAN_SW_SCANNING, &local->scanning) ||
+	    test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning) ||
 	    test_bit(SCAN_HW_SCANNING, &local->scanning))
 		power = chan->max_power;
 	else
net/mac80211/rx.c +2 -0
index bcfe8c7..c4d7a50 100644
@@ -425,6 +425,7 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx)
 
 	if (test_bit(SCAN_HW_SCANNING, &local->scanning) ||
 	    test_bit(SCAN_SW_SCANNING, &local->scanning) ||
+	    test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning) ||
 	    local->sched_scanning)
 		return ieee80211_scan_rx(rx->sdata, skb);
 
@@ -2919,6 +2920,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
 		local->dot11ReceivedFragmentCount++;
 
 	if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning) ||
+		     test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning) ||
 		     test_bit(SCAN_SW_SCANNING, &local->scanning)))
 		status->rx_flags |= IEEE80211_RX_IN_SCAN;
 
net/mac80211/scan.c +56 -24

104 lines not on this page · raw message

Signature · 1 line
1.7.3.4