We utilize many Routerboard 751's and discovered that our latest batch
of RB751's would not initialize the wireless radio. We have determined
Mikrotik has changed where the mac address was located inside
hardconfig. As such we utilize "routerboot_find_tag" to find the
location of the mac address. We should remove
"RB751_MAC_ADDRESS_OFFSET" as it is ambiguous by machine manufacturing
date. The newer batch of RB751's that we received had a
RB751_MAC_ADDRESS_OFFSET 0x10.

Signed-off-by: Davey Hutchison <[email protected]>

--- target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c
+++ target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c
@@ -282,7 +282,6 @@

 #define RB751_HARDCONFIG       0x1f00b000
 #define RB751_HARDCONFIG_SIZE  0x1000
-#define RB751_MAC_ADDRESS_OFFSET 0xE80

 static void __init rb751_wlan_setup(void)
 {
@@ -290,6 +289,8 @@
        struct ath9k_platform_data *wmac_data;
        u16 tag_len;
        u8 *tag;
+       u16 mac_len;
+       u8 *mac;
        int err;

        wmac_data = ap9x_pci_get_wmac_data(0);
@@ -313,8 +314,15 @@
                pr_err("rb75x: unable to decode wlan eeprom data\n");
                return;
        }
+
+       err = routerboot_find_tag(hardconfig, RB751_HARDCONFIG_SIZE,
+                                 RB_ID_MAC_ADDRESS_PACK, &mac, &mac_len);
+       if (err) {
+               pr_err("rb75x: no mac address found\n");
+               return;
+       }

-       ap91_pci_init(NULL, hardconfig + RB751_MAC_ADDRESS_OFFSET);
+       ap91_pci_init(NULL, mac);
 }

 static void __init rb751_setup(void)
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to