2023-02-15 11:26:57

by Youghandhar Chintala

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: cfg80211: Add beacon hint notifier support


On 1/18/2023 10:00 PM, Johannes Berg wrote:
>> +++ b/include/net/cfg80211.h
>> @@ -5386,6 +5386,8 @@ struct wiphy {
>> void (*reg_notifier)(struct wiphy *wiphy,
>> struct regulatory_request *request);
>>
>> + void (*beacon_hint_notifier)(struct wiphy *wiphy);
>
> missing documentation, for sure
I will add the missed documentation in next version of patch.
> Also this should probably be in the ops, rather than here? Not sure why
> reg_notifier is here.
I followed reg_notifier implementation.
>> - if (channel_changed)
>> + if (channel_changed) {
>> nl80211_send_beacon_hint_event(wiphy, &chan_before, chan);
>> + if (wiphy->beacon_hint_notifier)
>> + wiphy->beacon_hint_notifier(wiphy);
>> + }
> This also seems excessive if you're not even passing the channel - you
> call it for every (affected) channel, but you don't tell it anything
> about the channel? Seems strange.
I will address this in next version of patch.
>
>
> However ...
>
> Why is this even needed? You should always get reg_notifier after this
> anyway?
>
> johannes

Currently when channel flag changed through the beacon hints are not
informed to driver.

reg_notifier will be triggered for regdomain changes but not for channel flag changes due to beacon hints.

Regards,
Youghandhar



2023-02-15 15:10:19

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: cfg80211: Add beacon hint notifier support

> >
> > Why is this even needed? You should always get reg_notifier after this
> > anyway?
>
> Currently when channel flag changed through the beacon hints are not
> informed to driver.
>
> reg_notifier will be triggered for regdomain changes but not for channel flag changes due to beacon hints.
>

So maybe triggering reg notifier once would be sufficient, a la Wen's
patch that I recently merged?

johannes

2023-02-22 00:23:06

by Wen Gong

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: cfg80211: Add beacon hint notifier support


On 2/15/2023 11:10 PM, Johannes Berg wrote:
>>> Why is this even needed? You should always get reg_notifier after this
>>> anyway?
>> Currently when channel flag changed through the beacon hints are not
>> informed to driver.
>>
>> reg_notifier will be triggered for regdomain changes but not for channel flag changes due to beacon hints.
>>
> So maybe triggering reg notifier once would be sufficient, a la Wen's
> patch that I recently merged?

My patch only take effect for this flag, not for all wiphy.

if (wiphy->flags & WIPHY_FLAG_NOTIFY_REGDOM_BY_DRIVER)

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit?id=d99975c4953eb79e389d4630e848435c700e2dfc

>
> johannes
>

2023-02-22 08:01:13

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: cfg80211: Add beacon hint notifier support

On Wed, 2023-02-22 at 08:22 +0800, Wen Gong wrote:
> On 2/15/2023 11:10 PM, Johannes Berg wrote:
> > > > Why is this even needed? You should always get reg_notifier after this
> > > > anyway?
> > > Currently when channel flag changed through the beacon hints are not
> > > informed to driver.
> > >
> > > reg_notifier will be triggered for regdomain changes but not for channel flag changes due to beacon hints.
> > >
> > So maybe triggering reg notifier once would be sufficient, a la Wen's
> > patch that I recently merged?
>
> My patch only take effect for this flag, not for all wiphy.
>
> if (wiphy->flags & WIPHY_FLAG_NOTIFY_REGDOM_BY_DRIVER)
>
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit?id=d99975c4953eb79e389d4630e848435c700e2dfc
>

Oh sure, I meant this patch could do something similar, instead of
introducing a new notifier callback.

johannes