diff options
| author | Nick Hibma <n_hibma@FreeBSD.org> | 1999-07-25 18:54:22 +0000 |
|---|---|---|
| committer | Nick Hibma <n_hibma@FreeBSD.org> | 1999-07-25 18:54:22 +0000 |
| commit | 6d38342e16819a857398e65c51437b07e68e63f8 (patch) | |
| tree | d3613a1baf45d9d829958ff0126e9022196bacc0 /sys/dev/usb/usbdi.c | |
| parent | 6a8e2895aa630011ca88f63ea2aa5e4cecf00991 (diff) | |
Notes
Diffstat (limited to 'sys/dev/usb/usbdi.c')
| -rw-r--r-- | sys/dev/usb/usbdi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index b148d894fa0d..ff50addaadcb 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -982,8 +982,7 @@ usbd_transfer_cb(reqh) usbd_pipe_handle pipe = reqh->pipe; /* Count completed transfers. */ - ++pipe->device->bus->stats.requests - [pipe->endpoint->edesc->bmAttributes & UE_XFERTYPE]; + ++pipe->device->bus->stats.requests[pipe->endpoint->edesc->bmAttributes & UE_XFERTYPE]; /* XXX check retry count */ reqh->done = 1; @@ -994,6 +993,7 @@ usbd_transfer_cb(reqh) reqh->actlen, reqh->length)); reqh->status = USBD_SHORT_XFER; } + if (reqh->callback) reqh->callback(reqh, reqh->priv, reqh->status); } @@ -1065,6 +1065,7 @@ usbd_do_request_flags(dev, req, data, flags, actlen) if (r != USBD_NORMAL_COMPLETION) goto bad; r = usbd_sync_transfer(reqh); + #if defined(USB_DEBUG) || defined(DIAGNOSTIC) if (reqh->actlen > reqh->length) printf("usbd_do_request: overrun addr=%d type=0x%02x req=0x" @@ -1075,8 +1076,10 @@ usbd_do_request_flags(dev, req, data, flags, actlen) UGETW(reqh->request.wLength), reqh->length, reqh->actlen); #endif + if (actlen) *actlen = reqh->actlen; + if (r == USBD_STALLED) { /* * The control endpoint has stalled. Control endpoints |
