On Fri, 7 Jul 2006, Paulo R. Zanoni wrote: > We've been analyzing the usb module files, especifically the file > driver/usb/core/hub.c . Looking at the function usb_reset_device (the last > one on the file), I saw that there is a variable called udev->state, and > one of its state is "USB_STATE_NOTATTACHED". I (still) don't understand > how udev, or usb, or anything works, but I've been thinking: > Is there a way to change the usb state to usb_state_notattached, and then > change it back to "attached"?
No, there is no way to do this. The USB core won't allow the state to be changed once it is equal to USB_STATE_NOTATTACHED. > To execute all the functions that are > executed when the device gets attached... Yes, you can do that. There are actually two steps involved; one is to rebind the hub driver and the other is to reset the hub. Rebinding the hub driver means unbinding it and then binding it. This is what you do: echo -n NAME >/sys/bus/usb/drivers/hub/unbind echo -n NAME >/sys/bus/usb/drivers/hub/bind where NAME is the name of the hub interface to rebind. Typically the name looks something like "2-3.4:1.0". You can find the existing hub names by doing ls /sys/bus/usb/drivers/hub but then you have to figure out which is the name of the hub you're interested in. If that doesn't work, I'll post a program for resetting the hub. Alan Stern Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel