On 12/19/2024 4:29 PM, Johannes Berg wrote:
On Thu, 2024-12-19 at 16:27 +0530, Kavita Kavita wrote:
On 12/19/2024 2:31 PM, Johannes Berg wrote:
On Thu, 2024-12-19 at 11:35 +0530, Kavita Kavita wrote:
The for_each_subchan() macro will not work for this. When sub channel is
null, it will terminate the loop, but in this case, we should continue
checking other sub channels.
Wait, I'm confused by what you're saying here. The for_each_subchan()
macro should iterate over all enabled (not punctured) subchannels, so
why would it not be applicable here?
So, In the following regulatory checks: cfg80211_get_chans_dfs_required,
cfg80211_get_chans_dfs_usable, cfg80211_get_chans_dfs_available, and so on.
When iterating over primary or secondary bandwidth, if we encounter any
null subchannel,
What do you mean by "null subchannel"?
For example,
Please refer below Implementation of cfg80211_get_chans_dfs_required:
for (freq = start_freq; freq <= end_freq; freq += MHZ_TO_KHZ(20)) {
c = ieee80211_get_channel_khz(wiphy, freq);
if (!c)
return -EINVAL;
I handled this above "if" case within the macro itself, so when this
case occurs, the loop terminates and does not check further subchannels.
Now, please refer below Implementation of cfg80211_set_chans_dfs_state:
for (freq = center_freq - bandwidth/2 + 10;
freq <= center_freq + bandwidth/2 - 10;
freq += 20) {
c = ieee80211_get_channel(wiphy, freq);
if (!c || !(c->flags & IEEE80211_CHAN_RADAR))
continue;
However, for cfg80211_set_chans_dfs_state, we should iterate over all
subchannels, even if any subchannel is null or radar detected.
That is why I haven't used the for_each_subchan macro for
cfg80211_set_chans_dfs_state.
I will fix this in the updated patch to make the for_each_subchan macro
applicable for all.
In all of these cases, if you have e.g. the following 320 MHz channel,
where "x" indicates removed by puncturing:
| | | | | | | | | | | | |x|x| | |
then of course it should iterate over all the non-removed 14
subchannels, not just the first 12?
Yes, You are correct. The for_each_subchan macro will check all the 14
non-punctured subchannels.
the loop will terminate, and we will not check the
remaining subchannels.
As you write it here, that seems wrong for all cases?
johannes