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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Stella Liu <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Stella Liu
2026-08-25 11:25:29 +02:00
committed by Felix Fietkau
parent 1f394b9c42
commit d19401e5d3
+7 -5
View File
@@ -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;