All of lore.kernel.org
 help / color / mirror / Atom feed
From: Allen Ye <allen.ye@mediatek.com>
To: <linux-wireless@vger.kernel.org>
Cc: Johannes Berg <johannes.berg@intel.com>,
	Felix Fietkau <nbd@nbd.name>,
	Lorenzo Bianconi <lorenzo.bianconi@redhat.com>,
	Evelyn Tsai <evelyn.tsai@mediatek.com>,
	"Money . Wang" <money.wang@mediatek.com>,
	<linux-mediatek@lists.infradead.org>,
	Allen.Ye <allen.ye@mediatek.com>
Subject: [PATCH] wifi: mac80211: Fix SMPS action frame ht cap check
Date: Wed, 6 Dec 2023 10:47:08 +0800	[thread overview]
Message-ID: <20231206024708.24831-1-allen.ye@mediatek.com> (raw)

From: "Allen.Ye" <allen.ye@mediatek.com>

Since there is no HT BSS in 6GHz, the HT Cap check would stop 6G HE/EHT
BSS from processing the HT action frame for SM Power Save which can be
also used in an HE BSS. Therefore, we remove the HT Cap check in 6GHz and
add the HE check accordingly.

Signed-off-by: Money.Wang <money.wang@mediatek.com>
Signed-off-by: Allen.Ye <allen.ye@mediatek.com>
---
 net/mac80211/rx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 64352e4e6d00..f8cd14dc58ec 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3482,7 +3482,8 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
 	switch (mgmt->u.action.category) {
 	case WLAN_CATEGORY_HT:
 		/* reject HT action frames from stations not supporting HT */
-		if (!rx->link_sta->pub->ht_cap.ht_supported)
+		if (status->band != NL80211_BAND_6GHZ &&
+		    !rx->link_sta->pub->ht_cap.ht_supported)
 			goto invalid;
 
 		if (sdata->vif.type != NL80211_IFTYPE_STATION &&
@@ -3502,6 +3503,12 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
 			enum ieee80211_smps_mode smps_mode;
 			struct sta_opmode_info sta_opmode = {};
 
+			if (status->band == NL80211_BAND_6GHZ &&
+			    rx->link_sta->pub->he_cap.has_he &&
+			    !(rx->link_sta->pub->he_cap.he_cap_elem.mac_cap_info[5] &
+			    IEEE80211_HE_MAC_CAP5_HE_DYNAMIC_SM_PS))
+				goto invalid;
+
 			if (sdata->vif.type != NL80211_IFTYPE_AP &&
 			    sdata->vif.type != NL80211_IFTYPE_AP_VLAN)
 				goto handled;
-- 
2.18.0


             reply	other threads:[~2023-12-06  2:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06  2:47 Allen Ye [this message]
2023-12-07  0:07 ` [PATCH] wifi: mac80211: Fix SMPS action frame ht cap check Jeff Johnson
2023-12-08  5:58   ` Allen Ye (葉芷勳)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231206024708.24831-1-allen.ye@mediatek.com \
    --to=allen.ye@mediatek.com \
    --cc=evelyn.tsai@mediatek.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=money.wang@mediatek.com \
    --cc=nbd@nbd.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.