Date: Sat, 9 Jun 2007 11:27:08 +0200 From: Bernd Walter <ticso@cicely12.cicely.de> To: =?iso-8859-1?Q?Bj=F6rn_K=F6nig?= <bkoenig@alpha-tierchen.de> Cc: arm@freebsd.org, ticso@cicely.de Subject: Re: if_ate handles the bytes of the MAC address in a "wrong" order Message-ID: <20070609092708.GE16463@cicely12.cicely.de> In-Reply-To: <63859.2001:6f8:101e:0:20e:cff:fe6d:6adb.1181372440.squirrel@webmail.alpha-tierchen.de> References: <53385.2001:6f8:101e:0:20e:cff:fe6d:6adb.1181314300.squirrel@webmail.alpha-tierchen.de> <20070608.120902.-399284744.imp@bsdimp.com> <20070608225912.GB16463@cicely12.cicely.de> <63859.2001:6f8:101e:0:20e:cff:fe6d:6adb.1181372440.squirrel@webmail.alpha-tierchen.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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@bwct.de info@bwct.de support@fizon.de
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070609092708.GE16463>