From: henryk@ploetzli.ch Date: Fri, 28 Aug 2009 00:44:09 +0000 (+0000) Subject: Send Stall in response to USB SET FEATURE or CLEAR FEATURE requests. Speeds up device... X-Git-Tag: v1.0.0~510 X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/8e19377db1fccbb662fb6d579e5d6ad75c2c229e?ds=sidebyside Send Stall in response to USB SET FEATURE or CLEAR FEATURE requests. Speeds up device enumeration on linux by 10s. --- diff --git a/common/usb.c b/common/usb.c index 50a9fc69..bef4d7e0 100644 --- a/common/usb.c +++ b/common/usb.c @@ -259,6 +259,19 @@ static void UsbSendZeroLength(void) ; } +static void UsbSendStall(void) +{ + UDP_ENDPOINT_CSR(0) |= UDP_CSR_FORCE_STALL; + + while(!(UDP_ENDPOINT_CSR(0) & UDP_CSR_STALL_SENT)) + ; + + UDP_ENDPOINT_CSR(0) &= ~UDP_CSR_STALL_SENT; + + while(UDP_ENDPOINT_CSR(0) & UDP_CSR_STALL_SENT) + ; +} + static void HandleRxdSetupData(void) { int i; @@ -346,6 +359,8 @@ static void HandleRxdSetupData(void) case USB_REQUEST_CLEAR_FEATURE: case USB_REQUEST_SET_FEATURE: + UsbSendStall(); + break; case USB_REQUEST_SET_DESCRIPTOR: case USB_REQUEST_SYNC_FRAME: default: