2013-03-11 14:13:53

by Mahesh Palivela

[permalink] [raw]
Subject: [PATCH] mac80211: Enable sw scan with chan context

From: Mahesh Palivela <[email protected]>

Enable software scan with channel context in use.

Signed-off-by: Mahesh Palivela <[email protected]>
---

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



2013-03-16 12:56:56

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Enable sw scan with chan context

On Tue, 2013-03-12 at 08:39 +0530, Mahesh Palivela wrote:
> On Mon, 2013-03-11 at 17:25 +0200, Johannes Berg wrote:
> > On Mon, 2013-03-11 at 20:51 +0530, Mahesh Palivela wrote:
> >
> > > 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.

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

> 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


2013-03-12 03:09:32

by Mahesh Palivela

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Enable sw scan with chan context

On Mon, 2013-03-11 at 17:25 +0200, Johannes Berg wrote:
> On Mon, 2013-03-11 at 20:51 +0530, Mahesh Palivela wrote:
>
> > 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.

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

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

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

> > 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?


> johannes
>


2013-03-14 13:46:07

by Mahesh Palivela

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Enable sw scan with chan context

On 03/11/2013 08:55 PM, Johannes Berg wrote:
> On Mon, 2013-03-11 at 20:51 +0530, Mahesh Palivela wrote:
>
>> 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

2013-03-11 15:21:28

by Mahesh Palivela

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Enable sw scan with chan context

On 3/11/2013 8:09 PM, Johannes Berg wrote:
> On Mon, 2013-03-11 at 19:35 +0530, Mahesh Palivela wrote:
>> 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.

> johannes
>

--
Thanks,
Mahesh

2013-03-11 15:26:02

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Enable sw scan with chan context

On Mon, 2013-03-11 at 20:51 +0530, Mahesh Palivela wrote:

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

> Anyways chan context is a WIP.

It pretty much works.

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

There is, our mvm driver uses it.

> I will continue adding code for chan ctx.

What are you trying to achieve anyway?

johannes


2013-03-12 10:12:36

by Karl Beldan

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Enable sw scan with chan context

On Tue, Mar 12, 2013 at 08:39:26AM +0530, Mahesh Palivela wrote:
> On Mon, 2013-03-11 at 17:25 +0200, Johannes Berg wrote:
> > On Mon, 2013-03-11 at 20:51 +0530, Mahesh Palivela wrote:
> >
> > > 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.
>
> >
> > 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.
>
> > > 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.
>
> >
> > > 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

2013-03-11 14:39:52

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Enable sw scan with chan context

On Mon, 2013-03-11 at 19:35 +0530, Mahesh Palivela wrote:
> 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