Search Linux Wireless

[PATCH] mac80211: Enable sw scan with chan context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mahesh Palivela <maheshp@xxxxxxxxxxx>

Enable software scan with channel context in use.

Signed-off-by: Mahesh Palivela <maheshp@xxxxxxxxxxx>
---

 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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux