Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/nick-nhusb]: src/sys/dev/usb There is nothing to do on a STALL during a ...



details:   https://anonhg.NetBSD.org/src/rev/6992fe1cfa8f
branches:  nick-nhusb
changeset: 334225:6992fe1cfa8f
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Jun 11 07:12:08 2015 +0000

description:
There is nothing to do on a STALL during a control transfer (aka
"protocol stall") accoriding to the USB specifications, so remove
the code in usbd_do_request_flags_pipe that tries to recover from
this.

diffstat:

 sys/dev/usb/usbdi.c |  41 ++---------------------------------------
 1 files changed, 2 insertions(+), 39 deletions(-)

diffs (62 lines):

diff -r 7abc9adf63e2 -r 6992fe1cfa8f sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Sun Jun 07 08:04:52 2015 +0000
+++ b/sys/dev/usb/usbdi.c       Thu Jun 11 07:12:08 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.162.2.26 2015/03/30 12:09:30 skrll Exp $   */
+/*     $NetBSD: usbdi.c,v 1.162.2.27 2015/06/11 07:12:08 skrll Exp $   */
 
 /*
  * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.162.2.26 2015/03/30 12:09:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.162.2.27 2015/06/11 07:12:08 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1055,43 +1055,6 @@
 #endif
        if (actlen != NULL)
                *actlen = xfer->ux_actlen;
-       if (err == USBD_STALLED) {
-               /*
-                * The control endpoint has stalled.  Control endpoints
-                * should not halt, but some may do so anyway so clear
-                * any halt condition.
-                */
-               usb_device_request_t treq;
-               usb_status_t status;
-               uint16_t s;
-               usbd_status nerr;
-
-               treq.bmRequestType = UT_READ_ENDPOINT;
-               treq.bRequest = UR_GET_STATUS;
-               USETW(treq.wValue, 0);
-               USETW(treq.wIndex, 0);
-               USETW(treq.wLength, sizeof(usb_status_t));
-               usbd_setup_default_xfer(xfer, dev, 0, USBD_DEFAULT_TIMEOUT,
-                                          &treq, &status,sizeof(usb_status_t),
-                                          0, 0);
-               nerr = usbd_sync_transfer(xfer);
-               if (nerr)
-                       goto bad;
-               s = UGETW(status.wStatus);
-               USBHIST_LOG(usbdebug, "status = 0x%04x", s, 0, 0, 0);
-               if (!(s & UES_HALT))
-                       goto bad;
-               treq.bmRequestType = UT_WRITE_ENDPOINT;
-               treq.bRequest = UR_CLEAR_FEATURE;
-               USETW(treq.wValue, UF_ENDPOINT_HALT);
-               USETW(treq.wIndex, 0);
-               USETW(treq.wLength, 0);
-               usbd_setup_default_xfer(xfer, dev, 0, USBD_DEFAULT_TIMEOUT,
-                                          &treq, &status, 0, 0, 0);
-               nerr = usbd_sync_transfer(xfer);
-               if (nerr)
-                       goto bad;
-       }
 
  bad:
        if (err) {



Home | Main Index | Thread Index | Old Index