summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usbdi.c
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-07-27 20:22:29 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-07-27 20:22:29 +0000
commit3862cb0c22da9923dfb769cc9e228075519949e9 (patch)
tree8dc7841b64a404d70ce578435ed2ebb43a9cbee1 /sys/dev/usb/usbdi.c
parent1f6c047817defe7790811b0ad732bc417d9e365e (diff)
downloadFreeBSD-src-3862cb0c22da9923dfb769cc9e228075519949e9.zip
FreeBSD-src-3862cb0c22da9923dfb769cc9e228075519949e9.tar.gz
Every reqh in an aborted pipe is given status CANCELED and the callback is
called. It might be necessary to split that routine into two parts in which calling the callback is not done at splusb().
Diffstat (limited to 'sys/dev/usb/usbdi.c')
-rw-r--r--sys/dev/usb/usbdi.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index ff50add..53f1b0d 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -916,30 +916,22 @@ usbd_ar_pipe(pipe)
{
usbd_request_handle reqh;
-#if 0
- for (;;) {
- reqh = SIMPLEQ_FIRST(&pipe->queue);
- if (reqh == 0)
- break;
+ while ((reqh = SIMPLEQ_FIRST(&pipe->queue))) {
+ pipe->methods->abort(reqh);
#if defined(__NetBSD__)
SIMPLEQ_REMOVE_HEAD(&pipe->queue, reqh, next);
#elif defined(__FreeBSD__)
SIMPLEQ_REMOVE_HEAD(&pipe->queue, next);
#endif
+ /* XXX should the callback not be called something
+ * else than splusb? Create a new list of reqh and
+ * execute them after the while for example?
+ */
reqh->status = USBD_CANCELLED;
if (reqh->callback)
reqh->callback(reqh, reqh->priv, reqh->status);
}
-#else
- while ((reqh = SIMPLEQ_FIRST(&pipe->queue))) {
- pipe->methods->abort(reqh);
-#if defined(__NetBSD__)
- SIMPLEQ_REMOVE_HEAD(&pipe->queue, reqh, next);
-#elif defined(__FreeBSD__)
- SIMPLEQ_REMOVE_HEAD(&pipe->queue, next);
-#endif
- }
-#endif
+
return (USBD_NORMAL_COMPLETION);
}
OpenPOWER on IntegriCloud