On Fri, 2005-08-12 at 23:40 -0600, James Painter wrote: > > I caught a bunch of endian problems when back porting the current > usbnet.c code to 2.4 for use on a big-endian mips processor (tivo). > Another one of those things I mean to wrap up to submit a patch for, but > haven't yet. I have this bundled up with my ax88178 changes, but > presumably it's better if I factor it out into separate patches. > > In particular, in the 2.6.12 ax8817x_bind and ax88772_bind functions, > you'll find the mii code that looks like this: > > ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET); > ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE, > ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP); > > The "val" arguments need to be turned into le16 values: > > ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, > cpu_to_le16(BMCR_RESET)); > ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE, > cpu_to_le16(ADVERTISE_ALL | ADVERTISE_CSMA | > ADVERTISE_PAUSE_CAP)); > > There are endian issues with some of the mdio_read calls too, e.g. in > ax88[17]72_link_reset
I wonder if it might just be simpler to wrap the 'val' in cpu_to_le16 in the ax8817x_mdio_read/write functions. Would make the rest of the code cleaner and easier to follow. -- David Hollis <[EMAIL PROTECTED]>
signature.asc
Description: This is a digitally signed message part
