Use MT_MAC_APC_BSSID0_H_EN bit to indicatate we are setting BSSID for STA. Signed-off-by: Stanislaw Gruszka <sgruszka@xxxxxxxxxx> --- drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c index 59b336e34cb5..cfeae5586897 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c @@ -826,10 +826,16 @@ void mt76x02_mac_work(struct work_struct *work) void mt76x02_mac_set_bssid(struct mt76x02_dev *dev, u8 idx, const u8 *addr) { + u32 bssid_h = FIELD_PREP(MT_MAC_APC_BSSID_H_ADDR, + get_unaligned_le16(addr + 4)); + u32 bssid_l = get_unaligned_le32(addr); + + if (idx > 7) + bssid_h |= MT_MAC_APC_BSSID0_H_EN; + idx &= 7; - mt76_wr(dev, MT_MAC_APC_BSSID_L(idx), get_unaligned_le32(addr)); - mt76_rmw_field(dev, MT_MAC_APC_BSSID_H(idx), MT_MAC_APC_BSSID_H_ADDR, - get_unaligned_le16(addr + 4)); + mt76_wr(dev, MT_MAC_APC_BSSID_L(idx), bssid_l); + mt76_wr(dev, MT_MAC_APC_BSSID_H(idx), bssid_h); } static int -- 1.9.3