diff options
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); } |