[U-Boot] [PATCH 2/4] net: tweak eth_device layout to simplify enetaddr use
Wolfgang Denk
wd at denx.de
Fri Nov 11 12:55:45 CET 2011
Dear Mike Frysinger,
In message <1320970267-22297-2-git-send-email-vapier at gentoo.org> you wrote:
> The current eth_device leaves a 2 byte hole after "enetaddr" and before
> "iobase". Since the enetaddr member has to be 6 bytes, we might as well
> fill that 2 byte hole with something useful.
>
> Further, most device drivers want to load enetaddr from memory into the
> hardware as 1 32bit value and 1 16bit value.
>
> So re-arrange the structure slightly, and add an anonymous union to make
> eth_device even better:
> - expand the name field to fill the 2 byte hole
> - make sure enetaddr is aligned, and provides 32bit/16bit members
I'm OK with expanding the name[] field, but as Thomas pointed out,
providing "convenient" u32 / u16 variables for the MAC address is
actually a faux ami that misleads people into using these variables
without thinking about endianess and such.
Please omit this part.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
People seldom know what they want until you give them what they ask
for.
More information about the U-Boot
mailing list