ChangeSet 1.1218, 2003/05/23 13:27:28-07:00, david-b@pacbell.net [PATCH] USB: bugfix endpoint state This resolves some problems in the endpoint disable patch I sent recently: - wasn't un-halting some endpoints - was clobbering ep0 setup in some cases. drivers/usb/core/message.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) diff -Nru a/drivers/usb/core/message.c b/drivers/usb/core/message.c --- a/drivers/usb/core/message.c Fri May 23 14:25:48 2003 +++ b/drivers/usb/core/message.c Fri May 23 14:25:48 2003 @@ -672,6 +672,7 @@ { int i, b; + /* NOTE: affects all endpoints _except_ ep0 */ for (i=0; iactconfig->desc.bNumInterfaces; i++) { struct usb_interface *ifp = dev->actconfig->interface + i; struct usb_host_interface *as = ifp->altsetting + ifp->act_altsetting; @@ -862,6 +863,7 @@ usb_settoggle (dev, ep, out, 0); (out ? dev->epmaxpacketout : dev->epmaxpacketin) [ep] = iface_as->endpoint [i].desc.wMaxPacketSize; + usb_endpoint_running (dev, ep, out); } return 0; @@ -916,7 +918,7 @@ /* if it's already configured, clear out old state first. */ if (dev->state != USB_STATE_ADDRESS && disable) { - for (i = 0; i < 15; i++) { + for (i = 1 /* skip ep0 */; i < 15; i++) { disable (dev, i); disable (dev, USB_DIR_IN | i); }