Alan Stern wrote:

Does this need to be cleaned up?

Yes. I thought we had fixed all of this in the past, did we miss something?

I think some fixes didn't get merged, for various reasons; discussion about cache-incoherent DMA derailed a few.


This should fix things.  I added buffer space (4 bytes) in struct usb_hub
to store the status reports.

Reads good, but some comments on the GET_STATUS requests:


 - Those timeouts should be HZ * USB_CTRL_GET_TIMEOUT, these
   are excessively short.

 - Naming is problematic:  usb_*() suggests they're generic
   and exported, but they're not.  I'd strike the usb_ prefix.

None of those are new issues, but they could be resolved now
while this code is being updated.

- Dave



--- 1.105/drivers/usb/core/hub.c Sat May 24 18:40:11 2003
+++ edited/drivers/usb/core/hub.c Wed Jun 4 11:32:10 2003
@@ -103,21 +103,23 @@
/*
* USB 2.0 spec Section 11.24.2.6
*/
-static int usb_get_hub_status(struct usb_device *dev, void *data)
+static int usb_get_hub_status(struct usb_device *dev,
+ struct usb_hub_status *data)
{
return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_HUB, 0, 0,
- data, sizeof(struct usb_hub_status), HZ);
+ data, sizeof(*data), HZ);
}
/*
* USB 2.0 spec Section 11.24.2.7
*/
-static int usb_get_port_status(struct usb_device *dev, int port, void *data)
+static int usb_get_port_status(struct usb_device *dev, int port,
+ struct usb_port_status *data)
{
return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_PORT, 0, port,
- data, sizeof(struct usb_hub_status), HZ);
+ data, sizeof(*data), HZ);
}
/* completion function, fires on port status changes and various faults */



------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to