[PATCH 6/9] DFS: introduce hostapd_dfs_request_channel_switch routine

Lorenzo Bianconi lorenzo.bianconi at redhat.com
Fri Mar 4 03:52:12 PST 2022


> On Mon, Dec 20, 2021 at 04:48:21PM +0100, Lorenzo Bianconi wrote:
> > This is a preliminary patch to add Channel Switch Announcement for
> > background radar detection.
> 
> > diff --git a/src/ap/dfs.c b/src/ap/dfs.c
> > @@ -940,6 +940,85 @@ int hostapd_is_dfs_chan_available(struct hostapd_iface *iface)
> >  
> > +static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
> 
> > +	struct hostapd_hw_modes *cmode = iface->current_mode;
> > +	int ieee80211_mode = IEEE80211_MODE_AP, err, i;
> 
> That i needs to be unsigned int (like it was in the function from which
> it was moved to here) to avoid a compiler warning.

ack, I will fix it

> 
> > +	u8 new_vht_oper_chwidth;
> 
> > +	new_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf);
> > +	hostapd_set_oper_chwidth(iface->conf,
> > +				 hostapd_get_oper_chwidth(iface->conf));
> 
> This looks quite strange.. hostapd_dfs_start_channel_switch() used
> current_vht_oper_chwidth to store the current value from beginning of
> the function and restored it at this location. The new version in this
> helper function seems to something strange, or well, nothing. That does
> not feel correct.
> 
> >  static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
> >  {
> > -	unsigned int i;
> 
> That's where i was unsigned..
> 
> > -	u8 current_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf);
> 
> And that's where the current value is picked at the beginning of
> hostapd_dfs_start_channel_switch().
> 
> > -	new_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf);
> > -	hostapd_set_oper_chwidth(iface->conf, current_vht_oper_chwidth);
> 
> And this looks quite different compared to what was in the new helper
> function.

ack, I will fix it.

Regards,
Lorenzo

> 
> -- 
> Jouni Malinen                                            PGP id EFC895FA
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20220304/2db53390/attachment-0001.sig>


More information about the Hostap mailing list