blob: aa6763483347b3b563fa548e9f67b7989e8ef27b [file] [log] [blame]
developer05f3b2b2024-08-19 19:17:34 +08001From 8b48d9cd47d92a99b296f187aa0aa53a39af4179 Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: "Allen.Ye" <allen.ye@mediatek.com>
3Date: Thu, 30 Nov 2023 14:01:29 +0800
developer05f3b2b2024-08-19 19:17:34 +08004Subject: [PATCH 45/89] mtk: mac80211: Fix SMPS action frame cap check
developer66e89bc2024-04-23 14:50:01 +08005
6Fix SMPS action frame cap check.
7Due to 6G band doesn't have HT cap, we change cap check into each action
8frame section.
9
developer66e89bc2024-04-23 14:50:01 +080010Signed-off-by: Allen.Ye <allen.ye@mediatek.com>
developer66e89bc2024-04-23 14:50:01 +080011---
12 net/mac80211/rx.c | 8 +++++---
13 1 file changed, 5 insertions(+), 3 deletions(-)
14
15diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
developer05f3b2b2024-08-19 19:17:34 +080016index 78e9c6e..237ab52 100644
developer66e89bc2024-04-23 14:50:01 +080017--- a/net/mac80211/rx.c
18+++ b/net/mac80211/rx.c
developer05f3b2b2024-08-19 19:17:34 +080019@@ -3531,9 +3531,6 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
developer66e89bc2024-04-23 14:50:01 +080020
21 switch (mgmt->u.action.category) {
22 case WLAN_CATEGORY_HT:
23- /* reject HT action frames from stations not supporting HT */
24- if (!rx->link_sta->pub->ht_cap.ht_supported)
25- goto invalid;
26
27 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
28 sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
developer05f3b2b2024-08-19 19:17:34 +080029@@ -3552,6 +3549,11 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
developer66e89bc2024-04-23 14:50:01 +080030 enum ieee80211_smps_mode smps_mode;
31 struct sta_opmode_info sta_opmode = {};
32
33+ if (rx->link_sta->pub->he_cap.has_he &&
34+ !(rx->link_sta->pub->he_cap.he_cap_elem.mac_cap_info[5] &
35+ IEEE80211_HE_MAC_CAP5_HE_DYNAMIC_SM_PS))
36+ goto invalid;
37+
38 if (sdata->vif.type != NL80211_IFTYPE_AP &&
39 sdata->vif.type != NL80211_IFTYPE_AP_VLAN)
40 goto handled;
41--
developer05f3b2b2024-08-19 19:17:34 +0800422.18.0
developer66e89bc2024-04-23 14:50:01 +080043