Skip to content

Commit eb1fdb9

Browse files
csyuancnbd168
authored andcommitted
wifi: mt76: mt7996: fix chainmask calculation in mt7996_set_antenna()
Fix per-band chainmask when restoring from the dev chainmask. Fixes: 98686cd ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
1 parent 67fc7a3 commit eb1fdb9

File tree

1 file changed

+4
-1
lines changed
  • drivers/net/wireless/mediatek/mt76/mt7996

1 file changed

+4
-1
lines changed

drivers/net/wireless/mediatek/mt76/mt7996/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,10 @@ mt7996_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
880880
phy->mt76->antenna_mask = tx_ant;
881881

882882
/* restore to the origin chainmask which might have auxiliary path */
883-
if (hweight8(tx_ant) == max_nss)
883+
if (hweight8(tx_ant) == max_nss && band_idx < MT_BAND2)
884+
phy->mt76->chainmask = ((dev->chainmask >> shift) &
885+
(BIT(dev->chainshift[band_idx + 1] - shift) - 1)) << shift;
886+
else if (hweight8(tx_ant) == max_nss)
884887
phy->mt76->chainmask = (dev->chainmask >> shift) << shift;
885888
else
886889
phy->mt76->chainmask = tx_ant << shift;

0 commit comments

Comments
 (0)