diff options
author | n_hibma <n_hibma@FreeBSD.org> | 1999-07-27 20:22:29 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 1999-07-27 20:22:29 +0000 |
commit | 3862cb0c22da9923dfb769cc9e228075519949e9 (patch) | |
tree | 8dc7841b64a404d70ce578435ed2ebb43a9cbee1 /sys/dev/usb/usbdi.c | |
parent | 1f6c047817defe7790811b0ad732bc417d9e365e (diff) | |
download | FreeBSD-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.c | 22 |
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); } |