Byte swapped inw/outw again....

Gabriel Paubert paubert at iram.es
Tue Mar 14 20:56:46 EST 2000


On Mon, 13 Mar 2000, Mark S. Mathews wrote:

>
> Hi Folks,
>
> Another driver port with inw/outw issues again.  I've looked through the
> linuxppc-dev archive and I'm not quite seeing the answer to my question
> (below).
>
> I'm porting a driver for a WLAN card whose interface is all 16-bit
> registers.  Sometimes the reads/writes are strictly a 16-bit integer
> quantity where the byte swapping in inw/outw wouldn't be too much of a
> problem.  Other times we're reading/writing buffer contents from/to the
> card 2-bytes at a time (swapping in this case is exceptionally bad).


Use in/out for 16 nit register accesses and insw/outsw for the buffer
acceses. This is provided you have a very recent kernel in which ins/outs
do not byte swap (until now they were wrongly swapping the bytes). As
you see, the issue is being addressed...

With older kernels you might want to access the buffer with
insw_ns/outsw_ns (no swapping needed), but this is PPC specific.

Hope this helps...

	Gabriel.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list