Search Linux Wireless

Re: [PATCH] nl80211: Trigger channel switch from driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 28/09/2020 14:30, Johannes Berg wrote
using the already existing NL80211_CMD_CHANNEL_SWITCH.
I'm a little confused as to how this would work - did the driver just
*do* a channel switch? Or does it want to do a channel switch, and then
hostapd has to deal with it? Is it able to? What happens if it doesn't
do anything when this happens, e.g. an older version?

The driver "wants" to do channel switch and hostapd, once receiving the above command, will take the same action as if it received a "hostapd_cli chan_switch.

The driver will not assume channel was switched upon sending this command (it will have to wait until hostapd will handle the entire channel switch "loop").

There are many reasons why kernel driver will want to trigger a channel switch (e.g. dynamic channel selection).

With older version of hostapd, it will not be able to handle this command and nothing will happen.

+/*
+ * cfg80211_ch_switch - trigger channel switch from driver
+ * same as is can be triggered from hostapd_cli chan_switch
Not sure "same as ... hostapd_cli chan_switch" makes a lot of sense here
in the kernel-doc, tbh.
can remove the "hostapd_cli chan_switch" reference.
Also, you say "trigger" here, but ...

+ * @dev: the device which switched channels
"switched" here, which didn't help my above question at all.
Agree "wants to switch" is clearer
+ * @chandef: the new channel definition
+ * @csa_count: the number of TBTTs until the channel switch happens
though I guess this makes it a bit clearer, unless it can be zero? :)
csa_count of 0/1 is valid, but it means the channel switch will happen at the current TBTT (see ieee80211_set_csa_beacon())
+ */
+bool cfg80211_ch_switch(struct net_device *dev,
+                              struct cfg80211_chan_def *chandef,
+                              u8 csa_count);
nit: indentation
will fix
+       if (chandef->width == NL80211_CHAN_WIDTH_40) {
+               enum nl80211_channel_type chan_type = NL80211_CHAN_HT40MINUS;
+
+               if (chandef->center_freq1 > chandef->chan->center_freq)
+                       chan_type = NL80211_CHAN_HT40PLUS;
+
+               if (nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE,
+                               chan_type))
+                       goto nla_put_failure;
+       }
This a bit ties in with the "compatibility" question above - does older
hostapd even understand this? I'd suspect not, and then I'm not sure why
you'd include these attributes?
older hostapd will not handle NL80211_CMD_CHANNEL_SWITCH anyway.
The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or
privileged material. Any retransmission, dissemination, copying or
other use of, or taking of any action in reliance upon this
information is prohibited. If you received this in error, please
contact the sender and delete the material from any computer. Nothing
contained herein shall be deemed as a representation, warranty or a
commitment by Celeno. No warranties are expressed or implied,
including, but not limited to, any implied warranties of non-
infringement, merchantability and fitness for a particular purpose.
Hm. I guess I'm the "intended [...] person or entity" but I'm still a
bit wary about applying patches with that, I guess.
:) the disclaimer will be removed from now on.



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux