blob: 794407f38e1de452ceb8358e39f89a3fde09d9da [file] [log] [blame]
developer43a264f2024-03-26 14:09:54 +08001From 9ff05c938d2a2b82d022aa8f671d2333cd8a992a Mon Sep 17 00:00:00 2001
developerd243af02023-12-21 14:49:33 +08002From: "Allen.Ye" <allen.ye@mediatek.com>
3Date: Thu, 30 Nov 2023 14:01:29 +0800
developer43a264f2024-03-26 14:09:54 +08004Subject: [PATCH 35/37] mtk: mac80211: Fix SMPS action frame cap check
developerd243af02023-12-21 14:49:33 +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
10Signed-off-by: Allen.Ye <allen.ye@mediatek.com>
11---
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
developer43a264f2024-03-26 14:09:54 +080016index 0cf8c59..fe3a538 100644
developerd243af02023-12-21 14:49:33 +080017--- a/net/mac80211/rx.c
18+++ b/net/mac80211/rx.c
developer43a264f2024-03-26 14:09:54 +080019@@ -3493,9 +3493,6 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
developerd243af02023-12-21 14:49:33 +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 &&
developer43a264f2024-03-26 14:09:54 +080029@@ -3514,6 +3511,11 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
developerd243af02023-12-21 14:49:33 +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--
422.18.0
43