linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] implement background scan
@ 2009-07-23 10:13 Helmut Schaa
  2009-07-23 10:13 ` [PATCH 1/7] mac80211: refactor the scan code Helmut Schaa
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 10:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, johannes

This patch series implements basic background scanning in mac80211
by interrupting the scan after each scanned channel to allow RX/TX.

I only tested the patches on current wireless-testing with iwlagn
in sw-scan mode and it works fine already. Nevertheless, it would
be great if somebody could test the patches on other hardware as well.

A scan now takes ~13s on my iwl4965 with a total of 31 channels
(17 passive channels) while associated. Two possibilities for the
future to reduce the time a scan takes:
- leave the operating channel as soon as RX and TX were idle for
  a small period of time (currently we just stay 250ms on the
  operating channel after each scanned channel).
- Scan multiple channels in a row if the qos latency allows us to
  do so.

Helmut
---

Helmut Schaa (7):
      cfg80211: increase scan result expire time
      mac80211: rename scan_state to next_scan_state
      mac80211: implement basic background scanning
      mac80211: Replace {sw,hw}_scanning variables with a bitfield
      mac80211: introduce a new scan state "decision"
      mac80211: advance the state machine immediately if no delay is needed
      mac80211: refactor the scan code


 net/mac80211/ibss.c        |    2 
 net/mac80211/ieee80211_i.h |   41 ++++++
 net/mac80211/iface.c       |    4 -
 net/mac80211/main.c        |    2 
 net/mac80211/mesh.c        |    2 
 net/mac80211/mlme.c        |    8 +
 net/mac80211/rx.c          |    8 +
 net/mac80211/scan.c        |  300 ++++++++++++++++++++++++++++++++------------
 net/mac80211/tx.c          |    6 -
 net/wireless/scan.c        |    2 
 10 files changed, 275 insertions(+), 100 deletions(-)

-- 
Signature

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/7] mac80211: refactor the scan code
  2009-07-23 10:13 [PATCH 0/7] implement background scan Helmut Schaa
@ 2009-07-23 10:13 ` Helmut Schaa
  2009-07-23 10:36   ` Johannes Berg
  2009-07-23 10:13 ` [PATCH 2/7] mac80211: advance the state machine immediately if no delay is needed Helmut Schaa
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 10:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, johannes

Move the processing of each scan state into its own functions for better
readability. This patch does not introduce functional changes.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---

 net/mac80211/scan.c |  136 +++++++++++++++++++++++++++++----------------------
 1 files changed, 78 insertions(+), 58 deletions(-)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 7482065..71500f1 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -474,13 +474,87 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 	return rc;
 }
 
+static int ieee80211_scan_state_set_channel(struct ieee80211_local *local,
+					    unsigned long *next_delay)
+{
+	int skip;
+	struct ieee80211_channel *chan;
+	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
+
+	/* if no more bands/channels left, complete scan */
+	if (local->scan_channel_idx >= local->scan_req->n_channels) {
+		ieee80211_scan_completed(&local->hw, false);
+		return 1;
+	}
+	skip = 0;
+	chan = local->scan_req->channels[local->scan_channel_idx];
+
+	if (chan->flags & IEEE80211_CHAN_DISABLED ||
+	    (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
+	     chan->flags & IEEE80211_CHAN_NO_IBSS))
+		skip = 1;
+
+	if (!skip) {
+		local->scan_channel = chan;
+		if (ieee80211_hw_config(local,
+					IEEE80211_CONF_CHANGE_CHANNEL))
+			skip = 1;
+	}
+
+	/* advance state machine to next channel/band */
+	local->scan_channel_idx++;
+
+	if (skip)
+		return 0;
+
+	/*
+	 * Probe delay is used to update the NAV, cf. 11.1.3.2.2
+	 * (which unfortunately doesn't say _why_ step a) is done,
+	 * but it waits for the probe delay or until a frame is
+	 * received - and the received frame would update the NAV).
+	 * For now, we do not support waiting until a frame is
+	 * received.
+	 *
+	 * In any case, it is not necessary for a passive scan.
+	 */
+	if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
+	    !local->scan_req->n_ssids) {
+		*next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
+		return 0;
+	}
+
+	*next_delay = IEEE80211_PROBE_DELAY;
+	local->scan_state = SCAN_SEND_PROBE;
+
+	return 0;
+}
+
+static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
+					    unsigned long *next_delay)
+{
+	int i;
+	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
+
+	for (i = 0; i < local->scan_req->n_ssids; i++)
+		ieee80211_send_probe_req(
+			sdata, NULL,
+			local->scan_req->ssids[i].ssid,
+			local->scan_req->ssids[i].ssid_len,
+			local->scan_req->ie, local->scan_req->ie_len);
+
+	/*
+	 * After sending probe requests, wait for probe responses
+	 * on the channel.
+	 */
+	*next_delay = IEEE80211_CHANNEL_TIME;
+	local->scan_state = SCAN_SET_CHANNEL;
+}
+
 void ieee80211_scan_work(struct work_struct *work)
 {
 	struct ieee80211_local *local =
 		container_of(work, struct ieee80211_local, scan_work.work);
 	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
-	struct ieee80211_channel *chan;
-	int skip, i;
 	unsigned long next_delay = 0;
 
 	mutex_lock(&local->scan_mtx);
@@ -515,65 +589,11 @@ void ieee80211_scan_work(struct work_struct *work)
 
 	switch (local->scan_state) {
 	case SCAN_SET_CHANNEL:
-		/* if no more bands/channels left, complete scan */
-		if (local->scan_channel_idx >= local->scan_req->n_channels) {
-			ieee80211_scan_completed(&local->hw, false);
+		if (ieee80211_scan_state_set_channel(local, &next_delay))
 			return;
-		}
-		skip = 0;
-		chan = local->scan_req->channels[local->scan_channel_idx];
-
-		if (chan->flags & IEEE80211_CHAN_DISABLED ||
-		    (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
-		     chan->flags & IEEE80211_CHAN_NO_IBSS))
-			skip = 1;
-
-		if (!skip) {
-			local->scan_channel = chan;
-			if (ieee80211_hw_config(local,
-						IEEE80211_CONF_CHANGE_CHANNEL))
-				skip = 1;
-		}
-
-		/* advance state machine to next channel/band */
-		local->scan_channel_idx++;
-
-		if (skip)
-			break;
-
-		/*
-		 * Probe delay is used to update the NAV, cf. 11.1.3.2.2
-		 * (which unfortunately doesn't say _why_ step a) is done,
-		 * but it waits for the probe delay or until a frame is
-		 * received - and the received frame would update the NAV).
-		 * For now, we do not support waiting until a frame is
-		 * received.
-		 *
-		 * In any case, it is not necessary for a passive scan.
-		 */
-		if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
-		    !local->scan_req->n_ssids) {
-			next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
-			break;
-		}
-
-		next_delay = IEEE80211_PROBE_DELAY;
-		local->scan_state = SCAN_SEND_PROBE;
 		break;
 	case SCAN_SEND_PROBE:
-		for (i = 0; i < local->scan_req->n_ssids; i++)
-			ieee80211_send_probe_req(
-				sdata, NULL,
-				local->scan_req->ssids[i].ssid,
-				local->scan_req->ssids[i].ssid_len,
-				local->scan_req->ie, local->scan_req->ie_len);
-
-		/*
-		 * After sending probe requests, wait for probe responses
-		 * on the channel.
-		 */
-		next_delay = IEEE80211_CHANNEL_TIME;
-		local->scan_state = SCAN_SET_CHANNEL;
+		ieee80211_scan_state_send_probe(local, &next_delay);
 		break;
 	}
 


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/7] mac80211: advance the state machine immediately if no delay is needed
  2009-07-23 10:13 [PATCH 0/7] implement background scan Helmut Schaa
  2009-07-23 10:13 ` [PATCH 1/7] mac80211: refactor the scan code Helmut Schaa
@ 2009-07-23 10:13 ` Helmut Schaa
  2009-07-23 10:36   ` Johannes Berg
  2009-07-23 10:13 ` [PATCH 3/7] mac80211: introduce a new scan state "decision" Helmut Schaa
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 10:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, johannes

Instead of queueing the scan work again without delay just process the
next state immediately.
    
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---

 net/mac80211/scan.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 71500f1..db122e4 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -587,15 +587,21 @@ void ieee80211_scan_work(struct work_struct *work)
 		return;
 	}
 
-	switch (local->scan_state) {
-	case SCAN_SET_CHANNEL:
-		if (ieee80211_scan_state_set_channel(local, &next_delay))
-			return;
-		break;
-	case SCAN_SEND_PROBE:
-		ieee80211_scan_state_send_probe(local, &next_delay);
-		break;
-	}
+	/*
+	 * as long as no delay is required advance immediately
+	 * without scheduling a new work
+	 */
+	do {
+		switch (local->scan_state) {
+		case SCAN_SET_CHANNEL:
+			if (ieee80211_scan_state_set_channel(local, &next_delay))
+				return;
+			break;
+		case SCAN_SEND_PROBE:
+			ieee80211_scan_state_send_probe(local, &next_delay);
+			break;
+		}
+	} while (next_delay == 0);
 
 	queue_delayed_work(local->hw.workqueue, &local->scan_work,
 			   next_delay);


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/7] mac80211: introduce a new scan state "decision"
  2009-07-23 10:13 [PATCH 0/7] implement background scan Helmut Schaa
  2009-07-23 10:13 ` [PATCH 1/7] mac80211: refactor the scan code Helmut Schaa
  2009-07-23 10:13 ` [PATCH 2/7] mac80211: advance the state machine immediately if no delay is needed Helmut Schaa
@ 2009-07-23 10:13 ` Helmut Schaa
  2009-07-23 10:37   ` Johannes Berg
  2009-07-23 10:14 ` [PATCH 4/7] mac80211: Replace {sw, hw}_scanning variables with a bitfield Helmut Schaa
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 10:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, johannes

Introduce a new scan state "decision" which is entered after
every completed scan operation and decides about the next steps.
At first the decision is in any case to scan the next channel.
This shouldn't introduce any functional changes.
    
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---

 net/mac80211/ieee80211_i.h |    2 +-
 net/mac80211/scan.c        |   40 ++++++++++++++++++++++++++--------------
 2 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 6a01771..4166418 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -678,7 +678,7 @@ struct ieee80211_local {
 	int scan_channel_idx;
 	int scan_ies_len;
 
-	enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
+	enum { SCAN_DECISION, SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
 	struct delayed_work scan_work;
 	struct ieee80211_sub_if_data *scan_sdata;
 	enum nl80211_channel_type oper_channel_type;
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index db122e4..48f910a 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -376,7 +376,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
 	}
 	mutex_unlock(&local->iflist_mtx);
 
-	local->scan_state = SCAN_SET_CHANNEL;
+	local->scan_state = SCAN_DECISION;
 	local->scan_channel_idx = 0;
 
 	spin_lock_bh(&local->filter_lock);
@@ -474,18 +474,27 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 	return rc;
 }
 
-static int ieee80211_scan_state_set_channel(struct ieee80211_local *local,
-					    unsigned long *next_delay)
+static int ieee80211_scan_state_decision(struct ieee80211_local *local,
+					 unsigned long *next_delay)
 {
-	int skip;
-	struct ieee80211_channel *chan;
-	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
-
 	/* if no more bands/channels left, complete scan */
 	if (local->scan_channel_idx >= local->scan_req->n_channels) {
 		ieee80211_scan_completed(&local->hw, false);
 		return 1;
 	}
+
+	*next_delay = 0;
+	local->scan_state = SCAN_SET_CHANNEL;
+	return 0;
+}
+
+static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
+					     unsigned long *next_delay)
+{
+	int skip;
+	struct ieee80211_channel *chan;
+	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
+
 	skip = 0;
 	chan = local->scan_req->channels[local->scan_channel_idx];
 
@@ -505,7 +514,7 @@ static int ieee80211_scan_state_set_channel(struct ieee80211_local *local,
 	local->scan_channel_idx++;
 
 	if (skip)
-		return 0;
+		return;
 
 	/*
 	 * Probe delay is used to update the NAV, cf. 11.1.3.2.2
@@ -520,13 +529,13 @@ static int ieee80211_scan_state_set_channel(struct ieee80211_local *local,
 	if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
 	    !local->scan_req->n_ssids) {
 		*next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
-		return 0;
+		local->scan_state = SCAN_DECISION;
+		return;
 	}
 
+	/* active scan, send probes */
 	*next_delay = IEEE80211_PROBE_DELAY;
 	local->scan_state = SCAN_SEND_PROBE;
-
-	return 0;
 }
 
 static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
@@ -547,7 +556,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
 	 * on the channel.
 	 */
 	*next_delay = IEEE80211_CHANNEL_TIME;
-	local->scan_state = SCAN_SET_CHANNEL;
+	local->scan_state = SCAN_DECISION;
 }
 
 void ieee80211_scan_work(struct work_struct *work)
@@ -593,10 +602,13 @@ void ieee80211_scan_work(struct work_struct *work)
 	 */
 	do {
 		switch (local->scan_state) {
-		case SCAN_SET_CHANNEL:
-			if (ieee80211_scan_state_set_channel(local, &next_delay))
+		case SCAN_DECISION:
+			if (ieee80211_scan_state_decision(local, &next_delay))
 				return;
 			break;
+		case SCAN_SET_CHANNEL:
+			ieee80211_scan_state_set_channel(local, &next_delay);
+			break;
 		case SCAN_SEND_PROBE:
 			ieee80211_scan_state_send_probe(local, &next_delay);
 			break;


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/7] mac80211: Replace {sw, hw}_scanning variables with a bitfield
  2009-07-23 10:13 [PATCH 0/7] implement background scan Helmut Schaa
                   ` (2 preceding siblings ...)
  2009-07-23 10:13 ` [PATCH 3/7] mac80211: introduce a new scan state "decision" Helmut Schaa
@ 2009-07-23 10:14 ` Helmut Schaa
  2009-07-23 10:38   ` Johannes Berg
  2009-07-23 10:14 ` [PATCH 5/7] mac80211: implement basic background scanning Helmut Schaa
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 10:14 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, johannes

Use a bitfield to store the current scan mode instead of two boolean
variables {sw,hw}_scanning. This patch does not introduce functional
changes but allows us to enhance the scan flags later (for example
for background scanning).
    
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---

 net/mac80211/ibss.c        |    2 +-
 net/mac80211/ieee80211_i.h |    7 ++++++-
 net/mac80211/iface.c       |    4 ++--
 net/mac80211/main.c        |    2 +-
 net/mac80211/mesh.c        |    2 +-
 net/mac80211/mlme.c        |    8 ++++----
 net/mac80211/rx.c          |    6 +++---
 net/mac80211/scan.c        |   23 ++++++++++-------------
 net/mac80211/tx.c          |    6 +++---
 9 files changed, 31 insertions(+), 29 deletions(-)

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 8e22200..6e3cca6 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -742,7 +742,7 @@ static void ieee80211_ibss_work(struct work_struct *work)
 	if (!netif_running(sdata->dev))
 		return;
 
-	if (local->sw_scanning || local->hw_scanning)
+	if (local->scanning)
 		return;
 
 	if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_ADHOC))
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 4166418..783a125 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -570,6 +570,11 @@ enum queue_stop_reason {
 	IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
 };
 
+enum {
+	SCAN_SW_SCANNING,
+	SCAN_HW_SCANNING
+};
+
 struct ieee80211_local {
 	/* embed the driver visible part.
 	 * don't cast (use the static inlines below), but we keep
@@ -668,7 +673,7 @@ struct ieee80211_local {
 
 	/* Scanning and BSS list */
 	struct mutex scan_mtx;
-	bool sw_scanning, hw_scanning;
+	unsigned long scanning;
 	struct cfg80211_ssid scan_ssid;
 	struct cfg80211_scan_request int_scan_req;
 	struct cfg80211_scan_request *scan_req;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 2f797a8..ee9cede 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -515,7 +515,7 @@ static int ieee80211_stop(struct net_device *dev)
 			 * the scan_sdata is NULL already don't send out a
 			 * scan event to userspace -- the scan is incomplete.
 			 */
-			if (local->sw_scanning)
+			if (test_bit(SCAN_SW_SCANNING, &local->scanning))
 				ieee80211_scan_completed(&local->hw, true);
 		}
 
@@ -905,7 +905,7 @@ u32 __ieee80211_recalc_idle(struct ieee80211_local *local)
 	struct ieee80211_sub_if_data *sdata;
 	int count = 0;
 
-	if (local->hw_scanning || local->sw_scanning)
+	if (local->scanning)
 		return ieee80211_idle_off(local, "scanning");
 
 	list_for_each_entry(sdata, &local->interfaces, list) {
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 3234f37..6d7b4cd 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -198,7 +198,7 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
 	}
 
 	if (changed & BSS_CHANGED_BEACON_ENABLED) {
-		if (local->sw_scanning) {
+		if (test_bit(SCAN_SW_SCANNING, &local->scanning)) {
 			sdata->vif.bss_conf.enable_beacon = false;
 		} else {
 			/*
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 8a97b14..9a38269 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -597,7 +597,7 @@ static void ieee80211_mesh_work(struct work_struct *work)
 	if (!netif_running(sdata->dev))
 		return;
 
-	if (local->sw_scanning || local->hw_scanning)
+	if (local->scanning)
 		return;
 
 	while ((skb = skb_dequeue(&ifmsh->skb_queue)))
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 523c0d9..52b6f83 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -581,7 +581,7 @@ void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
 	if (!ifmgd->associated)
 		return;
 
-	if (sdata->local->sw_scanning || sdata->local->hw_scanning)
+	if (sdata->local->scanning)
 		return;
 
 	/* Disregard subsequent beacons if we are already running a timer
@@ -639,7 +639,7 @@ static void ieee80211_enable_ps(struct ieee80211_local *local,
 	 * If we are scanning right now then the parameters will
 	 * take effect when scan finishes.
 	 */
-	if (local->hw_scanning || local->sw_scanning)
+	if (local->scanning)
 		return;
 
 	if (conf->dynamic_ps_timeout > 0 &&
@@ -2038,7 +2038,7 @@ static void ieee80211_sta_work(struct work_struct *work)
 	if (!netif_running(sdata->dev))
 		return;
 
-	if (local->sw_scanning || local->hw_scanning)
+	if (local->scanning)
 		return;
 
 	if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION))
@@ -2213,7 +2213,7 @@ static void ieee80211_sta_monitor_work(struct work_struct *work)
 		container_of(work, struct ieee80211_sub_if_data,
 			     u.mgd.monitor_work);
 
-	if (sdata->local->sw_scanning || sdata->local->hw_scanning)
+	if (sdata->local->scanning)
 		return;
 
 	ieee80211_mgd_probe_ap(sdata, false);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 66c797c..b1bebc1 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -418,10 +418,10 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx)
 	struct ieee80211_local *local = rx->local;
 	struct sk_buff *skb = rx->skb;
 
-	if (unlikely(local->hw_scanning))
+	if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning)))
 		return ieee80211_scan_rx(rx->sdata, skb);
 
-	if (unlikely(local->sw_scanning)) {
+	if (unlikely(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)
 			dev_kfree_skb(skb);
@@ -2136,7 +2136,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
 		return;
 	}
 
-	if (unlikely(local->sw_scanning || local->hw_scanning))
+	if (unlikely(local->scanning))
 		rx.flags |= IEEE80211_RX_IN_SCAN;
 
 	ieee80211_parse_qos(&rx);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 48f910a..4233c3d 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -265,7 +265,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
 
 	mutex_lock(&local->scan_mtx);
 
-	if (WARN_ON(!local->hw_scanning && !local->sw_scanning)) {
+	if (WARN_ON(!local->scanning)) {
 		mutex_unlock(&local->scan_mtx);
 		return;
 	}
@@ -275,16 +275,15 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
 		return;
 	}
 
-	if (local->hw_scanning)
+	if (test_bit(SCAN_HW_SCANNING, &local->scanning))
 		ieee80211_restore_scan_ies(local);
 
 	if (local->scan_req != &local->int_scan_req)
 		cfg80211_scan_done(local->scan_req, aborted);
 	local->scan_req = NULL;
 
-	was_hw_scan = local->hw_scanning;
-	local->hw_scanning = false;
-	local->sw_scanning = false;
+	was_hw_scan = test_bit(SCAN_HW_SCANNING, &local->scanning);
+	local->scanning = 0;
 	local->scan_channel = NULL;
 
 	/* we only have to protect scan_req and hw/sw scan */
@@ -434,9 +433,9 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 	}
 
 	if (local->ops->hw_scan)
-		local->hw_scanning = true;
+		__set_bit(SCAN_HW_SCANNING, &local->scanning);
 	else
-		local->sw_scanning = true;
+		__set_bit(SCAN_SW_SCANNING, &local->scanning);
 	/*
 	 * Kicking off the scan need not be protected,
 	 * only the scan variable stuff, since now
@@ -459,11 +458,9 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 	mutex_lock(&local->scan_mtx);
 
 	if (rc) {
-		if (local->ops->hw_scan) {
-			local->hw_scanning = false;
+		if (local->ops->hw_scan)
 			ieee80211_restore_scan_ies(local);
-		} else
-			local->sw_scanning = false;
+		local->scanning = 0;
 
 		ieee80211_recalc_idle(local);
 
@@ -572,7 +569,7 @@ void ieee80211_scan_work(struct work_struct *work)
 		return;
 	}
 
-	if (local->scan_req && !(local->sw_scanning || local->hw_scanning)) {
+	if (local->scan_req && !local->scanning) {
 		struct cfg80211_scan_request *req = local->scan_req;
 		int rc;
 
@@ -663,7 +660,7 @@ void ieee80211_scan_cancel(struct ieee80211_local *local)
 	 * queued -- mostly at suspend under RTNL.
 	 */
 	mutex_lock(&local->scan_mtx);
-	swscan = local->sw_scanning;
+	swscan = test_bit(SCAN_SW_SCANNING, &local->scanning);
 	mutex_unlock(&local->scan_mtx);
 
 	if (swscan)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index c11cbbd..61739ab 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -192,7 +192,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx)
 	if (unlikely(info->flags & IEEE80211_TX_CTL_INJECTED))
 		return TX_CONTINUE;
 
-	if (unlikely(tx->local->sw_scanning) &&
+	if (unlikely(test_bit(SCAN_SW_SCANNING, &tx->local->scanning)) &&
 	    !ieee80211_is_probe_req(hdr->frame_control) &&
 	    !ieee80211_is_nullfunc(hdr->frame_control))
 		/*
@@ -551,7 +551,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
 	 * Lets not bother rate control if we're associated and cannot
 	 * talk to the sta. This should not happen.
 	 */
-	if (WARN((tx->local->sw_scanning) &&
+	if (WARN(test_bit(SCAN_SW_SCANNING, &tx->local->scanning) &&
 		 (sta_flags & WLAN_STA_ASSOC) &&
 		 !rate_usable_index_exists(sband, &tx->sta->sta),
 		 "%s: Dropped data frame as no usable bitrate found while "
@@ -1396,7 +1396,7 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
 
 	if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) &&
 	    local->hw.conf.dynamic_ps_timeout > 0 &&
-	    !local->sw_scanning && !local->hw_scanning && local->ps_sdata) {
+	    !(local->scanning) && local->ps_sdata) {
 		if (local->hw.conf.flags & IEEE80211_CONF_PS) {
 			ieee80211_stop_queues_by_reason(&local->hw,
 					IEEE80211_QUEUE_STOP_REASON_PS);


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/7] mac80211: implement basic background scanning
  2009-07-23 10:13 [PATCH 0/7] implement background scan Helmut Schaa
                   ` (3 preceding siblings ...)
  2009-07-23 10:14 ` [PATCH 4/7] mac80211: Replace {sw, hw}_scanning variables with a bitfield Helmut Schaa
@ 2009-07-23 10:14 ` Helmut Schaa
  2009-07-23 10:39   ` Johannes Berg
  2009-07-23 11:18   ` [PATCH v2 " Helmut Schaa
  2009-07-23 10:14 ` [PATCH 6/7] mac80211: rename scan_state to next_scan_state Helmut Schaa
  2009-07-23 10:14 ` [PATCH 7/7] cfg80211: increase scan result expire time Helmut Schaa
  6 siblings, 2 replies; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 10:14 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, johannes

Introduce a new scan flag "SCAN_BG_SCANNING" which basically tells us
that we are currently scanning but may as well be on the operating channel
to RX/TX data whereas "SCAN_SW_SCANNING" tells us that we are currently
on a different channel for scanning. While "SCAN_BG_SCANNING" is set
during the whole scan "SCAN_SW_SCANNING" is set when leaving the operating
channel and unset when coming back.
    
Introduce two new scan states "SCAN_LEAVE_OPER_CHANNEL" and
"SCAN_ENTER_OPER_CHANNEL" which basically implement the functionality we
need to leave the operating channel (send a nullfunc to the AP and stop
the queues) and enter it again (send a nullfunc to the AP and start the
queues again).
    
Enhance the scan state "SCAN_DECISION" to switch back to the operating
channel after each scanned channel. In the future it sould be simple
to enhance the decision state to scan as much channels in a row as the
qos latency allows us.
    
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---

 net/mac80211/ieee80211_i.h |   36 +++++++++++++-
 net/mac80211/rx.c          |    6 ++
 net/mac80211/scan.c        |  117 +++++++++++++++++++++++++++++++++++++++++---
 net/mac80211/tx.c          |    2 -
 4 files changed, 148 insertions(+), 13 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 783a125..efda19e 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -570,9 +570,41 @@ enum queue_stop_reason {
 	IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
 };
 
+/**
+ * mac80211 scan flags - currently active scan mode
+ *
+ * @SCAN_SW_SCANNING: We're currently in the process of scanning but may as
+ *	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_OFF_CHANNEL: We're off our operating channel for scanning,
+ *	gets only set in conjunction with SCAN_SW_SCANNING
+ */
 enum {
 	SCAN_SW_SCANNING,
-	SCAN_HW_SCANNING
+	SCAN_HW_SCANNING,
+	SCAN_OFF_CHANNEL,
+};
+
+/**
+ * enum mac80211_scan_state - scan state machine states
+ *
+ * @SCAN_DECISION: Main entry point to the scan state machine, this state
+ *	determines if we should keep on scanning or switch back to the
+ *	operating channel
+ * @SCAN_SET_CHANNEL: Set the next channel to be scanned
+ * @SCAN_SEND_PROBE: Send probe requests and wait for probe responses
+ * @SCAN_LEAVE_OPER_CHANNEL: Leave the operating channel, notify the AP
+ *	about us leaving the channel and stop all associated STA interfaces
+ * @SCAN_ENTER_OPER_CHANNEL: Enter the operating channel again, notify the
+ *	AP about us being back and restart all associated STA interfaces
+ */
+enum mac80211_scan_state {
+	SCAN_DECISION,
+	SCAN_SET_CHANNEL,
+	SCAN_SEND_PROBE,
+	SCAN_LEAVE_OPER_CHANNEL,
+	SCAN_ENTER_OPER_CHANNEL,
 };
 
 struct ieee80211_local {
@@ -683,7 +715,7 @@ struct ieee80211_local {
 	int scan_channel_idx;
 	int scan_ies_len;
 
-	enum { SCAN_DECISION, SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
+	enum mac80211_scan_state scan_state;
 	struct delayed_work scan_work;
 	struct ieee80211_sub_if_data *scan_sdata;
 	enum nl80211_channel_type oper_channel_type;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b1bebc1..dd192b3 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -421,7 +421,8 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx)
 	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))) {
+	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);
@@ -2136,7 +2137,8 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
 		return;
 	}
 
-	if (unlikely(local->scanning))
+	if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning) ||
+		     test_bit(SCAN_OFF_CHANNEL, &local->scanning)))
 		rx.flags |= IEEE80211_RX_IN_SCAN;
 
 	ieee80211_parse_qos(&rx);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 4233c3d..d56b9da 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -365,12 +365,11 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
 			ieee80211_bss_info_change_notify(
 				sdata, BSS_CHANGED_BEACON_ENABLED);
 
-		if (sdata->vif.type == NL80211_IFTYPE_STATION) {
-			if (sdata->u.mgd.associated) {
-				netif_tx_stop_all_queues(sdata->dev);
-				ieee80211_scan_ps_enable(sdata);
-			}
-		} else
+		/*
+		 * only handle non-STA interfaces here, STA interfaces
+		 * are handled in the scan state machine
+		 */
+		if (sdata->vif.type != NL80211_IFTYPE_STATION)
 			netif_tx_stop_all_queues(sdata->dev);
 	}
 	mutex_unlock(&local->iflist_mtx);
@@ -474,17 +473,113 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 static int ieee80211_scan_state_decision(struct ieee80211_local *local,
 					 unsigned long *next_delay)
 {
-	/* if no more bands/channels left, complete scan */
+	bool associated = false;
+	struct ieee80211_sub_if_data *sdata;
+
+	/* if no more bands/channels left, complete scan and advance to the idle state */
 	if (local->scan_channel_idx >= local->scan_req->n_channels) {
 		ieee80211_scan_completed(&local->hw, false);
 		return 1;
 	}
 
+	/* check if at least one STA interface is associated */
+	mutex_lock(&local->iflist_mtx);
+	list_for_each_entry(sdata, &local->interfaces, list) {
+		if (!netif_running(sdata->dev))
+			continue;
+
+		if (sdata->vif.type == NL80211_IFTYPE_STATION) {
+			if (sdata->u.mgd.associated) {
+				associated = true;
+				break;
+			}
+		}
+	}
+	mutex_unlock(&local->iflist_mtx);
+
+	if (local->scan_channel) {
+		/*
+		 * we're currently scanning a different channel, let's
+		 * switch back to the operating channel now if at least
+		 * one interface is associated. Otherwise just scan the
+		 * next channel
+		 */
+		if (associated)
+			local->scan_state = SCAN_ENTER_OPER_CHANNEL;
+		else
+			local->scan_state = SCAN_SET_CHANNEL;
+	} else {
+		/*
+		 * we're on the operating channel currently, let's
+		 * leave that channel now to scan another one
+		 */
+		local->scan_state = SCAN_LEAVE_OPER_CHANNEL;
+	}
+
 	*next_delay = 0;
-	local->scan_state = SCAN_SET_CHANNEL;
 	return 0;
 }
 
+static void ieee80211_scan_state_leave_oper_channel(struct ieee80211_local *local,
+						    unsigned long *next_delay)
+{
+	struct ieee80211_sub_if_data *sdata;
+
+	/*
+	 * notify the AP about us leaving the channel and stop all STA interfaces
+	 */
+	mutex_lock(&local->iflist_mtx);
+	list_for_each_entry(sdata, &local->interfaces, list) {
+		if (!netif_running(sdata->dev))
+			continue;
+
+		if (sdata->vif.type == NL80211_IFTYPE_STATION) {
+			netif_tx_stop_all_queues(sdata->dev);
+			if (sdata->u.mgd.associated)
+				ieee80211_scan_ps_enable(sdata);
+		}
+	}
+	mutex_unlock(&local->iflist_mtx);
+
+	__set_bit(SCAN_OFF_CHANNEL, &local->scanning);
+
+	/* advance to the next channel to be scanned */
+	*next_delay = HZ / 10;
+	local->scan_state = SCAN_SET_CHANNEL;
+}
+
+static void ieee80211_scan_state_enter_oper_channel(struct ieee80211_local *local,
+						    unsigned long *next_delay)
+{
+	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
+
+	/* switch back to the operating channel */
+	local->scan_channel = NULL;
+	ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
+
+	/*
+	 * notify the AP about us being back and restart all STA interfaces
+	 */
+	mutex_lock(&local->iflist_mtx);
+	list_for_each_entry(sdata, &local->interfaces, list) {
+		if (!netif_running(sdata->dev))
+			continue;
+
+		/* Tell AP we're back */
+		if (sdata->vif.type == NL80211_IFTYPE_STATION) {
+			if (sdata->u.mgd.associated)
+				ieee80211_scan_ps_disable(sdata);
+			netif_tx_wake_all_queues(sdata->dev);
+		}
+	}
+	mutex_unlock(&local->iflist_mtx);
+
+	__clear_bit(SCAN_OFF_CHANNEL, &local->scanning);
+
+	*next_delay = HZ / 5;
+	local->scan_state = SCAN_DECISION;
+}
+
 static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
 					     unsigned long *next_delay)
 {
@@ -609,6 +704,12 @@ void ieee80211_scan_work(struct work_struct *work)
 		case SCAN_SEND_PROBE:
 			ieee80211_scan_state_send_probe(local, &next_delay);
 			break;
+		case SCAN_LEAVE_OPER_CHANNEL:
+			ieee80211_scan_state_leave_oper_channel(local, &next_delay);
+			break;
+		case SCAN_ENTER_OPER_CHANNEL:
+			ieee80211_scan_state_enter_oper_channel(local, &next_delay);
+			break;
 		}
 	} while (next_delay == 0);
 
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 61739ab..275bc15 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -192,7 +192,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx)
 	if (unlikely(info->flags & IEEE80211_TX_CTL_INJECTED))
 		return TX_CONTINUE;
 
-	if (unlikely(test_bit(SCAN_SW_SCANNING, &tx->local->scanning)) &&
+	if (unlikely(test_bit(SCAN_OFF_CHANNEL, &tx->local->scanning)) &&
 	    !ieee80211_is_probe_req(hdr->frame_control) &&
 	    !ieee80211_is_nullfunc(hdr->frame_control))
 		/*


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 6/7] mac80211: rename scan_state to next_scan_state
  2009-07-23 10:13 [PATCH 0/7] implement background scan Helmut Schaa
                   ` (4 preceding siblings ...)
  2009-07-23 10:14 ` [PATCH 5/7] mac80211: implement basic background scanning Helmut Schaa
@ 2009-07-23 10:14 ` Helmut Schaa
  2009-07-23 10:39   ` Johannes Berg
  2009-07-23 10:14 ` [PATCH 7/7] cfg80211: increase scan result expire time Helmut Schaa
  6 siblings, 1 reply; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 10:14 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, johannes

Rename scan_state to next_scan_state to better reflect
what it is used for.
    
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---

 net/mac80211/ieee80211_i.h |    2 +-
 net/mac80211/scan.c        |   20 ++++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index efda19e..c6b25cb 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -715,7 +715,7 @@ struct ieee80211_local {
 	int scan_channel_idx;
 	int scan_ies_len;
 
-	enum mac80211_scan_state scan_state;
+	enum mac80211_scan_state next_scan_state;
 	struct delayed_work scan_work;
 	struct ieee80211_sub_if_data *scan_sdata;
 	enum nl80211_channel_type oper_channel_type;
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index d56b9da..b376775 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -374,7 +374,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
 	}
 	mutex_unlock(&local->iflist_mtx);
 
-	local->scan_state = SCAN_DECISION;
+	local->next_scan_state = SCAN_DECISION;
 	local->scan_channel_idx = 0;
 
 	spin_lock_bh(&local->filter_lock);
@@ -505,15 +505,15 @@ static int ieee80211_scan_state_decision(struct ieee80211_local *local,
 		 * next channel
 		 */
 		if (associated)
-			local->scan_state = SCAN_ENTER_OPER_CHANNEL;
+			local->next_scan_state = SCAN_ENTER_OPER_CHANNEL;
 		else
-			local->scan_state = SCAN_SET_CHANNEL;
+			local->next_scan_state = SCAN_SET_CHANNEL;
 	} else {
 		/*
 		 * we're on the operating channel currently, let's
 		 * leave that channel now to scan another one
 		 */
-		local->scan_state = SCAN_LEAVE_OPER_CHANNEL;
+		local->next_scan_state = SCAN_LEAVE_OPER_CHANNEL;
 	}
 
 	*next_delay = 0;
@@ -545,7 +545,7 @@ static void ieee80211_scan_state_leave_oper_channel(struct ieee80211_local *loca
 
 	/* advance to the next channel to be scanned */
 	*next_delay = HZ / 10;
-	local->scan_state = SCAN_SET_CHANNEL;
+	local->next_scan_state = SCAN_SET_CHANNEL;
 }
 
 static void ieee80211_scan_state_enter_oper_channel(struct ieee80211_local *local,
@@ -577,7 +577,7 @@ static void ieee80211_scan_state_enter_oper_channel(struct ieee80211_local *loca
 	__clear_bit(SCAN_OFF_CHANNEL, &local->scanning);
 
 	*next_delay = HZ / 5;
-	local->scan_state = SCAN_DECISION;
+	local->next_scan_state = SCAN_DECISION;
 }
 
 static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
@@ -621,13 +621,13 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
 	if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
 	    !local->scan_req->n_ssids) {
 		*next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
-		local->scan_state = SCAN_DECISION;
+		local->next_scan_state = SCAN_DECISION;
 		return;
 	}
 
 	/* active scan, send probes */
 	*next_delay = IEEE80211_PROBE_DELAY;
-	local->scan_state = SCAN_SEND_PROBE;
+	local->next_scan_state = SCAN_SEND_PROBE;
 }
 
 static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
@@ -648,7 +648,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
 	 * on the channel.
 	 */
 	*next_delay = IEEE80211_CHANNEL_TIME;
-	local->scan_state = SCAN_DECISION;
+	local->next_scan_state = SCAN_DECISION;
 }
 
 void ieee80211_scan_work(struct work_struct *work)
@@ -693,7 +693,7 @@ void ieee80211_scan_work(struct work_struct *work)
 	 * without scheduling a new work
 	 */
 	do {
-		switch (local->scan_state) {
+		switch (local->next_scan_state) {
 		case SCAN_DECISION:
 			if (ieee80211_scan_state_decision(local, &next_delay))
 				return;


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 7/7] cfg80211: increase scan result expire time
  2009-07-23 10:13 [PATCH 0/7] implement background scan Helmut Schaa
                   ` (5 preceding siblings ...)
  2009-07-23 10:14 ` [PATCH 6/7] mac80211: rename scan_state to next_scan_state Helmut Schaa
@ 2009-07-23 10:14 ` Helmut Schaa
  2009-07-23 10:39   ` Johannes Berg
  6 siblings, 1 reply; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 10:14 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, johannes

Using background scanning in mac80211 the time a scan needs to
finish can exceed 10 seconds. Hence, increase the scan results
expire time to 15 seconds which should be sufficient.
    
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---

 net/wireless/scan.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 4ad8b4b..0850b98 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -15,7 +15,7 @@
 #include "core.h"
 #include "nl80211.h"
 
-#define IEEE80211_SCAN_RESULT_EXPIRE	(10 * HZ)
+#define IEEE80211_SCAN_RESULT_EXPIRE	(15 * HZ)
 
 void __cfg80211_scan_done(struct work_struct *wk)
 {


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/7] mac80211: refactor the scan code
  2009-07-23 10:13 ` [PATCH 1/7] mac80211: refactor the scan code Helmut Schaa
@ 2009-07-23 10:36   ` Johannes Berg
  0 siblings, 0 replies; 22+ messages in thread
From: Johannes Berg @ 2009-07-23 10:36 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 5665 bytes --]

On Thu, 2009-07-23 at 12:13 +0200, Helmut Schaa wrote:
> Move the processing of each scan state into its own functions for better
> readability. This patch does not introduce functional changes.
> 
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

Acked-by: Johannes Berg <johannes@sipsolutions.net>

> ---
> 
>  net/mac80211/scan.c |  136 +++++++++++++++++++++++++++++----------------------
>  1 files changed, 78 insertions(+), 58 deletions(-)
> 
> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
> index 7482065..71500f1 100644
> --- a/net/mac80211/scan.c
> +++ b/net/mac80211/scan.c
> @@ -474,13 +474,87 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
>  	return rc;
>  }
>  
> +static int ieee80211_scan_state_set_channel(struct ieee80211_local *local,
> +					    unsigned long *next_delay)
> +{
> +	int skip;
> +	struct ieee80211_channel *chan;
> +	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
> +
> +	/* if no more bands/channels left, complete scan */
> +	if (local->scan_channel_idx >= local->scan_req->n_channels) {
> +		ieee80211_scan_completed(&local->hw, false);
> +		return 1;
> +	}
> +	skip = 0;
> +	chan = local->scan_req->channels[local->scan_channel_idx];
> +
> +	if (chan->flags & IEEE80211_CHAN_DISABLED ||
> +	    (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
> +	     chan->flags & IEEE80211_CHAN_NO_IBSS))
> +		skip = 1;
> +
> +	if (!skip) {
> +		local->scan_channel = chan;
> +		if (ieee80211_hw_config(local,
> +					IEEE80211_CONF_CHANGE_CHANNEL))
> +			skip = 1;
> +	}
> +
> +	/* advance state machine to next channel/band */
> +	local->scan_channel_idx++;
> +
> +	if (skip)
> +		return 0;
> +
> +	/*
> +	 * Probe delay is used to update the NAV, cf. 11.1.3.2.2
> +	 * (which unfortunately doesn't say _why_ step a) is done,
> +	 * but it waits for the probe delay or until a frame is
> +	 * received - and the received frame would update the NAV).
> +	 * For now, we do not support waiting until a frame is
> +	 * received.
> +	 *
> +	 * In any case, it is not necessary for a passive scan.
> +	 */
> +	if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
> +	    !local->scan_req->n_ssids) {
> +		*next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
> +		return 0;
> +	}
> +
> +	*next_delay = IEEE80211_PROBE_DELAY;
> +	local->scan_state = SCAN_SEND_PROBE;
> +
> +	return 0;
> +}
> +
> +static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
> +					    unsigned long *next_delay)
> +{
> +	int i;
> +	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
> +
> +	for (i = 0; i < local->scan_req->n_ssids; i++)
> +		ieee80211_send_probe_req(
> +			sdata, NULL,
> +			local->scan_req->ssids[i].ssid,
> +			local->scan_req->ssids[i].ssid_len,
> +			local->scan_req->ie, local->scan_req->ie_len);
> +
> +	/*
> +	 * After sending probe requests, wait for probe responses
> +	 * on the channel.
> +	 */
> +	*next_delay = IEEE80211_CHANNEL_TIME;
> +	local->scan_state = SCAN_SET_CHANNEL;
> +}
> +
>  void ieee80211_scan_work(struct work_struct *work)
>  {
>  	struct ieee80211_local *local =
>  		container_of(work, struct ieee80211_local, scan_work.work);
>  	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
> -	struct ieee80211_channel *chan;
> -	int skip, i;
>  	unsigned long next_delay = 0;
>  
>  	mutex_lock(&local->scan_mtx);
> @@ -515,65 +589,11 @@ void ieee80211_scan_work(struct work_struct *work)
>  
>  	switch (local->scan_state) {
>  	case SCAN_SET_CHANNEL:
> -		/* if no more bands/channels left, complete scan */
> -		if (local->scan_channel_idx >= local->scan_req->n_channels) {
> -			ieee80211_scan_completed(&local->hw, false);
> +		if (ieee80211_scan_state_set_channel(local, &next_delay))
>  			return;
> -		}
> -		skip = 0;
> -		chan = local->scan_req->channels[local->scan_channel_idx];
> -
> -		if (chan->flags & IEEE80211_CHAN_DISABLED ||
> -		    (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
> -		     chan->flags & IEEE80211_CHAN_NO_IBSS))
> -			skip = 1;
> -
> -		if (!skip) {
> -			local->scan_channel = chan;
> -			if (ieee80211_hw_config(local,
> -						IEEE80211_CONF_CHANGE_CHANNEL))
> -				skip = 1;
> -		}
> -
> -		/* advance state machine to next channel/band */
> -		local->scan_channel_idx++;
> -
> -		if (skip)
> -			break;
> -
> -		/*
> -		 * Probe delay is used to update the NAV, cf. 11.1.3.2.2
> -		 * (which unfortunately doesn't say _why_ step a) is done,
> -		 * but it waits for the probe delay or until a frame is
> -		 * received - and the received frame would update the NAV).
> -		 * For now, we do not support waiting until a frame is
> -		 * received.
> -		 *
> -		 * In any case, it is not necessary for a passive scan.
> -		 */
> -		if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
> -		    !local->scan_req->n_ssids) {
> -			next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
> -			break;
> -		}
> -
> -		next_delay = IEEE80211_PROBE_DELAY;
> -		local->scan_state = SCAN_SEND_PROBE;
>  		break;
>  	case SCAN_SEND_PROBE:
> -		for (i = 0; i < local->scan_req->n_ssids; i++)
> -			ieee80211_send_probe_req(
> -				sdata, NULL,
> -				local->scan_req->ssids[i].ssid,
> -				local->scan_req->ssids[i].ssid_len,
> -				local->scan_req->ie, local->scan_req->ie_len);
> -
> -		/*
> -		 * After sending probe requests, wait for probe responses
> -		 * on the channel.
> -		 */
> -		next_delay = IEEE80211_CHANNEL_TIME;
> -		local->scan_state = SCAN_SET_CHANNEL;
> +		ieee80211_scan_state_send_probe(local, &next_delay);
>  		break;
>  	}
>  
> 
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/7] mac80211: advance the state machine immediately if no delay is needed
  2009-07-23 10:13 ` [PATCH 2/7] mac80211: advance the state machine immediately if no delay is needed Helmut Schaa
@ 2009-07-23 10:36   ` Johannes Berg
  0 siblings, 0 replies; 22+ messages in thread
From: Johannes Berg @ 2009-07-23 10:36 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]

On Thu, 2009-07-23 at 12:13 +0200, Helmut Schaa wrote:
> Instead of queueing the scan work again without delay just process the
> next state immediately.
>     
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

Acked-by: Johannes Berg <johannes@sipsolutions.net>

> ---
> 
>  net/mac80211/scan.c |   24 +++++++++++++++---------
>  1 files changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
> index 71500f1..db122e4 100644
> --- a/net/mac80211/scan.c
> +++ b/net/mac80211/scan.c
> @@ -587,15 +587,21 @@ void ieee80211_scan_work(struct work_struct *work)
>  		return;
>  	}
>  
> -	switch (local->scan_state) {
> -	case SCAN_SET_CHANNEL:
> -		if (ieee80211_scan_state_set_channel(local, &next_delay))
> -			return;
> -		break;
> -	case SCAN_SEND_PROBE:
> -		ieee80211_scan_state_send_probe(local, &next_delay);
> -		break;
> -	}
> +	/*
> +	 * as long as no delay is required advance immediately
> +	 * without scheduling a new work
> +	 */
> +	do {
> +		switch (local->scan_state) {
> +		case SCAN_SET_CHANNEL:
> +			if (ieee80211_scan_state_set_channel(local, &next_delay))
> +				return;
> +			break;
> +		case SCAN_SEND_PROBE:
> +			ieee80211_scan_state_send_probe(local, &next_delay);
> +			break;
> +		}
> +	} while (next_delay == 0);
>  
>  	queue_delayed_work(local->hw.workqueue, &local->scan_work,
>  			   next_delay);
> 
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 3/7] mac80211: introduce a new scan state "decision"
  2009-07-23 10:13 ` [PATCH 3/7] mac80211: introduce a new scan state "decision" Helmut Schaa
@ 2009-07-23 10:37   ` Johannes Berg
  0 siblings, 0 replies; 22+ messages in thread
From: Johannes Berg @ 2009-07-23 10:37 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 4416 bytes --]

On Thu, 2009-07-23 at 12:13 +0200, Helmut Schaa wrote:
> Introduce a new scan state "decision" which is entered after
> every completed scan operation and decides about the next steps.
> At first the decision is in any case to scan the next channel.
> This shouldn't introduce any functional changes.
>     
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

Acked-by: Johannes Berg <johannes@sipsolutions.net>

> ---
> 
>  net/mac80211/ieee80211_i.h |    2 +-
>  net/mac80211/scan.c        |   40 ++++++++++++++++++++++++++--------------
>  2 files changed, 27 insertions(+), 15 deletions(-)
> 
> diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
> index 6a01771..4166418 100644
> --- a/net/mac80211/ieee80211_i.h
> +++ b/net/mac80211/ieee80211_i.h
> @@ -678,7 +678,7 @@ struct ieee80211_local {
>  	int scan_channel_idx;
>  	int scan_ies_len;
>  
> -	enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
> +	enum { SCAN_DECISION, SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
>  	struct delayed_work scan_work;
>  	struct ieee80211_sub_if_data *scan_sdata;
>  	enum nl80211_channel_type oper_channel_type;
> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
> index db122e4..48f910a 100644
> --- a/net/mac80211/scan.c
> +++ b/net/mac80211/scan.c
> @@ -376,7 +376,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
>  	}
>  	mutex_unlock(&local->iflist_mtx);
>  
> -	local->scan_state = SCAN_SET_CHANNEL;
> +	local->scan_state = SCAN_DECISION;
>  	local->scan_channel_idx = 0;
>  
>  	spin_lock_bh(&local->filter_lock);
> @@ -474,18 +474,27 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
>  	return rc;
>  }
>  
> -static int ieee80211_scan_state_set_channel(struct ieee80211_local *local,
> -					    unsigned long *next_delay)
> +static int ieee80211_scan_state_decision(struct ieee80211_local *local,
> +					 unsigned long *next_delay)
>  {
> -	int skip;
> -	struct ieee80211_channel *chan;
> -	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
> -
>  	/* if no more bands/channels left, complete scan */
>  	if (local->scan_channel_idx >= local->scan_req->n_channels) {
>  		ieee80211_scan_completed(&local->hw, false);
>  		return 1;
>  	}
> +
> +	*next_delay = 0;
> +	local->scan_state = SCAN_SET_CHANNEL;
> +	return 0;
> +}
> +
> +static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
> +					     unsigned long *next_delay)
> +{
> +	int skip;
> +	struct ieee80211_channel *chan;
> +	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
> +
>  	skip = 0;
>  	chan = local->scan_req->channels[local->scan_channel_idx];
>  
> @@ -505,7 +514,7 @@ static int ieee80211_scan_state_set_channel(struct ieee80211_local *local,
>  	local->scan_channel_idx++;
>  
>  	if (skip)
> -		return 0;
> +		return;
>  
>  	/*
>  	 * Probe delay is used to update the NAV, cf. 11.1.3.2.2
> @@ -520,13 +529,13 @@ static int ieee80211_scan_state_set_channel(struct ieee80211_local *local,
>  	if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
>  	    !local->scan_req->n_ssids) {
>  		*next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
> -		return 0;
> +		local->scan_state = SCAN_DECISION;
> +		return;
>  	}
>  
> +	/* active scan, send probes */
>  	*next_delay = IEEE80211_PROBE_DELAY;
>  	local->scan_state = SCAN_SEND_PROBE;
> -
> -	return 0;
>  }
>  
>  static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
> @@ -547,7 +556,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
>  	 * on the channel.
>  	 */
>  	*next_delay = IEEE80211_CHANNEL_TIME;
> -	local->scan_state = SCAN_SET_CHANNEL;
> +	local->scan_state = SCAN_DECISION;
>  }
>  
>  void ieee80211_scan_work(struct work_struct *work)
> @@ -593,10 +602,13 @@ void ieee80211_scan_work(struct work_struct *work)
>  	 */
>  	do {
>  		switch (local->scan_state) {
> -		case SCAN_SET_CHANNEL:
> -			if (ieee80211_scan_state_set_channel(local, &next_delay))
> +		case SCAN_DECISION:
> +			if (ieee80211_scan_state_decision(local, &next_delay))
>  				return;
>  			break;
> +		case SCAN_SET_CHANNEL:
> +			ieee80211_scan_state_set_channel(local, &next_delay);
> +			break;
>  		case SCAN_SEND_PROBE:
>  			ieee80211_scan_state_send_probe(local, &next_delay);
>  			break;
> 
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/7] mac80211: Replace {sw, hw}_scanning variables with a bitfield
  2009-07-23 10:14 ` [PATCH 4/7] mac80211: Replace {sw, hw}_scanning variables with a bitfield Helmut Schaa
@ 2009-07-23 10:38   ` Johannes Berg
  2009-07-23 10:46     ` Helmut Schaa
  0 siblings, 1 reply; 22+ messages in thread
From: Johannes Berg @ 2009-07-23 10:38 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

On Thu, 2009-07-23 at 12:14 +0200, Helmut Schaa wrote:
> Use a bitfield to store the current scan mode instead of two boolean
> variables {sw,hw}_scanning. This patch does not introduce functional
> changes but allows us to enhance the scan flags later (for example
> for background scanning).

> +			if (test_bit(SCAN_SW_SCANNING, &local->scanning))

Do we actually need atomic bitops?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 5/7] mac80211: implement basic background scanning
  2009-07-23 10:14 ` [PATCH 5/7] mac80211: implement basic background scanning Helmut Schaa
@ 2009-07-23 10:39   ` Johannes Berg
  2009-07-23 10:48     ` Helmut Schaa
  2009-07-23 11:18   ` [PATCH v2 " Helmut Schaa
  1 sibling, 1 reply; 22+ messages in thread
From: Johannes Berg @ 2009-07-23 10:39 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 916 bytes --]

On Thu, 2009-07-23 at 12:14 +0200, Helmut Schaa wrote:
> Introduce a new scan flag "SCAN_BG_SCANNING" which basically tells us
> that we are currently scanning but may as well be on the operating channel
> to RX/TX data whereas "SCAN_SW_SCANNING" tells us that we are currently
> on a different channel for scanning. While "SCAN_BG_SCANNING" is set
> during the whole scan "SCAN_SW_SCANNING" is set when leaving the operating
> channel and unset when coming back.

I think you got that description wrong :)

> + * @SCAN_SW_SCANNING: We're currently in the process of scanning but may as
> + *	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_OFF_CHANNEL: We're off our operating channel for scanning,
> + *	gets only set in conjunction with SCAN_SW_SCANNING

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 6/7] mac80211: rename scan_state to next_scan_state
  2009-07-23 10:14 ` [PATCH 6/7] mac80211: rename scan_state to next_scan_state Helmut Schaa
@ 2009-07-23 10:39   ` Johannes Berg
  0 siblings, 0 replies; 22+ messages in thread
From: Johannes Berg @ 2009-07-23 10:39 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 4041 bytes --]

On Thu, 2009-07-23 at 12:14 +0200, Helmut Schaa wrote:
> Rename scan_state to next_scan_state to better reflect
> what it is used for.
>     
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

Acked-by: Johannes Berg <johannes@sipsolutions.net>

> ---
> 
>  net/mac80211/ieee80211_i.h |    2 +-
>  net/mac80211/scan.c        |   20 ++++++++++----------
>  2 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
> index efda19e..c6b25cb 100644
> --- a/net/mac80211/ieee80211_i.h
> +++ b/net/mac80211/ieee80211_i.h
> @@ -715,7 +715,7 @@ struct ieee80211_local {
>  	int scan_channel_idx;
>  	int scan_ies_len;
>  
> -	enum mac80211_scan_state scan_state;
> +	enum mac80211_scan_state next_scan_state;
>  	struct delayed_work scan_work;
>  	struct ieee80211_sub_if_data *scan_sdata;
>  	enum nl80211_channel_type oper_channel_type;
> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
> index d56b9da..b376775 100644
> --- a/net/mac80211/scan.c
> +++ b/net/mac80211/scan.c
> @@ -374,7 +374,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
>  	}
>  	mutex_unlock(&local->iflist_mtx);
>  
> -	local->scan_state = SCAN_DECISION;
> +	local->next_scan_state = SCAN_DECISION;
>  	local->scan_channel_idx = 0;
>  
>  	spin_lock_bh(&local->filter_lock);
> @@ -505,15 +505,15 @@ static int ieee80211_scan_state_decision(struct ieee80211_local *local,
>  		 * next channel
>  		 */
>  		if (associated)
> -			local->scan_state = SCAN_ENTER_OPER_CHANNEL;
> +			local->next_scan_state = SCAN_ENTER_OPER_CHANNEL;
>  		else
> -			local->scan_state = SCAN_SET_CHANNEL;
> +			local->next_scan_state = SCAN_SET_CHANNEL;
>  	} else {
>  		/*
>  		 * we're on the operating channel currently, let's
>  		 * leave that channel now to scan another one
>  		 */
> -		local->scan_state = SCAN_LEAVE_OPER_CHANNEL;
> +		local->next_scan_state = SCAN_LEAVE_OPER_CHANNEL;
>  	}
>  
>  	*next_delay = 0;
> @@ -545,7 +545,7 @@ static void ieee80211_scan_state_leave_oper_channel(struct ieee80211_local *loca
>  
>  	/* advance to the next channel to be scanned */
>  	*next_delay = HZ / 10;
> -	local->scan_state = SCAN_SET_CHANNEL;
> +	local->next_scan_state = SCAN_SET_CHANNEL;
>  }
>  
>  static void ieee80211_scan_state_enter_oper_channel(struct ieee80211_local *local,
> @@ -577,7 +577,7 @@ static void ieee80211_scan_state_enter_oper_channel(struct ieee80211_local *loca
>  	__clear_bit(SCAN_OFF_CHANNEL, &local->scanning);
>  
>  	*next_delay = HZ / 5;
> -	local->scan_state = SCAN_DECISION;
> +	local->next_scan_state = SCAN_DECISION;
>  }
>  
>  static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
> @@ -621,13 +621,13 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
>  	if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
>  	    !local->scan_req->n_ssids) {
>  		*next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
> -		local->scan_state = SCAN_DECISION;
> +		local->next_scan_state = SCAN_DECISION;
>  		return;
>  	}
>  
>  	/* active scan, send probes */
>  	*next_delay = IEEE80211_PROBE_DELAY;
> -	local->scan_state = SCAN_SEND_PROBE;
> +	local->next_scan_state = SCAN_SEND_PROBE;
>  }
>  
>  static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
> @@ -648,7 +648,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
>  	 * on the channel.
>  	 */
>  	*next_delay = IEEE80211_CHANNEL_TIME;
> -	local->scan_state = SCAN_DECISION;
> +	local->next_scan_state = SCAN_DECISION;
>  }
>  
>  void ieee80211_scan_work(struct work_struct *work)
> @@ -693,7 +693,7 @@ void ieee80211_scan_work(struct work_struct *work)
>  	 * without scheduling a new work
>  	 */
>  	do {
> -		switch (local->scan_state) {
> +		switch (local->next_scan_state) {
>  		case SCAN_DECISION:
>  			if (ieee80211_scan_state_decision(local, &next_delay))
>  				return;
> 
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 7/7] cfg80211: increase scan result expire time
  2009-07-23 10:14 ` [PATCH 7/7] cfg80211: increase scan result expire time Helmut Schaa
@ 2009-07-23 10:39   ` Johannes Berg
  2009-07-23 10:50     ` Helmut Schaa
  0 siblings, 1 reply; 22+ messages in thread
From: Johannes Berg @ 2009-07-23 10:39 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 890 bytes --]

On Thu, 2009-07-23 at 12:14 +0200, Helmut Schaa wrote:
> Using background scanning in mac80211 the time a scan needs to
> finish can exceed 10 seconds. Hence, increase the scan results
> expire time to 15 seconds which should be sufficient.
>     
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

Heh.

Acked-by: Johannes Berg <johannes@sipsolutions.net>

johannes

> ---
> 
>  net/wireless/scan.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/wireless/scan.c b/net/wireless/scan.c
> index 4ad8b4b..0850b98 100644
> --- a/net/wireless/scan.c
> +++ b/net/wireless/scan.c
> @@ -15,7 +15,7 @@
>  #include "core.h"
>  #include "nl80211.h"
>  
> -#define IEEE80211_SCAN_RESULT_EXPIRE	(10 * HZ)
> +#define IEEE80211_SCAN_RESULT_EXPIRE	(15 * HZ)
>  
>  void __cfg80211_scan_done(struct work_struct *wk)
>  {
> 
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/7] mac80211: Replace {sw, hw}_scanning variables with a bitfield
  2009-07-23 10:38   ` Johannes Berg
@ 2009-07-23 10:46     ` Helmut Schaa
  2009-07-23 10:48       ` Johannes Berg
  0 siblings, 1 reply; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 10:46 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

Am Donnerstag, 23. Juli 2009 schrieb Johannes Berg:
> On Thu, 2009-07-23 at 12:14 +0200, Helmut Schaa wrote:
> > Use a bitfield to store the current scan mode instead of two boolean
> > variables {sw,hw}_scanning. This patch does not introduce functional
> > changes but allows us to enhance the scan flags later (for example
> > for background scanning).
> 
> > +			if (test_bit(SCAN_SW_SCANNING, &local->scanning))
> 
> Do we actually need atomic bitops?

No (at least not yet). That's why I used __set_bit. test_bit seems to not
have a non-atomic equivalent. Or did you mean not to use *_bit functions
at all?

Helmut

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/7] mac80211: Replace {sw, hw}_scanning variables with a bitfield
  2009-07-23 10:46     ` Helmut Schaa
@ 2009-07-23 10:48       ` Johannes Berg
  0 siblings, 0 replies; 22+ messages in thread
From: Johannes Berg @ 2009-07-23 10:48 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

On Thu, 2009-07-23 at 12:46 +0200, Helmut Schaa wrote:
> Am Donnerstag, 23. Juli 2009 schrieb Johannes Berg:
> > On Thu, 2009-07-23 at 12:14 +0200, Helmut Schaa wrote:
> > > Use a bitfield to store the current scan mode instead of two boolean
> > > variables {sw,hw}_scanning. This patch does not introduce functional
> > > changes but allows us to enhance the scan flags later (for example
> > > for background scanning).
> > 
> > > +			if (test_bit(SCAN_SW_SCANNING, &local->scanning))
> > 
> > Do we actually need atomic bitops?
> 
> No (at least not yet). That's why I used __set_bit. test_bit seems to not
> have a non-atomic equivalent. Or did you mean not to use *_bit functions
> at all?

Sorry, you're right, I got confused.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 5/7] mac80211: implement basic background scanning
  2009-07-23 10:39   ` Johannes Berg
@ 2009-07-23 10:48     ` Helmut Schaa
  2009-07-23 10:59       ` Johannes Berg
  0 siblings, 1 reply; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 10:48 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

Am Donnerstag, 23. Juli 2009 schrieb Johannes Berg:
> On Thu, 2009-07-23 at 12:14 +0200, Helmut Schaa wrote:
> > Introduce a new scan flag "SCAN_BG_SCANNING" which basically tells us
> > that we are currently scanning but may as well be on the operating channel
> > to RX/TX data whereas "SCAN_SW_SCANNING" tells us that we are currently
> > on a different channel for scanning. While "SCAN_BG_SCANNING" is set
> > during the whole scan "SCAN_SW_SCANNING" is set when leaving the operating
> > channel and unset when coming back.
> 
> I think you got that description wrong :)

Argh, yes. Should I respin the whole series?

> > + * @SCAN_SW_SCANNING: We're currently in the process of scanning but may as
> > + *	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_OFF_CHANNEL: We're off our operating channel for scanning,
> > + *	gets only set in conjunction with SCAN_SW_SCANNING
> 
> johannes
> 



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 7/7] cfg80211: increase scan result expire time
  2009-07-23 10:39   ` Johannes Berg
@ 2009-07-23 10:50     ` Helmut Schaa
  2009-07-23 11:00       ` Johannes Berg
  0 siblings, 1 reply; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 10:50 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

Am Donnerstag, 23. Juli 2009 schrieb Johannes Berg:
> On Thu, 2009-07-23 at 12:14 +0200, Helmut Schaa wrote:
> > Using background scanning in mac80211 the time a scan needs to
> > finish can exceed 10 seconds. Hence, increase the scan results
> > expire time to 15 seconds which should be sufficient.
> >     
> > Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
> 
> Heh.

;)

Maybe we could later use a dynamic expire time based on the time
the last scan took or something similar. But for now 15 seconds
should suffice.

> Acked-by: Johannes Berg <johannes@sipsolutions.net>
> 
> johannes
> 
> > ---
> > 
> >  net/wireless/scan.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/net/wireless/scan.c b/net/wireless/scan.c
> > index 4ad8b4b..0850b98 100644
> > --- a/net/wireless/scan.c
> > +++ b/net/wireless/scan.c
> > @@ -15,7 +15,7 @@
> >  #include "core.h"
> >  #include "nl80211.h"
> >  
> > -#define IEEE80211_SCAN_RESULT_EXPIRE	(10 * HZ)
> > +#define IEEE80211_SCAN_RESULT_EXPIRE	(15 * HZ)
> >  
> >  void __cfg80211_scan_done(struct work_struct *wk)
> >  {
> > 
> > 
> 



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 5/7] mac80211: implement basic background scanning
  2009-07-23 10:48     ` Helmut Schaa
@ 2009-07-23 10:59       ` Johannes Berg
  0 siblings, 0 replies; 22+ messages in thread
From: Johannes Berg @ 2009-07-23 10:59 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

On Thu, 2009-07-23 at 12:48 +0200, Helmut Schaa wrote:
> Am Donnerstag, 23. Juli 2009 schrieb Johannes Berg:
> > On Thu, 2009-07-23 at 12:14 +0200, Helmut Schaa wrote:
> > > Introduce a new scan flag "SCAN_BG_SCANNING" which basically tells us
> > > that we are currently scanning but may as well be on the operating channel
> > > to RX/TX data whereas "SCAN_SW_SCANNING" tells us that we are currently
> > > on a different channel for scanning. While "SCAN_BG_SCANNING" is set
> > > during the whole scan "SCAN_SW_SCANNING" is set when leaving the operating
> > > channel and unset when coming back.
> > 
> > I think you got that description wrong :)
> 
> Argh, yes. Should I respin the whole series?

Not for all I care, just resend this one as a reply to it?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 7/7] cfg80211: increase scan result expire time
  2009-07-23 10:50     ` Helmut Schaa
@ 2009-07-23 11:00       ` Johannes Berg
  0 siblings, 0 replies; 22+ messages in thread
From: Johannes Berg @ 2009-07-23 11:00 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

On Thu, 2009-07-23 at 12:50 +0200, Helmut Schaa wrote:
> Am Donnerstag, 23. Juli 2009 schrieb Johannes Berg:
> > On Thu, 2009-07-23 at 12:14 +0200, Helmut Schaa wrote:
> > > Using background scanning in mac80211 the time a scan needs to
> > > finish can exceed 10 seconds. Hence, increase the scan results
> > > expire time to 15 seconds which should be sufficient.
> > >     
> > > Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
> > 
> > Heh.
> 
> ;)
> 
> Maybe we could later use a dynamic expire time based on the time
> the last scan took or something similar. But for now 15 seconds
> should suffice.

Since we tell (or if we don't, should) userspace when that was last
seen, I guess we could just increase this more anyway. But ultimately it
doesn't matter all that much since people are just using wpa_supplicant
and keeping a copy in userspace.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v2 5/7] mac80211: implement basic background scanning
  2009-07-23 10:14 ` [PATCH 5/7] mac80211: implement basic background scanning Helmut Schaa
  2009-07-23 10:39   ` Johannes Berg
@ 2009-07-23 11:18   ` Helmut Schaa
  1 sibling, 0 replies; 22+ messages in thread
From: Helmut Schaa @ 2009-07-23 11:18 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, johannes

Introduce a new scan flag "SCAN_OFF_CHANNEL" which basically tells us
that we are currently on a different channel for scanning and cannot
RX/TX. "SCAN_SW_SCANNING" tells us that we are currently running a
software scan but we might as well be on the operating channel to RX/TX.
While "SCAN_SW_SCANNING" is set during the whole scan "SCAN_OFF_CHANNEL"
is set when leaving the operating channel and unset when coming back.

Introduce two new scan states "SCAN_LEAVE_OPER_CHANNEL" and
"SCAN_ENTER_OPER_CHANNEL" which basically implement the functionality we
need to leave the operating channel (send a nullfunc to the AP and stop
the queues) and enter it again (send a nullfunc to the AP and start the
queues again).

Enhance the scan state "SCAN_DECISION" to switch back to the operating
channel after each scanned channel. In the future it sould be simple
to enhance the decision state to scan as much channels in a row as the
qos latency allows us.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---

 net/mac80211/ieee80211_i.h |   36 +++++++++++++-
 net/mac80211/rx.c          |    6 ++
 net/mac80211/scan.c        |  117 +++++++++++++++++++++++++++++++++++++++++---
 net/mac80211/tx.c          |    2 -
 4 files changed, 148 insertions(+), 13 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 783a125..efda19e 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -570,9 +570,41 @@ enum queue_stop_reason {
 	IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
 };
 
+/**
+ * mac80211 scan flags - currently active scan mode
+ *
+ * @SCAN_SW_SCANNING: We're currently in the process of scanning but may as
+ *	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_OFF_CHANNEL: We're off our operating channel for scanning,
+ *	gets only set in conjunction with SCAN_SW_SCANNING
+ */
 enum {
 	SCAN_SW_SCANNING,
-	SCAN_HW_SCANNING
+	SCAN_HW_SCANNING,
+	SCAN_OFF_CHANNEL,
+};
+
+/**
+ * enum mac80211_scan_state - scan state machine states
+ *
+ * @SCAN_DECISION: Main entry point to the scan state machine, this state
+ *	determines if we should keep on scanning or switch back to the
+ *	operating channel
+ * @SCAN_SET_CHANNEL: Set the next channel to be scanned
+ * @SCAN_SEND_PROBE: Send probe requests and wait for probe responses
+ * @SCAN_LEAVE_OPER_CHANNEL: Leave the operating channel, notify the AP
+ *	about us leaving the channel and stop all associated STA interfaces
+ * @SCAN_ENTER_OPER_CHANNEL: Enter the operating channel again, notify the
+ *	AP about us being back and restart all associated STA interfaces
+ */
+enum mac80211_scan_state {
+	SCAN_DECISION,
+	SCAN_SET_CHANNEL,
+	SCAN_SEND_PROBE,
+	SCAN_LEAVE_OPER_CHANNEL,
+	SCAN_ENTER_OPER_CHANNEL,
 };
 
 struct ieee80211_local {
@@ -683,7 +715,7 @@ struct ieee80211_local {
 	int scan_channel_idx;
 	int scan_ies_len;
 
-	enum { SCAN_DECISION, SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
+	enum mac80211_scan_state scan_state;
 	struct delayed_work scan_work;
 	struct ieee80211_sub_if_data *scan_sdata;
 	enum nl80211_channel_type oper_channel_type;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b1bebc1..dd192b3 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -421,7 +421,8 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx)
 	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))) {
+	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);
@@ -2136,7 +2137,8 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
 		return;
 	}
 
-	if (unlikely(local->scanning))
+	if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning) ||
+		     test_bit(SCAN_OFF_CHANNEL, &local->scanning)))
 		rx.flags |= IEEE80211_RX_IN_SCAN;
 
 	ieee80211_parse_qos(&rx);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 4233c3d..d56b9da 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -365,12 +365,11 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
 			ieee80211_bss_info_change_notify(
 				sdata, BSS_CHANGED_BEACON_ENABLED);
 
-		if (sdata->vif.type == NL80211_IFTYPE_STATION) {
-			if (sdata->u.mgd.associated) {
-				netif_tx_stop_all_queues(sdata->dev);
-				ieee80211_scan_ps_enable(sdata);
-			}
-		} else
+		/*
+		 * only handle non-STA interfaces here, STA interfaces
+		 * are handled in the scan state machine
+		 */
+		if (sdata->vif.type != NL80211_IFTYPE_STATION)
 			netif_tx_stop_all_queues(sdata->dev);
 	}
 	mutex_unlock(&local->iflist_mtx);
@@ -474,17 +473,113 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 static int ieee80211_scan_state_decision(struct ieee80211_local *local,
 					 unsigned long *next_delay)
 {
-	/* if no more bands/channels left, complete scan */
+	bool associated = false;
+	struct ieee80211_sub_if_data *sdata;
+
+	/* if no more bands/channels left, complete scan and advance to the idle state */
 	if (local->scan_channel_idx >= local->scan_req->n_channels) {
 		ieee80211_scan_completed(&local->hw, false);
 		return 1;
 	}
 
+	/* check if at least one STA interface is associated */
+	mutex_lock(&local->iflist_mtx);
+	list_for_each_entry(sdata, &local->interfaces, list) {
+		if (!netif_running(sdata->dev))
+			continue;
+
+		if (sdata->vif.type == NL80211_IFTYPE_STATION) {
+			if (sdata->u.mgd.associated) {
+				associated = true;
+				break;
+			}
+		}
+	}
+	mutex_unlock(&local->iflist_mtx);
+
+	if (local->scan_channel) {
+		/*
+		 * we're currently scanning a different channel, let's
+		 * switch back to the operating channel now if at least
+		 * one interface is associated. Otherwise just scan the
+		 * next channel
+		 */
+		if (associated)
+			local->scan_state = SCAN_ENTER_OPER_CHANNEL;
+		else
+			local->scan_state = SCAN_SET_CHANNEL;
+	} else {
+		/*
+		 * we're on the operating channel currently, let's
+		 * leave that channel now to scan another one
+		 */
+		local->scan_state = SCAN_LEAVE_OPER_CHANNEL;
+	}
+
 	*next_delay = 0;
-	local->scan_state = SCAN_SET_CHANNEL;
 	return 0;
 }
 
+static void ieee80211_scan_state_leave_oper_channel(struct ieee80211_local *local,
+						    unsigned long *next_delay)
+{
+	struct ieee80211_sub_if_data *sdata;
+
+	/*
+	 * notify the AP about us leaving the channel and stop all STA interfaces
+	 */
+	mutex_lock(&local->iflist_mtx);
+	list_for_each_entry(sdata, &local->interfaces, list) {
+		if (!netif_running(sdata->dev))
+			continue;
+
+		if (sdata->vif.type == NL80211_IFTYPE_STATION) {
+			netif_tx_stop_all_queues(sdata->dev);
+			if (sdata->u.mgd.associated)
+				ieee80211_scan_ps_enable(sdata);
+		}
+	}
+	mutex_unlock(&local->iflist_mtx);
+
+	__set_bit(SCAN_OFF_CHANNEL, &local->scanning);
+
+	/* advance to the next channel to be scanned */
+	*next_delay = HZ / 10;
+	local->scan_state = SCAN_SET_CHANNEL;
+}
+
+static void ieee80211_scan_state_enter_oper_channel(struct ieee80211_local *local,
+						    unsigned long *next_delay)
+{
+	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
+
+	/* switch back to the operating channel */
+	local->scan_channel = NULL;
+	ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
+
+	/*
+	 * notify the AP about us being back and restart all STA interfaces
+	 */
+	mutex_lock(&local->iflist_mtx);
+	list_for_each_entry(sdata, &local->interfaces, list) {
+		if (!netif_running(sdata->dev))
+			continue;
+
+		/* Tell AP we're back */
+		if (sdata->vif.type == NL80211_IFTYPE_STATION) {
+			if (sdata->u.mgd.associated)
+				ieee80211_scan_ps_disable(sdata);
+			netif_tx_wake_all_queues(sdata->dev);
+		}
+	}
+	mutex_unlock(&local->iflist_mtx);
+
+	__clear_bit(SCAN_OFF_CHANNEL, &local->scanning);
+
+	*next_delay = HZ / 5;
+	local->scan_state = SCAN_DECISION;
+}
+
 static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
 					     unsigned long *next_delay)
 {
@@ -609,6 +704,12 @@ void ieee80211_scan_work(struct work_struct *work)
 		case SCAN_SEND_PROBE:
 			ieee80211_scan_state_send_probe(local, &next_delay);
 			break;
+		case SCAN_LEAVE_OPER_CHANNEL:
+			ieee80211_scan_state_leave_oper_channel(local, &next_delay);
+			break;
+		case SCAN_ENTER_OPER_CHANNEL:
+			ieee80211_scan_state_enter_oper_channel(local, &next_delay);
+			break;
 		}
 	} while (next_delay == 0);
 
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 61739ab..275bc15 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -192,7 +192,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx)
 	if (unlikely(info->flags & IEEE80211_TX_CTL_INJECTED))
 		return TX_CONTINUE;
 
-	if (unlikely(test_bit(SCAN_SW_SCANNING, &tx->local->scanning)) &&
+	if (unlikely(test_bit(SCAN_OFF_CHANNEL, &tx->local->scanning)) &&
 	    !ieee80211_is_probe_req(hdr->frame_control) &&
 	    !ieee80211_is_nullfunc(hdr->frame_control))
 		/*


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2009-07-23 11:17 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-23 10:13 [PATCH 0/7] implement background scan Helmut Schaa
2009-07-23 10:13 ` [PATCH 1/7] mac80211: refactor the scan code Helmut Schaa
2009-07-23 10:36   ` Johannes Berg
2009-07-23 10:13 ` [PATCH 2/7] mac80211: advance the state machine immediately if no delay is needed Helmut Schaa
2009-07-23 10:36   ` Johannes Berg
2009-07-23 10:13 ` [PATCH 3/7] mac80211: introduce a new scan state "decision" Helmut Schaa
2009-07-23 10:37   ` Johannes Berg
2009-07-23 10:14 ` [PATCH 4/7] mac80211: Replace {sw, hw}_scanning variables with a bitfield Helmut Schaa
2009-07-23 10:38   ` Johannes Berg
2009-07-23 10:46     ` Helmut Schaa
2009-07-23 10:48       ` Johannes Berg
2009-07-23 10:14 ` [PATCH 5/7] mac80211: implement basic background scanning Helmut Schaa
2009-07-23 10:39   ` Johannes Berg
2009-07-23 10:48     ` Helmut Schaa
2009-07-23 10:59       ` Johannes Berg
2009-07-23 11:18   ` [PATCH v2 " Helmut Schaa
2009-07-23 10:14 ` [PATCH 6/7] mac80211: rename scan_state to next_scan_state Helmut Schaa
2009-07-23 10:39   ` Johannes Berg
2009-07-23 10:14 ` [PATCH 7/7] cfg80211: increase scan result expire time Helmut Schaa
2009-07-23 10:39   ` Johannes Berg
2009-07-23 10:50     ` Helmut Schaa
2009-07-23 11:00       ` Johannes Berg

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).