summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorShayne Chen <shayne.chen@mediatek.com>2022-12-23 18:13:45 +0800
committerFelix Fietkau <nbd@nbd.name>2023-02-03 14:47:16 +0100
commiteb1fdb9f5a2280de6820624cd02e0863babab683 (patch)
treefc50a02423c8ebde8830eeb3b6f4ce8357003d44 /drivers
parent67fc7a304bf58447b621ebfee619119a3d6d9c09 (diff)
wifi: mt76: mt7996: fix chainmask calculation in mt7996_set_antenna()
Fix per-band chainmask when restoring from the dev chainmask. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7996/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
index 4421cd54311b..c423b052e4f4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
@@ -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;