diff options
author | n_hibma <n_hibma@FreeBSD.org> | 1999-07-25 18:54:22 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 1999-07-25 18:54:22 +0000 |
commit | e036dfc6a10cd52b51a7ec9234f120bddbfa6dda (patch) | |
tree | 5064fbe20a92b9e8a0b57a01453e870ce9e4603e /sys/dev/usb/usbdi.c | |
parent | 9aa55ad5ba036f0a2dfc53a80c7af7b7da3afedb (diff) | |
download | FreeBSD-src-e036dfc6a10cd52b51a7ec9234f120bddbfa6dda.zip FreeBSD-src-e036dfc6a10cd52b51a7ec9234f120bddbfa6dda.tar.gz |
Add comments, change variable names to make them consistent (r -> err,
timo_handle -> timeout_handle, p -> pipe, *pipe -> *rpipe, etc.)
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 b148d89..ff50add 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 |