summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/usb/usb_subr.c4
-rw-r--r--sys/dev/usb/usbdi.c12
-rw-r--r--sys/sys/queue.h7
3 files changed, 17 insertions, 6 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index 838d778..cba6d3b 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1040,7 +1040,11 @@ usb_start_next(pipe)
#endif
/* First remove remove old */
+#if defined(__NetBSD__)
SIMPLEQ_REMOVE_HEAD(&pipe->queue, SIMPLEQ_FIRST(&pipe->queue), next);
+#elif defined(__FreeBSD__)
+ SIMPLEQ_REMOVE_HEAD(&pipe->queue, next);
+#endif
if (pipe->state != USBD_PIPE_ACTIVE) {
pipe->running = 0;
return;
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index 8b88cd3..ee2f041 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -261,7 +261,11 @@ usbd_alloc_request()
reqh = SIMPLEQ_FIRST(&usbd_free_requests);
if (reqh)
+#if defined(__NetBSD__)
SIMPLEQ_REMOVE_HEAD(&usbd_free_requests, reqh, next);
+#elif defined(__FreeBSD__)
+ SIMPLEQ_REMOVE_HEAD(&usbd_free_requests, next);
+#endif
else
reqh = malloc(sizeof(*reqh), M_USB, M_NOWAIT);
if (!reqh)
@@ -918,7 +922,11 @@ usbd_ar_pipe(pipe)
reqh = SIMPLEQ_FIRST(&pipe->queue);
if (reqh == 0)
break;
+#if defined(__NetBSD__)
SIMPLEQ_REMOVE_HEAD(&pipe->queue, reqh, next);
+#elif defined(__FreeBSD__)
+ SIMPLEQ_REMOVE_HEAD(&pipe->queue, next);
+#endif
reqh->status = USBD_CANCELLED;
if (reqh->callback)
reqh->callback(reqh, reqh->priv, reqh->status);
@@ -926,7 +934,11 @@ usbd_ar_pipe(pipe)
#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);
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index 87a62a0..1063f73 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)queue.h 8.5 (Berkeley) 8/20/94
- * $Id: queue.h,v 1.23 1999/01/06 20:03:11 n_hibma Exp $
+ * $Id: queue.h,v 1.24 1999/01/07 22:27:53 n_hibma Exp $
*/
#ifndef _SYS_QUEUE_H_
@@ -218,11 +218,6 @@ struct { \
(head)->stqh_last = &(head)->stqh_first; \
} while (0)
-#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \
- if (((head)->stqh_first = (elm)->field.stqe_next) == NULL) \
- (head)->stqh_last = &(head)->stqh_first; \
-} while (0)
-
#define STAILQ_REMOVE(head, elm, type, field) do { \
if ((head)->stqh_first == (elm)) { \
OpenPOWER on IntegriCloud