2023-12-06 02:48:39

by Allen Ye (葉芷勳)

[permalink] [raw]
Subject: [PATCH] wifi: mac80211: Fix SMPS action frame ht cap check

From: "Allen.Ye" <[email protected]>

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 <[email protected]>
Signed-off-by: Allen.Ye <[email protected]>
---
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



2023-12-07 00:07:35

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH] wifi: mac80211: Fix SMPS action frame ht cap check

On 12/5/2023 6:47 PM, Allen Ye wrote:
> From: "Allen.Ye" <[email protected]>
>
> 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 <[email protected]>
> Signed-off-by: Allen.Ye <[email protected]>
> ---
> 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)

we had found the same issue and were preparing a patch that changed this to:
+ if (!rx->link_sta->pub->ht_cap.ht_supported &&
+ !rx->link_sta->pub->he_cap.has_he)

I see you added the has_he check below, but curious if it is better to
do it here to short circuit the tests that follow

> 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;


2023-12-08 05:59:19

by Allen Ye (葉芷勳)

[permalink] [raw]
Subject: Re: [PATCH] wifi: mac80211: Fix SMPS action frame ht cap check

On Wed, 2023-12-06 at 16:07 -0800, Jeff Johnson wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> On 12/5/2023 6:47 PM, Allen Ye wrote:
> > From: "Allen.Ye" <[email protected]>
> >
> > 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 <[email protected]>
> > Signed-off-by: Allen.Ye <[email protected]>
> > ---
> > 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)
>
> we had found the same issue and were preparing a patch that changed
> this to:
> +if (!rx->link_sta->pub->ht_cap.ht_supported &&
> + !rx->link_sta->pub->he_cap.has_he)
>
> I see you added the has_he check below, but curious if it is better
> to
> do it here to short circuit the tests that follow
Hi Jeff,

Thanks for your comment. Your patch can fix the issue, and is better to
check the action frame more quickly.
>
> > 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;
>

As for our patch, we recheck the HE capabilities and confirm that the
check of the dynamic SMPS cap is unnecessary. The dynamic SMPS cap is
used to allow AP to use a trigger frame to start a FES not refer to the
SMPS cap.

Thanks,
Allen