On Fri, 14 May 2004, fengwei yin wrote:

> Because our board is big endian,so if we want exchange data with usb 
> devices(little endian),we must do cpu_to_le(swapping is done by our ohci
>  controller).

You have to do this for _all_ the data you send to or receive from _every_ 
USB device?  What happens if the transfer buffer length isn't a multiple 
of 4?

>  When we get wPortChange and wPortStatus of port,ohci 
> controller
> transform little endian to big endian.

Are you talking about the internal hub or the external hub?

>  So the stucture usb_port_status have 
> reversed order compared to standard port_status.So we must Interchanging 
> the 
> positions of wPortChange and wPortStatus.

If you're talking about the external hub, this is wrong.  Data from that
hub must be treated exactly the same as any other data from any USB
device.  If your controller stores the data in the transfer buffer using
the wrong byte ordering, your transfer routines must already be doing the
necessary swapping to fix it up.  If that wasn't happening correctly you
would never be able to enumerate devices at all, because everything in the
device and configuration descriptors would appear byte-swapped.

So you don't need to interchange the positions of wPortChange and
wPortStatus.

For the internal hub, I don't know -- that depends on how the hardware 
works.

Alan Stern




-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to