Date: Sun, 11 Jun 2006 08:26:48 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 98975 for review Message-ID: <200606110826.k5B8QmdK047489@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=98975 Change 98975 by hselasky@hselasky_mini_itx on 2006/06/11 08:26:43 Improve "clear-stall" handling. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/uhid.c#5 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/uhid.c#5 (text+ko) ==== @@ -116,7 +116,7 @@ u_int8_t sc_wakeup_detach; u_int8_t sc_flags; #define UHID_FLAG_IMMED 0x01 /* set if read should be immediate */ -#define UHID_FLAG_INTR_STALLED 0x02 /* set if interrup transfer stalled */ +#define UHID_FLAG_INTR_STALL 0x02 /* set if interrupt transfer stalled */ #define UHID_FLAG_STATIC_DESC 0x04 /* set if report descriptors are static */ #define UHID_FLAG_COMMAND_ERR 0x08 /* set if control transfer had an error */ #define UHID_FLAG_WAIT_USB 0x10 /* set if should wait for USB */ @@ -147,17 +147,22 @@ } tr_setup: - USBD_IF_POLL(&(sc->sc_cdev.sc_rdq_free), m); + if (sc->sc_flags & UHID_FLAG_INTR_STALL) { + usbd_transfer_start(sc->sc_xfer[1]); + } else { + USBD_IF_POLL(&(sc->sc_cdev.sc_rdq_free), m); - if ((!(sc->sc_flags & (UHID_FLAG_INTR_STALLED))) && m) { - xfer->length = sc->sc_isize; - usbd_start_hardware(xfer); + if (m) { + xfer->length = sc->sc_isize; + usbd_start_hardware(xfer); + } } return; tr_error: if (xfer->error != USBD_CANCELLED) { /* try to clear stall first */ + sc->sc_flags |= UHID_FLAG_INTR_STALL; usbd_transfer_start(sc->sc_xfer[1]); } return; @@ -171,20 +176,19 @@ tr_setup: /* start clear stall */ - sc->sc_flags |= UHID_FLAG_INTR_STALLED; usbd_clear_stall_tr_setup(xfer, sc->sc_xfer[0]); return; tr_transferred: usbd_clear_stall_tr_transferred(xfer, sc->sc_xfer[0]); - sc->sc_flags &= ~UHID_FLAG_INTR_STALLED; + sc->sc_flags &= ~UHID_FLAG_INTR_STALL; usbd_transfer_start(sc->sc_xfer[0]); return; tr_error: /* bomb out */ - sc->sc_flags &= ~UHID_FLAG_INTR_STALLED; + sc->sc_flags &= ~UHID_FLAG_INTR_STALL; usb_cdev_put_data_error(&(sc->sc_cdev)); return; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606110826.k5B8QmdK047489>