[PATCH 04/12] wifi: mt76: mt7996: fix incorrect interpretation of EHT MCS caps

Kalle Valo kvalo at kernel.org
Tue Jan 23 03:16:12 PST 2024


Shayne Chen <shayne.chen at mediatek.com> writes:

> From: Benjamin Lin <benjamin-jw.lin at mediatek.com>
>
> The EHT MCS map subfield of 20 MHz-Only is not present in the EHT
> capability of AP, so STA does not need to parse the subfield.
> Moreover, AP should parse the subfield only if STA is 20 MHz-Only, which
> can be confirmed by checking supported channel width in HE capability.
>
> Fixes: 92aa2da9fa49 ("wifi: mt76: mt7996: enable EHT support in firmware")
> Co-developed-by: Shayne Chen <shayne.chen at mediatek.com>
> Signed-off-by: Shayne Chen <shayne.chen at mediatek.com>
> Signed-off-by: Benjamin Lin <benjamin-jw.lin at mediatek.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> index 3c729b563edc..02d858fdc9fe 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> @@ -1240,6 +1240,9 @@ mt7996_mcu_sta_he_6g_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
>  static void
>  mt7996_mcu_sta_eht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
>  {
> +	struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv;
> +	struct ieee80211_vif *vif = container_of((void *)msta->vif,
> +						 struct ieee80211_vif, drv_priv);

The void pointer cast looks to be unnecessary. This is nitpicking but I
really hate casts.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



More information about the Linux-mediatek mailing list