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