From 3862cb0c22da9923dfb769cc9e228075519949e9 Mon Sep 17 00:00:00 2001 From: n_hibma Date: Tue, 27 Jul 1999 20:22:29 +0000 Subject: 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(). --- sys/dev/usb/usbdi.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'sys') 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); } -- cgit v1.1