lkml.org 
[lkml]   [2001]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Probable endianess problem in TLAN driver

Adrian Cox writes:
> > +#if defined(__powerpc__)
> > +#define inw(addr) le32_to_cpu(inw(addr))
> > +#define inl(addr) le32_to_cpu(inl(addr))
> > +#define outw(val, addr) outw(cpu_to_le32(val), addr)
> > +#define outl(val, addr) outl(cpu_to_le32(val), addr)
> > +#endif
>
> On ppc the inw, inl, outw, and outl functions already byteswap, so by
> adding the extra byteswap you're now passing unswapped data to the chip.

Yes, and this is true for every architecture.

All of {in,out}{b,w,l}() and {read/write}{b,w,l}() swap to/from
bus endianness for you.

Later,
David S. Miller
davem@redhat.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:55    [W:0.042 / U:1.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site