Commit d5012734 authored by Peter Chiu's avatar Peter Chiu Committed by Felix Fietkau
Browse files

wifi: mt76: mt7996: fix invalid NSS setting when TX path differs from NSS



The maximum TX path and NSS may differ on a band. For example, one variant
of the MT7992 has 5 TX paths and 4 NSS on the 5 GHz band. To address this,
add orig_antenna_mask to record the maximum NSS and prevent setting an
invalid NSS in mt7996_set_antenna().

Fixes: 69d54ce7 ("wifi: mt76: mt7996: switch to single multi-radio wiphy")
Signed-off-by: default avatarPeter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: default avatarShayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20250515032952.1653494-5-shayne.chen@mediatek.com


Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 80fda1cd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -310,6 +310,7 @@ int mt7996_eeprom_parse_hw_cap(struct mt7996_dev *dev, struct mt7996_phy *phy)
		phy->has_aux_rx = true;

	mphy->antenna_mask = BIT(nss) - 1;
	phy->orig_antenna_mask = mphy->antenna_mask;
	mphy->chainmask = (BIT(path) - 1) << dev->chainshift[band_idx];
	phy->orig_chainmask = mphy->chainmask;
	dev->chainmask |= mphy->chainmask;
+2 −1
Original line number Diff line number Diff line
@@ -1528,7 +1528,8 @@ mt7996_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
		u8 shift = dev->chainshift[band_idx];

		phy->mt76->chainmask = tx_ant & phy->orig_chainmask;
		phy->mt76->antenna_mask = phy->mt76->chainmask >> shift;
		phy->mt76->antenna_mask = (phy->mt76->chainmask >> shift) &
					  phy->orig_antenna_mask;

		mt76_set_stream_caps(phy->mt76, true);
		mt7996_set_stream_vht_txbf_caps(phy);
+1 −0
Original line number Diff line number Diff line
@@ -312,6 +312,7 @@ struct mt7996_phy {
	struct mt76_channel_state state_ts;

	u16 orig_chainmask;
	u16 orig_antenna_mask;

	bool has_aux_rx;
	bool counter_reset;