[PATCH 1/4] wifi: mt76: mt7663s: don't advertise random MAC address scans

Ryan Brue ryanbrue.dev at gmail.com
Mon Oct 26 12:10:36 PDT 2026


With the MT7663 offload firmware (N9 3.1.1, build 20200604161656) on
SDIO, a hw scan with NL80211_SCAN_FLAG_RANDOM_ADDR completes in about
50 ms with no results, while the same scan without the flag takes about
5 s and finds every BSS in range:

  iw dev wlan0 scan flush            -> 17-23 BSSes in 5 s
  iw dev wlan0 scan flush randomise  -> 0 BSSes in 0.05 s

NetworkManager randomizes the scan address by default, so on an
mt7663s it lists no networks, or only the few whose beacons happen to
arrive during a scan, and it can't find the network it is configured
for.

Stop advertising NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR on SDIO, so user
space falls back to the device address. Scheduled scans have their own
MT7663 request layout and are left alone. Only the SDIO variant was
tested; the PCIe and USB ones load the same firmware and may need the
same treatment.

Fixes: a66cbdd6573d ("mt76: mt7615: introduce mt7663s support")
Signed-off-by: Ryan Brue <ryanbrue.dev at gmail.com>
---
 drivers/net/wireless/mediatek/mt76/mt7615/init.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/init.c b/drivers/net/wireless/mediatek/mt76/mt7615/init.c
index 665b0f1e939f..e6685c51fa6e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/init.c
@@ -200,6 +200,12 @@ mt7615_check_offload_capability(struct mt7615_dev *dev)
 				   WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
 				   NL80211_FEATURE_P2P_GO_CTWIN |
 				   NL80211_FEATURE_P2P_GO_OPPPS;
+		/*
+		 * On SDIO the firmware ends a hw scan with a random source
+		 * address at once, with no results.
+		 */
+		if (mt76_is_sdio(&dev->mt76))
+			wiphy->features &= ~NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;
 	} else {
 		dev->ops->hw_scan = NULL;
 		dev->ops->cancel_hw_scan = NULL;

-- 
2.55.0




More information about the Linux-mediatek mailing list