Skip to content

wifi: correctly represent S1G channels

Lachlan Hodges linux-wireless 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 4 repliesIn review
  2. v1 RFC3 patches 6 repliesSuperseded

Changes in v2 from the cover letter

1. Do not remove the IEEE80211_CHAN_1/2/4... flags, instead add our new flags to the end of the enum to ensure we don't break ABI. Same goes for the NL80211_FREQUENCY_ATTR_1/2/4... flags.
2. Don't declare local variables within the switch statement in cfg80211_chandef_valid() to prevent clang compiler warnings. Also rename control_khz to control_freq_khz to make it clearer why we have both control_freq and control_freq_khz.
3. Move some variable declarations into the chandef->s1g_primary_2mhz scope within cfg80211_s1g_usable()
4. Move brace to end of line when using for_each_s1g_subchan
5. Validate that the s1g_primary_2mhz flag is not set when we aren't an S1G interface within cfg80211_chandef_valid()
6. Since we aren't removing the flags anymore, we can remove ieee80211_s1g_channel_width() entirely in the last patch. Unfortunately removing it beforehand breaks the incremental build process since mac80211 still uses it in patch 1.
7. use u8_get_bits instead of FIELD_GET
8. If an error occurs when parsing the S1G operation element within ieee80211_determine_ap_chan(), ensure we fallback to 1MHz width and 1MHz primary instead of WARN_ON.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3wifi: cfg80211: correctly implement and validate S1G chandefinclude/net/cfg80211.h include/uapi/linux/nl80211.h net/wireless/chan.c +2 more+225 -1010 replies
2/3wifi: mac80211: correctly initialise S1G chandef for STAinclude/linux/ieee80211.h net/mac80211/ieee80211_i.h net/mac80211/main.c +3 more+109 -230 replies
3/3wifi: cfg80211: remove ieee80211_s1g_channel_widthinclude/net/cfg80211.h net/wireless/util.c+0 -370 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH wireless-next v2 0/3] wifi: correctly represent S1G channels

This patchset correctly supports S1G channels within cfg80211 and mac80211. Preliminary discussion can be found in [1] and the v1 RFC can be found in [2].

The goal is to align how S1G channels are represented within the chandef and validated throughout cfg80211 with how VHT is done. The S1G PHY is based on the VHT PHY, just at 1/10th the clock rate. There is, however, the introduction of 2MHz primary channels. This allow S1G interfaces to operate with either a 1MHz or 2MHz primary channel.

Changes since v1:

1. Do not remove the IEEE80211_CHAN_1/2/4... flags, instead add our new flags to the end of the enum to ensure we don't break ABI. Same goes for the NL80211_FREQUENCY_ATTR_1/2/4... flags.
2. Don't declare local variables within the switch statement in cfg80211_chandef_valid() to prevent clang compiler warnings. Also rename control_khz to control_freq_khz to make it clearer why we have both control_freq and control_freq_khz.
3. Move some variable declarations into the chandef->s1g_primary_2mhz scope within cfg80211_s1g_usable()
4. Move brace to end of line when using for_each_s1g_subchan
5. Validate that the s1g_primary_2mhz flag is not set when we aren't an S1G interface within cfg80211_chandef_valid()
6. Since we aren't removing the flags anymore, we can remove ieee80211_s1g_channel_width() entirely in the last patch. Unfortunately removing it beforehand breaks the incremental build process since mac80211 still uses it in patch 1.
7. use u8_get_bits instead of FIELD_GET
8. If an error occurs when parsing the S1G operation element within ieee80211_determine_ap_chan(), ensure we fallback to 1MHz width and 1MHz primary instead of WARN_ON.

lachlan

[1] https://lore.kernel.org/linux-wireless/xu4ftmpdwwpokw6exaprrv6wleptq7ggleiluiu6x2dzqbqfhv@6s4m3okiohzw/
[2] https://lore.kernel.org/linux-wireless/[email protected]/T/#mdb626caa000b7a1585e82856f32b5eecde9e6557

Lachlan Hodges (3):
wifi: cfg80211: correctly implement and validate S1G chandef
wifi: mac80211: correctly initialise S1G chandef for STA
wifi: cfg80211: remove ieee80211_s1g_channel_width

 include/linux/ieee80211.h    |  18 +++++-
 include/net/cfg80211.h       | 105 +++++++++++++++++++++++++++++++----
 include/uapi/linux/nl80211.h |  14 +++++
 net/mac80211/ieee80211_i.h   |   3 +-
 net/mac80211/main.c          |   6 +-
 net/mac80211/mlme.c          |  53 ++++++++++++++++--
 net/mac80211/scan.c          |  13 +++--
 net/mac80211/util.c          |  39 ++++++++++---
 net/wireless/chan.c          | 103 +++++++++++++++++++++++-----------
 net/wireless/nl80211.c       |  38 ++++++++-----
 net/wireless/reg.c           |  76 ++++++++-----------------
 net/wireless/util.c          |  27 ---------
 12 files changed, 334 insertions(+), 161 deletions(-)
Signature · 1 line
2.43.0