mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 21:36:52 +00:00
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: 69d54ce7491d ("wifi: mt76: mt7996: switch to single multi-radio wiphy")
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
7d30840e5b
commit
bf22595a1d
@@ -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
@@ -1526,7 +1526,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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user