The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7c8425858944a20c92164d4dd537ee7a8308072b
commit 7c8425858944a20c92164d4dd537ee7a8308072b Author: Bjoern A. Zeeb <[email protected]> AuthorDate: 2026-02-05 00:20:04 +0000 Commit: Bjoern A. Zeeb <[email protected]> CommitDate: 2026-02-26 23:01:33 +0000 mt76: fix a check wrongly giving us random ether addresses all the time Do not cover the is_valid_ether_addr() check under CONFIG_OF. Unclear if this is an initial porting or a merging error before the driver hit the FreeBSD src tree. The end result was that we always got a random link-layer address, while the individual drivers may have setup phy->macaddr and this function would only overwride if given in device tree. Only if both, driver and and the OF backup, fail then go and use the random link-layer address. While here adjust printing the random link-layer address using a FreeBSD format specifier and not the unsupported Linux one. Fixes: 6c92544d7c97 Sponsored by: The FreeBSD Foundation (cherry picked from commit 3afe9e12fb331dc698ac62f3b918d82d768a2792) --- sys/contrib/dev/mediatek/mt76/eeprom.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/contrib/dev/mediatek/mt76/eeprom.c b/sys/contrib/dev/mediatek/mt76/eeprom.c index 1d5b95226a16..99e1bca3c19f 100644 --- a/sys/contrib/dev/mediatek/mt76/eeprom.c +++ b/sys/contrib/dev/mediatek/mt76/eeprom.c @@ -186,16 +186,19 @@ mt76_eeprom_override(struct mt76_phy *phy) err = of_get_mac_address(np, phy->macaddr); if (err == -EPROBE_DEFER) return err; +#endif if (!is_valid_ether_addr(phy->macaddr)) { -#endif eth_random_addr(phy->macaddr); dev_info(dev->dev, +#if defined(__linux__) "Invalid MAC address, using random address %pM\n", phy->macaddr); -#if defined(CONFIG_OF) - } +#elif defined(__FreeBSD__) + "Invalid MAC address, using random address %6D\n", + phy->macaddr, ":"); #endif + } return 0; }
