Index: sys/mips/atheros/if_arge.c =================================================================== --- sys/mips/atheros/if_arge.c (revision 254678) +++ sys/mips/atheros/if_arge.c (working copy) @@ -371,6 +371,7 @@ uint32_t hint; long eeprom_mac_addr = 0; int miicfg = 0; + int readascii = 0; sc = device_get_softc(dev); sc->arge_dev = dev; @@ -384,16 +385,28 @@ * Since multiple units seem to use this feature, include * a method of setting the MAC address based on an flash location * in CPU address space. + * + * Some vendors have decided to store the mac address as a literal + * string of 18 characters in xx:xx:xx:xx:xx:xx format instead of + * an array of numbers. Expose a hint to turn on this conversion + * feature via strtol() */ - if (sc->arge_mac_unit == 0 && - resource_long_value(device_get_name(dev), device_get_unit(dev), + if (resource_long_value(device_get_name(dev), device_get_unit(dev), "eeprommac", &eeprom_mac_addr) == 0) { int i; const char *mac = (const char *) MIPS_PHYS_TO_KSEG1(eeprom_mac_addr); device_printf(dev, "Overriding MAC from EEPROM\n"); - for (i = 0; i < 6; i++) { - ar711_base_mac[i] = mac[i]; + if (resource_int_value(device_get_name(dev), device_get_unit(dev), + "readascii", &readascii) == 0) { + device_printf(dev, "Vendor stores MAC in ASCII format\n"); + for (i = 0; i < 6; i++) { + ar711_base_mac[i] = strtol(&(mac[i*3]), NULL, 16); + } + } else { + for (i = 0; i < 6; i++) { + ar711_base_mac[i] = mac[i]; + } } } Index: sys/mips/conf/DIR-825.hints =================================================================== --- sys/mips/conf/DIR-825.hints (revision 254678) +++ sys/mips/conf/DIR-825.hints (working copy) @@ -6,13 +6,14 @@ hint.arge.0.phymask=0x0 hint.arge.0.media=1000 hint.arge.0.fduplex=1 +hint.arge.0.eeprommac=0x1f66ffa0 +hint.arge.0.readascii=1 -# XXX grab these from uboot? -# hint.arge.0.eeprommac=0x1f01fc00 - hint.arge.1.phymask=0x0 hint.arge.1.media=1000 hint.arge.1.fduplex=1 +hint.arge.1.eeprommac=0x1f66ffb4 +hint.arge.1.readascii=1 # ath0 - slot 17 hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1f661000