if_ate handles the bytes of the MAC address in a "wrong" order

Bernd Walter ticso at cicely12.cicely.de
Sat Jun 9 09:27:21 UTC 2007


On Sat, Jun 09, 2007 at 09:00:40AM +0200, Björn König wrote:
> Bernd schrieb:
> 
> > Ethernet is little endian.
> > 0x01 is the first byte to be transmitted and it is done in 1000000
> > order.
> > For my understanding 0x01 is the _least_ significant byte.
> 
> If we would talk about a big 48-bit number with little endianess I would
> agree with you that 0x01 is the least significant byte. However, a MAC
> address is not a 48-bit number, it's rather a 48-bit address consisting of
> six 8-bit numbers, so I think it's inappropriate and confusing to talk
> about a most and least significant byte for the purpose of endianess.

You started with it and you were wrong.

> I'd like to stick to IEEE802 and call the bytes from left to right: first,
> second, third, ... and the sixth byte is the last. In my opinion the first
> bytes in transmission have a higher significance than the last bytes,
> because stations can already make decisions upon the first bytes. That's
> the reason why Atmel (among many others) call the first byte the most
> significant byte.

I also prefer to talk about first, sendond, ... byte, but the order is
important to understand the datasheet.
The datasheet is clear that the first 4 bytes belong into the first
register, but it doesn't tell anything about the order of the bytes
within the registers.
The little endian order fits with the layout after the kernel has
changed the order.
And it fits with the linux code you've mentioned.
We all put the first byte into the _low_ byte of the word register.
Plus it is working.

It is clear that the loader uses a different order and the kernel
changes it.
The loader should be fixed and the kernel shouldn't change it, which
requires the read function to be fixed.
Alhough I prefer some #ifdef to be left, since I already have boards in
the wild where I can't easily change the loader.

-- 
B.Walter                http://www.bwct.de      http://www.fizon.de
bernd at bwct.de           info at bwct.de            support at fizon.de


More information about the freebsd-arm mailing list