Solved [Solved]aue: ADMtek USB To LAN Converter does not work (PPC)

FreeBSD ifree 10.0-RELEASE FreeBSD 10.0-RELEASE #2 r263739: Tue Apr 1 11:30:28 CEST 2014 (powerpc)

I'm having problems with my ADMtek USB ethernet adapter on my Mac Mini G4 (PowerPC). It works flawlessly on the raspberry pi however. The driver is detected on the Mac Mini but I cannot use it, even ping does not work. Comparing the MAC addresses, it seems that there might be an endian issue.

Device (dmesg output):

Code:
aue0: <ADMtek USB To LAN Converter, rev 2.00/1.01, addr 5> on usbus0
miibus1: <MII bus> on aue0

ifconfig output:

Mac mini:

Code:
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80000<LINKSTATE>
        ether 05:00:05:1b:b4:28
        inet 192.168.0.8 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::20d:93ff:fe60:fc1c%ue0 prefixlen 64 scopeid 0x3
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active

Raspberry Pi (FreeBSD fbsdpi 10.0-CURRENT FreeBSD 10.0-CURRENT #9 r250604M: Mon May 13 21:20:03 CEST 2013):

Code:
ue1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80000<LINKSTATE>
        ether 00:05:1b:05:28:b4
        inet ***.***.***.*** netmask 0xffffff00 broadcast ***.***.***.***
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active

I am unsure about a fix, but at least I did some investigation in if_aue.c:

If I interpreted the code correctly, the MAC address is read from eeprom as 3 words which are then saved contiguously in memory.

In the following function there is an interesting line:
Code:
static uint16_t aue_csr_read_2(struct aue_softc *sc, uint16_t reg)

return (le16toh(val));

This is probably correct if we can guarantee that the earlier function call uether_do_request(&sc->sc_ue, &req, &val, 1000); results in a value that comes in little endian form, but is this necessarily the case? I think the USB standard uses little endian form, but I am not sure if this is compensated for somehow by the USB stack.

Maybe I am looking at the wrong things, but I still do find it peculiar that the MAC adresses differs when I use ifconfig. Any ideas?
 
Re: aue: ADMtek USB To LAN Converter does not work (PPC)

After submitting this as a bug, I got a patch the day after, (some hours later than my own bug fix). I was correct about the MAC adress. Taking the endianness into consideration of the MAC address words in the code fixed the problem. Here is a link to the "official" patch, not my own. http://people.freebsd.org/~yongari/aue/ ... nness.diff

I think this thread may be closed now since the problem I experienced is solved.
 
Back
Top