Skip to contentSkip to conversation

mac80211: Enable sw scan with chan context

PATCH In review Mahesh Palivela 3 participants 8 messages Mar 11, 2013 – Mar 16, 2013 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: Enable sw scan with chan context

From: Mahesh Palivela <[email protected]>

Enable software scan with channel context in use.

---

 net/mac80211/scan.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)
net/mac80211/scan.c +11 -6
index 43a45cf..58076ec 100644
@@ -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
maintainer
#1 lore raw
Quoted 3 lines · Mahesh Palivela

From: Mahesh Palivela <[email protected]>

Enable software scan with channel context in use.

I don't think this will even work, but even if it did I think it's too painful with off-channel etc.

johannes

#2 lore raw
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Mahesh Palivela

From: Mahesh Palivela <[email protected]>

Enable software scan with channel context in use.

I don't think this will even work, but even if it did I think it's too painful with off-channel etc.

I tested this patch. scan works. Anyways chan context is a WIP. There is no driver which is using the chan ctx work yet. I will continue adding code for chan ctx.

Quoted 2 lines

johannes

Signature · 2 lines
Thanks,
Mahesh
maintainer
#3 lore raw
Quoted 1 line · Mahesh Palivela

I tested this patch. scan works.

Works how? It never tells the driver to go to a different channel ...

Besides, telling the driver to go to one channel via the hw_config call, and using chanctx for vif configuration seems like a really bad idea.

Quoted 1 line

Anyways chan context is a WIP.

It pretty much works.

Quoted 1 line

There is no driver which is using the chan ctx work yet.

There is, our mvm driver uses it.

Quoted 1 line

I will continue adding code for chan ctx.

What are you trying to achieve anyway?

johannes

#4 lore raw
Quoted 5 lines · Johannes Berg
Quoted 1 line · Mahesh Palivela

I tested this patch. scan works.

Works how? It never tells the driver to go to a different channel ...

sorry. I missed this. But my patch takes care of crash in mac80211 once we remove 'use_chanctx' check in sw_scan function.

Quoted 4 lines

Besides, telling the driver to go to one channel via the hw_config call, and using chanctx for vif configuration seems like a really bad idea.

Agree.

Quoted 3 lines
Quoted 1 line

Anyways chan context is a WIP.

It pretty much works.

For AP mode yes it works. But for STA mode, we have work I guess.

Quoted 5 lines
Quoted 2 lines

There is no driver which is using the chan ctx work yet.

There is, our mvm driver uses it.

Thanks for the info. I will take a look.

Quoted 4 lines
Quoted 1 line

I will continue adding code for chan ctx.

What are you trying to achieve anyway?

VHT assoc. To enable VHT on both AP and STA. For VHT to work we need chan_ctx. Isn't it?

Quoted 2 lines

johannes

#5 lore raw
Quoted 15 lines · Mahesh Palivela
Quoted 5 lines · Johannes Berg
Quoted 1 line · Mahesh Palivela

I tested this patch. scan works.

Works how? It never tells the driver to go to a different channel ...

sorry. I missed this. But my patch takes care of crash in mac80211 once we remove 'use_chanctx' check in sw_scan function.

Quoted 4 lines

Besides, telling the driver to go to one channel via the hw_config call, and using chanctx for vif configuration seems like a really bad idea.

Quoted 14 lines

Agree.

Quoted 3 lines
Quoted 1 line

Anyways chan context is a WIP.

It pretty much works.

For AP mode yes it works. But for STA mode, we have work I guess.

Quoted 5 lines
Quoted 2 lines

There is no driver which is using the chan ctx work yet.

There is, our mvm driver uses it.

It uses hw scan and roc, and thus can use the chanctxes as is.

Karl

maintainer
#6 lore raw
In reply to Mahesh Palivela
Quoted 9 lines · Mahesh Palivela
Quoted 5 lines · Johannes Berg
Quoted 1 line · Mahesh Palivela

I tested this patch. scan works.

Works how? It never tells the driver to go to a different channel ...

sorry. I missed this. But my patch takes care of crash in mac80211 once we remove 'use_chanctx' check in sw_scan function.

Yes, but it doesn't make it *do* anything, so the patch is completely pointless. I don't see how chanctx and SW scan/roc can ever possibly work together.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Anyways chan context is a WIP.

It pretty much works.

For AP mode yes it works. But for STA mode, we have work I guess.

You may have, but in mac80211 it should work just as designed.

Quoted 2 lines

VHT assoc. To enable VHT on both AP and STA. For VHT to work we need chan_ctx. Isn't it?

Right now, yes, you do.

However, I would argue that if you really want only VHT support, you should remove the channel/channel_type fields from struct ieee80211_conf and instead add a cfg80211_chan_def. This means a lot of changes in all the drivers, but I'd hate to see the data all duplicated, and the changes are trivial anyway.

johannes

#7 lore raw
In reply to Johannes Berg
Quoted 7 lines · Johannes Berg
Quoted 1 line · Mahesh Palivela

I tested this patch. scan works.

Works how? It never tells the driver to go to a different channel ...

Besides, telling the driver to go to one channel via the hw_config call, and using chanctx for vif configuration seems like a really bad idea.

I think hw_config() should be modified to add vif param and call drivers? can we proceed with that approach?

Thanks,
Mahesh