2014-01-24 13:29:38

by Janusz Dziedzic

[permalink] [raw]
Subject: [PATCH] cfg80211: set preset_chandef after channel switch

Set preset_chandef in channel switch notification.
In other case we will have old preset_chandef.

Signed-off-by: Janusz Dziedzic <[email protected]>
---
net/wireless/nl80211.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d0afd82..dc8621d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -11144,6 +11144,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
return;

wdev->channel = chandef->chan;
+ wdev->preset_chandef = *chandef;
nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL);
}
EXPORT_SYMBOL(cfg80211_ch_switch_notify);
--
1.7.9.5



2014-01-24 14:07:30

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: set preset_chandef after channel switch

On Fri, 2014-01-24 at 14:29 +0100, Janusz Dziedzic wrote:
> Set preset_chandef in channel switch notification.
> In other case we will have old preset_chandef.

Why would we care? We only keep the preset_chandef thing around because
hostapd (currently) doesn't pass the frequency to START_AP/the first
SET_BEACON, but after that this doesn't matter. And when you shut down
hostapd, and restart it, then it'll set the preset_chandef again through
explicitly setting the channel.

So in which case would we care? Who would ever STOP_AP and then START_AP
without a new frequency?

johannes


2014-01-29 12:46:52

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: set preset_chandef after channel switch

On Fri, 2014-01-24 at 14:29 +0100, Janusz Dziedzic wrote:
> Set preset_chandef in channel switch notification.
> In other case we will have old preset_chandef.

Applied.

johannes


2014-01-24 21:33:48

by Janusz Dziedzic

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: set preset_chandef after channel switch

2014/1/24 Johannes Berg <[email protected]>:
> On Fri, 2014-01-24 at 14:29 +0100, Janusz Dziedzic wrote:
>> Set preset_chandef in channel switch notification.
>> In other case we will have old preset_chandef.
>
> Why would we care? We only keep the preset_chandef thing around because
> hostapd (currently) doesn't pass the frequency to START_AP/the first
> SET_BEACON, but after that this doesn't matter. And when you shut down
> hostapd, and restart it, then it'll set the preset_chandef again through
> explicitly setting the channel.
>
> So in which case would we care? Who would ever STOP_AP and then START_AP
> without a new frequency?
>

We have test code in cfg80211 that using preset_chandef when compare
chandefs when csa.
And after that I see we never change preset_chandef after csa.

>From other side, I could imagine case where we have two VAPs in hostapd.
- first we start first VAPs (eg. channel 36 HT40+)
- next we call CSA (channel 44 HT40+)
- now we start second VAPs - we will get err here because of
preset_chandef (36 HT40+)

BR
Janusz


--
Janusz Dziedzic