Commit eb1fdb9f authored by Shayne Chen's avatar Shayne Chen Committed by Felix Fietkau

wifi: mt76: mt7996: fix chainmask calculation in mt7996_set_antenna()

Fix per-band chainmask when restoring from the dev chainmask.

Fixes: 98686cd2 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: default avatarShayne Chen <shayne.chen@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 67fc7a30
......@@ -880,7 +880,10 @@ mt7996_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
phy->mt76->antenna_mask = tx_ant;
/* restore to the origin chainmask which might have auxiliary path */
if (hweight8(tx_ant) == max_nss)
if (hweight8(tx_ant) == max_nss && band_idx < MT_BAND2)
phy->mt76->chainmask = ((dev->chainmask >> shift) &
(BIT(dev->chainshift[band_idx + 1] - shift) - 1)) << shift;
else if (hweight8(tx_ant) == max_nss)
phy->mt76->chainmask = (dev->chainmask >> shift) << shift;
else
phy->mt76->chainmask = tx_ant << shift;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment