From d9a23dc02c41c3986acd39fec79c9528e7c9e081 Mon Sep 17 00:00:00 2001 From: Josef Karthauser Date: Sun, 7 Apr 2002 15:12:07 +0000 Subject: [PATCH] MFNetBSD: revision 1.118 date: 2001/12/27 18:48:28; author: augustss; state: Exp; lines: +24 -5 Add some DIAGNOSTIC stuf that I forgot. From Nate Williams. --- sys/dev/usb/ohci.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index 228a615f70b..3511324b187 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ohci.c,v 1.117 2001/12/27 11:27:11 augustss Exp $ */ +/* $NetBSD: ohci.c,v 1.118 2001/12/27 18:48:28 augustss Exp $ */ /* $FreeBSD$ */ /* @@ -913,12 +913,23 @@ ohci_allocx(struct usbd_bus *bus) usbd_xfer_handle xfer; xfer = SIMPLEQ_FIRST(&sc->sc_free_xfers); - if (xfer != NULL) + if (xfer != NULL) { SIMPLEQ_REMOVE_HEAD(&sc->sc_free_xfers, xfer, next); - else +#ifdef DIAGNOSTIC + if (xfer->busy_free != XFER_FREE) { + printf("ohci_allocx: xfer=%p not free, 0x%08x\n", xfer, + xfer->busy_free); + } +#endif + } else { xfer = malloc(sizeof(struct ohci_xfer), M_USB, M_NOWAIT); - if (xfer != NULL) + } + if (xfer != NULL) { memset(xfer, 0, sizeof (struct ohci_xfer)); +#ifdef DIAGNOSTIC + xfer->busy_free = XFER_BUSY; +#endif + } return (xfer); } @@ -927,6 +938,14 @@ ohci_freex(struct usbd_bus *bus, usbd_xfer_handle xfer) { struct ohci_softc *sc = (struct ohci_softc *)bus; +#ifdef DIAGNOSTIC + if (xfer->busy_free != XFER_BUSY) { + printf("ohci_freex: xfer=%p not busy, 0x%08x\n", xfer, + xfer->busy_free); + return; + } + xfer->busy_free = XFER_FREE; +#endif SIMPLEQ_INSERT_HEAD(&sc->sc_free_xfers, xfer, next); } -- 2.45.2