On Fri, 14 May 2004, fengwei yin wrote:

> In our kernel,
> 
> 1.enable ohci endian swapping.
> 2.And hub.h was changed
> 
> diff -rNu usb/hub.h usbok/hub.h
> --- usb/hub.h 2004-05-13 14:06:17.000000000 +0800
> +++ usbok/hub.h       2004-05-13 14:01:20.000000000 +0800
> @@ -42,8 +42,8 @@
>   * See USB 2.0 spec Table 11-19 and Table 11-20
>   */
>  struct usb_port_status {
> +     __u16 wPortChange;
>       __u16 wPortStatus;
> -     __u16 wPortChange;      
>  } __attribute__ ((packed));
>  
>  /* 
> @@ -85,8 +85,8 @@
>  #define HUB_CHAR_PORTIND        0x0080 /* D7       */
>  
>  struct usb_hub_status {
> -     __u16 wHubStatus;
>       __u16 wHubChange;
> +     __u16 wHubStatus;
>  } __attribute__ ((packed));
> 
> Just change word byte of hub_status & port_status.because such swap 
> was performed by ohci controller.
> 
> 3.The status of port used be16_to_cpu func.because such swap 
> was performed by ohci controller either.
> 
> -     le16_to_cpus(&hubstatus.wHubStatus);
> +     be16_to_cpus(&hubstatus.wHubStatus); 
> 
> There are main difference between my kernel & standard kernel of usb code.
> 
> The usb devices connectted directly to 2-port hub all ok.If I use external
>  4-port hub,external hub can be found correctly.But usb devices connectted
> to 4-port hub cann't be found because read wrong port status of 4-port hub
> .I am confused why port status of 2-port hub can be read correctly & port 
> status of external 4-port hub CANN'T be read correctly(they used the same 
> function usb_control_msg to get status in hub.c).

I'm starting to wonder...

Maybe the external 4-port hub is really doing things correctly and the
OHCI driver is presenting the controller's registers wrongly.  Then you
add an additional layer of swapping, so to you it looks like the internal
2-port hub works and the 4-port hub doesn't.  Maybe instead the driver's 
root hub code needs to be fixed.

Interchanging the positions of wPortChange and wPortStatus as you did is
clearly wrong, likewise for wHubChange and wHubStatus.  Their order is 
fixed by the USB specification, and the controller can't change it -- if 
it did then it would corrupt _every_ byte stream sent to/from a USB 
device.

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