[OpenWrt-Devel] MAC address locations on Ubiquiti XM (ath9k)

Adrian Schmutzler mail at adrianschmutzler.de
Tue Nov 19 08:02:56 EST 2019


Hi,

by coincidence, I've learned that label MAC addresses on Ubiquiti devices aren't correct anymore after switching from phy0 to "expected" flash locations in this patch:
https://github.com/openwrt/openwrt/commit/d421a8b9448968de0e3265f5beb469c210a909ab

I've investigated that on a Ubiquiti Picostation M (ar71xx, I just happened to have access to that):

The phy seems to get calibration data from EEPROM 0x1000 (note that bullet-m image is used):
ar71xx: https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c#L97
ath79: https://github.com/openwrt/openwrt/blob/master/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom#L88

No explicit MAC address overwrite takes places. The phy0 MAC address on the device is set up correctly.

However, when I manually try to find the address in the EEPROM partition, I find it twice, with the following locations:
mtd_get_mac_binary EEPROM 0x120c
mtd_get_mac_binary EEPROM 0xa0bf

I expected it to be at 0x1002 where it is typically put by ath9k_patch_mac (offset +2).

However, I've found at least one reference to the first actual location in 10-ath9k-eeprom, for dlink,dir-825-b1:
ath9k_patch_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 0x20c

So, can someone enlighten me what the correct location (offset 0x2 vs. 0x20c) depends on?

Thanks

Adrian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20191119/097056f6/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list