linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Enable sw scan with chan context
@ 2013-03-11 14:05 Mahesh Palivela
  2013-03-11 14:39 ` Johannes Berg
  0 siblings, 1 reply; 8+ messages in thread
From: Mahesh Palivela @ 2013-03-11 14:05 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org

From: Mahesh Palivela <maheshp@posedge.com>

Enable software scan with channel context in use.

Signed-off-by: Mahesh Palivela <maheshp@posedge.com>
---

  net/mac80211/scan.c |   17 +++++++++++------
  1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 43a45cf..58076ec 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -309,10 +309,6 @@ EXPORT_SYMBOL(ieee80211_scan_completed);

  static int ieee80211_start_sw_scan(struct ieee80211_local *local)
  {
-	/* Software scan is not supported in multi-channel cases */
-	if (local->use_chanctx)
-		return -EOPNOTSUPP;
-
  	/*
  	 * Hardware/driver doesn't support hw_scan, so use software
  	 * scanning instead. First send a nullfunc frame with power save
@@ -387,9 +383,18 @@ static void ieee80211_scan_state_send_probe(struct 
ieee80211_local *local,
  {
  	int i;
  	struct ieee80211_sub_if_data *sdata;
-	enum ieee80211_band band = local->hw.conf.channel->band;
+	enum ieee80211_band band;
+	struct ieee80211_channel *scan_chan;
  	u32 tx_flags;

+	if (!local->use_chanctx) {
+		band = local->hw.conf.channel->band;
+		scan_chan = local->hw.conf.channel;
+	} else {
+		band = local->scan_channel->band;
+		scan_chan = local->scan_channel;
+	}
+
  	tx_flags = IEEE80211_TX_INTFL_OFFCHAN_TX_OK;
  	if (local->scan_req->no_cck)
  		tx_flags |= IEEE80211_TX_CTL_NO_CCK_RATE;
@@ -404,7 +409,7 @@ static void ieee80211_scan_state_send_probe(struct 
ieee80211_local *local,
  			local->scan_req->ssids[i].ssid_len,
  			local->scan_req->ie, local->scan_req->ie_len,
  			local->scan_req->rates[band], false,
-			tx_flags, local->hw.conf.channel, true);
+			tx_flags, scan_chan, true);

  	/*
  	 * After sending probe requests, wait for probe responses


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

end of thread, other threads:[~2013-03-16 12:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 14:05 [PATCH] mac80211: Enable sw scan with chan context Mahesh Palivela
2013-03-11 14:39 ` Johannes Berg
2013-03-11 15:21   ` Mahesh Palivela
2013-03-11 15:25     ` Johannes Berg
2013-03-12  3:09       ` Mahesh Palivela
2013-03-12 10:09         ` Karl Beldan
2013-03-15 15:25         ` Johannes Berg
2013-03-14 13:46       ` Mahesh Palivela

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