]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mac80211: skip all known membership selectors
authorBenjamin Berg <benjamin.berg@intel.com>
Wed, 1 Jan 2025 05:05:33 +0000 (07:05 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 13 Jan 2025 14:26:45 +0000 (15:26 +0100)
The GLK and EPD Selectors are also not rates, so add a new macro for the
minimum value of a selector and test against that instead of the entire
list. Also fix the typo in the EPD selector define.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.2c19a2dc53db.If187b7d93d8b43a6c70e422c837b7636538fb358@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/linux/ieee80211.h
net/mac80211/mlme.c

index 9c0e2617fe8f03e8241aa24cb416a74d36d0ae26..745c3b125d976e31771ee657b8a187074eaf272a 100644 (file)
@@ -1542,11 +1542,13 @@ struct ieee80211_mgmt {
 #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
 #define BSS_MEMBERSHIP_SELECTOR_VHT_PHY        126
 #define BSS_MEMBERSHIP_SELECTOR_GLK    125
-#define BSS_MEMBERSHIP_SELECTOR_EPS    124
+#define BSS_MEMBERSHIP_SELECTOR_EPD    124
 #define BSS_MEMBERSHIP_SELECTOR_SAE_H2E 123
 #define BSS_MEMBERSHIP_SELECTOR_HE_PHY 122
 #define BSS_MEMBERSHIP_SELECTOR_EHT_PHY        121
 
+#define BSS_MEMBERSHIP_SELECTOR_MIN    BSS_MEMBERSHIP_SELECTOR_EHT_PHY
+
 /* mgmt header + 1 byte category code */
 #define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u)
 
index 11689b7ab478537485387cc1ec640bed045803f1..82692c68128f9f2a8aa44b907ed567d948132d09 100644 (file)
@@ -4641,18 +4641,13 @@ static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
                        *have_higher_than_11mbit = true;
 
                /*
-                * Skip HT, VHT, HE, EHT and SAE H2E only BSS membership
-                * selectors since they're not rates.
+                * Skip membership selectors since they're not rates.
                 *
                 * Note: Even though the membership selector and the basic
                 *       rate flag share the same bit, they are not exactly
                 *       the same.
                 */
-               if (supp_rates[i] == (0x80 | BSS_MEMBERSHIP_SELECTOR_HT_PHY) ||
-                   supp_rates[i] == (0x80 | BSS_MEMBERSHIP_SELECTOR_VHT_PHY) ||
-                   supp_rates[i] == (0x80 | BSS_MEMBERSHIP_SELECTOR_HE_PHY) ||
-                   supp_rates[i] == (0x80 | BSS_MEMBERSHIP_SELECTOR_EHT_PHY) ||
-                   supp_rates[i] == (0x80 | BSS_MEMBERSHIP_SELECTOR_SAE_H2E))
+               if (supp_rates[i] >= (0x80 | BSS_MEMBERSHIP_SELECTOR_MIN))
                        continue;
 
                for (j = 0; j < sband->n_bitrates; j++) {