[PATCH 1/1] build modular usb isd200 with modular ide

Paul Mackerras paulus at samba.org
Tue Oct 26 09:12:28 EST 2004

Doug Maxey writes:

> Ok, lets look at those vars.  Both are defined in hdreg.h as bytes.
> No fields in the data from the device are bytes, but are 16 bit.  On big
> endian, the relative positions for an LE u16 are swapped.  If the swap is
> not done on those, then one replaces the other when read.  Probably not
> what was intended.  It appears that another bug is being fixed here.

No.  The only sane way to do things is to transfer data from the
device to memory as a byte stream, in other words, preserving the
ordering of the individual bytes.  That is what we do on PPC and PPC64
platforms.  That ordering is preserved (and must be preserved)
irrespective of whether the transfer is actually done in 8, 16 or 32
bit chunks.

That means that 16-bit quantities might need to be byte-swapped to be
interpreted in host byte order, but single-byte fields should always
be in their correct sequence.


More information about the Linuxppc64-dev mailing list