Until my ambitious project gets going, this patch at least fixes the 
problem of assigning a device's new address following a device reset.
The only change needed to David's original suggestion was to handle the 
pathway involved in registering root hubs.

Alan Stern


===== drivers/usb/core/hcd.c 1.102 vs edited =====
--- 1.102/drivers/usb/core/hcd.c        Tue May 20 05:11:36 2003
+++ edited/drivers/usb/core/hcd.c       Tue May 27 14:10:17 2003
@@ -720,6 +720,7 @@
        int retval;
 
        sprintf (&usb_dev->dev.bus_id[0], "usb%d", usb_dev->bus->busnum);
+       usb_dev->state = USB_STATE_DEFAULT;
        retval = usb_new_device (usb_dev, parent_dev);
        if (retval)
                dev_err (parent_dev, "can't register root hub for %s, %d\n",
===== drivers/usb/core/hub.c 1.100 vs edited =====
--- 1.100/drivers/usb/core/hub.c        Wed May  7 16:26:35 2003
+++ edited/drivers/usb/core/hub.c       Tue May 27 14:07:56 2003
@@ -737,6 +737,9 @@
                if (status != -1) {
                        usb_clear_port_feature(hub,
                                port + 1, USB_PORT_FEAT_C_RESET);
+                       dev->state = status
+                                       ? USB_STATE_NOTATTACHED
+                                       : USB_STATE_DEFAULT;
                        return status;
                }
 
===== drivers/usb/core/usb.c 1.204 vs edited =====
--- 1.204/drivers/usb/core/usb.c        Mon May  5 02:49:53 2003
+++ edited/drivers/usb/core/usb.c       Tue May 27 14:09:30 2003
@@ -1017,9 +1017,6 @@
        /* dma masks come from the controller; readonly, except to hcd */
        dev->dev.dma_mask = parent->dma_mask;
 
-       /* it's not usable yet */
-       dev->state = USB_STATE_DEFAULT;
-
        /* USB 2.0 section 5.5.3 talks about ep0 maxpacket ...
         * it's fixed size except for full speed devices.
         */



-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to