From d4173587c12c78724b0adb8e43a57a8e97085a3f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Jun 2026 08:03:44 +0000 Subject: [PATCH] mt76x02: fix client mode authentication by supporting all 16 BSSID slots Change the BSSID index mask from 7 to 0xf in mt76x02_mac_set_bssid() to properly support all 16 hardware BSSID slots (0-15). The hardware is configured for "8 APs + 8 STAs" mode where: - Indices 0-7 are used for AP mode - Indices 8-15 are used for client (STA) mode The previous mask of 7 (0b0111) was truncating client mode indices 8-15 back to 0-7, causing client interfaces to write their BSSID to the wrong hardware register. This resulted in the hardware not recognizing the AP's BSSID during authentication, leading to authentication timeouts. Fixes authentication timeout issue when mt7612/mt7662 operates in client mode. --- mt76x02_mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mt76x02_mac.c b/mt76x02_mac.c index 0e73674..edf8a72 100644 --- a/mt76x02_mac.c +++ b/mt76x02_mac.c @@ -1237,7 +1237,7 @@ EXPORT_SYMBOL_GPL(mt76x02_mac_cc_reset); void mt76x02_mac_set_bssid(struct mt76x02_dev *dev, u8 idx, const u8 *addr) { - idx &= 7; + idx &= 0xf; 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));