From d19401e5d35943fd9dd491119ddee3dc15ddf175 Mon Sep 17 00:00:00 2001 From: Stella Liu Date: Mon, 24 Aug 2026 14:52:19 -0500 Subject: [PATCH] wifi: mt76: mt7925: use OFDM-only PHY mode for NAN STA records NAN operates with OFDM and does not support CCK, so the phy, rate control and BSS rate TLVs must not fall back to 2.4 GHz. Borrow the 5 GHz band lookup to keep the STA records OFDM-only. Fixes: 9824fb4edbf3 ("wifi: mt76: mt7925: add NAN MCU handling") Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Stella Liu Link: https://patch.msgid.link/20260824195227.12589-8-sean.wang@kernel.org Signed-off-by: Felix Fietkau --- mt7925/mcu.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mt7925/mcu.c b/mt7925/mcu.c index f7cbe292..ea8ce48a 100644 --- a/mt7925/mcu.c +++ b/mt7925/mcu.c @@ -1908,11 +1908,9 @@ mt7925_mcu_sta_phy_tlv(struct sk_buff *skb, phy = (struct sta_rec_phy *)tlv; if (mt7925_vif_is_nan(vif)) { - enum nl80211_band band = chandef->chan ? chandef->chan->band - : NL80211_BAND_2GHZ; phy->phy_type = PHY_TYPE_BIT_OFDM | PHY_TYPE_BIT_ERP; phy->phy_type |= mt76_connac_get_phy_mode_v2(mvif->phy->mt76, vif, - band, + NL80211_BAND_5GHZ, link_sta); } else { phy->phy_type = mt76_connac_get_phy_mode_v2(mvif->phy->mt76, vif, @@ -1997,7 +1995,11 @@ mt7925_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, ra_info = (struct sta_rec_ra_info *)tlv; if (mt7925_vif_is_nan(vif)) - band = chandef->chan ? chandef->chan->band : NL80211_BAND_2GHZ; + /* NAN is OFDM-only per spec; borrow the 5 GHz band lookup to + * avoid PHY_TYPE_BIT_HR_DSSS/CCK bits being added to phy_type. + * NAN interfaces have no chanctx, so chandef->chan is always NULL. + */ + band = NL80211_BAND_5GHZ; else band = chandef->chan->band; @@ -2841,7 +2843,7 @@ mt7925_mcu_bss_bmc_tlv(struct sk_buff *skb, struct mt792x_phy *phy, bmc = (struct bss_rate_tlv *)tlv; if (mt7925_vif_is_nan(vif)) - band = chandef->chan ? chandef->chan->band : NL80211_BAND_2GHZ; + band = NL80211_BAND_5GHZ; else band = chandef->chan->band;