Commit b9d908dc authored by Johannes Berg's avatar Johannes Berg

wifi: wireless: declare different S1G chandefs incompatible

It doesn't look like we can get into this code, but make it
more robust and declare two S1G chandefs to be incompatible
unless they're identical.

Link: https://msgid.link/20240129194108.b28fb0644a8c.I9297ada5cf1baf00dbbdf8fcffd1806883489fc9@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent c478db84
...@@ -465,13 +465,18 @@ cfg80211_chandef_compatible(const struct cfg80211_chan_def *c1, ...@@ -465,13 +465,18 @@ cfg80211_chandef_compatible(const struct cfg80211_chan_def *c1,
return NULL; return NULL;
/* /*
* can't be compatible if one of them is 5 or 10 MHz, * can't be compatible if one of them is 5/10 MHz or S1G
* but they don't have the same width. * but they don't have the same width.
*/ */
if (c1->width == NL80211_CHAN_WIDTH_5 || #define NARROW_OR_S1G(width) ((width) == NL80211_CHAN_WIDTH_5 || \
c1->width == NL80211_CHAN_WIDTH_10 || (width) == NL80211_CHAN_WIDTH_10 || \
c2->width == NL80211_CHAN_WIDTH_5 || (width) == NL80211_CHAN_WIDTH_1 || \
c2->width == NL80211_CHAN_WIDTH_10) (width) == NL80211_CHAN_WIDTH_2 || \
(width) == NL80211_CHAN_WIDTH_4 || \
(width) == NL80211_CHAN_WIDTH_8 || \
(width) == NL80211_CHAN_WIDTH_16)
if (NARROW_OR_S1G(c1->width) || NARROW_OR_S1G(c2->width))
return NULL; return NULL;
if (c1->width == NL80211_CHAN_WIDTH_20_NOHT || if (c1->width == NL80211_CHAN_WIDTH_20_NOHT ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment