Hi Alan and David,
Alan Stern wrote:
For a while now I've been seeing strange things with the net2280 driver. When I rmmod the g_file_storage gadget, the connection isn't dropped. Not even when I rmmod net2280. I actually have to unplug the cable before the host realizes that the slave has vanished.
It hasn't always been this way. In the past, the host would realize the connection had changed as soon as the gadget driver was unloaded. I suspect the odd behavior began at the time the power & connection management additions were made to the Gadget API.
Ok, found it. It turns out that this was caused by my update a while back for compliance testing (a customer was seeing a glitch during HS electrical testing caused by the pullups being toggled during a root port reset). It seems the unregister code was counting on that being there in usb_reset. I just added a call to net2280_pullup in usb_gadget_unregister_driver which should cause the host to see a disconnect event.
This patch works for me.
Signed-off-by: Alex Sanks <[EMAIL PROTECTED]>
--- 1.57/drivers/usb/gadget/net2280.c Fri Aug 13 15:10:33 2004 +++ edited/drivers/usb/gadget/net2280.c Fri Sep 10 06:54:44 2004 @@ -2046,6 +2046,8 @@ stop_activity (dev, driver); spin_unlock_irqrestore (&dev->lock, flags); + net2280_pullup(&dev->gadget, 0); + driver->unbind (&dev->gadget); dev->gadget.dev.driver = NULL; dev->driver = NULL;