Thread (5 messages) flat view 5 messages, 4 authors, 2000-03-14

Re: Byte swapped inw/outw again....

From: Gabriel Paubert <hidden>
Date: 2000-03-14 09:56:46

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-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help