in every HC driver.
-/* $OpenBSD: ehci.c,v 1.164 2014/08/05 20:26:15 mpi Exp $ */
+/* $OpenBSD: ehci.c,v 1.165 2014/08/10 11:00:35 mpi Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
ex = pool_get(ehcixfer, PR_NOWAIT | PR_ZERO);
#ifdef DIAGNOSTIC
- if (ex != NULL) {
+ if (ex != NULL)
ex->isdone = 1;
- ex->xfer.busy_free = XFER_BUSY;
- }
#endif
return ((struct usbd_xfer *)ex);
}
struct ehci_xfer *ex = (struct ehci_xfer*)xfer;
#ifdef DIAGNOSTIC
- if (xfer->busy_free != XFER_BUSY) {
- printf("%s: xfer=%p not busy, 0x%08x\n", __func__, xfer,
- xfer->busy_free);
- return;
- }
if (!ex->isdone) {
printf("%s: !isdone\n", __func__);
return;
-/* $OpenBSD: ohci.c,v 1.137 2014/08/05 20:26:15 mpi Exp $ */
+/* $OpenBSD: ohci.c,v 1.138 2014/08/10 11:00:36 mpi Exp $ */
/* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
struct usbd_xfer *
ohci_allocx(struct usbd_bus *bus)
{
- struct ohci_xfer *ox;
-
- ox = pool_get(ohcixfer, PR_NOWAIT | PR_ZERO);
-#ifdef DIAGNOSTIC
- if (ox != NULL) {
- ox->xfer.busy_free = XFER_BUSY;
- }
-#endif
- return ((struct usbd_xfer *)ox);
+ return (pool_get(ohcixfer, PR_NOWAIT | PR_ZERO));
}
void
ohci_freex(struct usbd_bus *bus, struct usbd_xfer *xfer)
{
- struct ohci_xfer *ox = (struct ohci_xfer*)xfer;
-
-#ifdef DIAGNOSTIC
- if (xfer->busy_free != XFER_BUSY) {
- printf("%s: xfer=%p not busy, 0x%08x\n", __func__, xfer,
- xfer->busy_free);
- return;
- }
-#endif
- pool_put(ohcixfer, ox);
+ pool_put(ohcixfer, xfer);
}
#ifdef OHCI_DEBUG
-/* $OpenBSD: uhci.c,v 1.129 2014/08/05 20:26:15 mpi Exp $ */
+/* $OpenBSD: uhci.c,v 1.130 2014/08/10 11:00:36 mpi Exp $ */
/* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
ux = pool_get(uhcixfer, PR_NOWAIT | PR_ZERO);
#ifdef DIAGNOSTIC
- if (ux != NULL) {
+ if (ux != NULL)
ux->isdone = 1;
- ux->xfer.busy_free = XFER_BUSY;
- }
#endif
return ((struct usbd_xfer *)ux);
}
struct uhci_xfer *ux = (struct uhci_xfer*)xfer;
#ifdef DIAGNOSTIC
- if (xfer->busy_free != XFER_BUSY) {
- printf("%s: xfer=%p not busy, 0x%08x\n", __func__, xfer,
- xfer->busy_free);
- return;
- }
if (!ux->isdone) {
printf("%s: !isdone\n", __func__);
return;
-/* $OpenBSD: usbdi.c,v 1.71 2014/07/12 18:48:53 tedu Exp $ */
+/* $OpenBSD: usbdi.c,v 1.72 2014/08/10 11:00:36 mpi Exp $ */
/* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */
xfer = dev->bus->methods->allocx(dev->bus);
if (xfer == NULL)
return (NULL);
+#ifdef DIAGNOSTIC
+ xfer->busy_free = XFER_BUSY;
+#endif
xfer->device = dev;
timeout_set(&xfer->timeout_handle, NULL, NULL);
DPRINTFN(5,("usbd_alloc_xfer() = %p\n", xfer));
DPRINTFN(5,("usbd_free_xfer: %p\n", xfer));
if (xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF))
usbd_free_buffer(xfer);
+#ifdef DIAGNOSTIC
+ if (xfer->busy_free != XFER_BUSY) {
+ printf("%s: xfer=%p not busy, 0x%08x\n", __func__, xfer,
+ xfer->busy_free);
+ return;
+ }
+#endif
xfer->device->bus->methods->freex(xfer->device->bus, xfer);
- return;
}
void
-/* $OpenBSD: xhci.c,v 1.21 2014/08/09 10:32:36 mpi Exp $ */
+/* $OpenBSD: xhci.c,v 1.22 2014/08/10 11:00:36 mpi Exp $ */
/*
* Copyright (c) 2014 Martin Pieuchot
struct usbd_xfer *
xhci_allocx(struct usbd_bus *bus)
{
- struct xhci_xfer *xx;
-
- xx = pool_get(xhcixfer, PR_NOWAIT | PR_ZERO);
-#ifdef DIAGNOSTIC
- if (xx != NULL)
- xx->xfer.busy_free = XFER_BUSY;
-#endif
- return ((struct usbd_xfer *)xx);
+ return (pool_get(xhcixfer, PR_NOWAIT | PR_ZERO));
}
void
xhci_freex(struct usbd_bus *bus, struct usbd_xfer *xfer)
{
- struct xhci_xfer *xx = (struct xhci_xfer*)xfer;
-
-#ifdef DIAGNOSTIC
- if (xfer->busy_free != XFER_BUSY) {
- printf("%s: xfer=%p not busy, 0x%08x\n", __func__, xfer,
- xfer->busy_free);
- return;
- }
-#endif
- pool_put(xhcixfer, xx);
+ pool_put(xhcixfer, xfer);
}
int