Module Name:    src
Committed By:   mrg
Date:           Thu Dec  8 07:53:56 UTC 2011

Modified Files:
        src/sys/dev/usb [mrg-ohci-jmcneill-usbmp]: ohci.c usbdi.c

Log Message:
there's something wrong with uaudio@ohci on the usbmp branch.
this is the minimally working port of ohci to mpusb, and it works
with uaudio but is lacking many other changes, yet.


To generate a diff of this commit:
cvs rdiff -u -r1.218.6.2 -r1.218.6.2.2.1 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.134.2.1 -r1.134.2.1.2.1 src/sys/dev/usb/usbdi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.218.6.2 src/sys/dev/usb/ohci.c:1.218.6.2.2.1
--- src/sys/dev/usb/ohci.c:1.218.6.2	Sun Dec  4 21:02:27 2011
+++ src/sys/dev/usb/ohci.c	Thu Dec  8 07:53:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.218.6.2 2011/12/04 21:02:27 jmcneill Exp $	*/
+/*	$NetBSD: ohci.c,v 1.218.6.2.2.1 2011/12/08 07:53:56 mrg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $	*/
 
 /*
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.218.6.2 2011/12/04 21:02:27 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.218.6.2.2.1 2011/12/08 07:53:56 mrg Exp $");
 
 #include "opt_usb.h"
 
@@ -2245,7 +2245,7 @@ ohci_close_pipe(usbd_pipe_handle pipe, o
 	ohci_softc_t *sc = pipe->device->bus->hci_private;
 	ohci_soft_ed_t *sed = opipe->sed;
 
-	KASSERT(mutex_owned(&sc->sc_lock));
+//	KASSERT(mutex_owned(&sc->sc_lock));
 
 #ifdef DIAGNOSTIC
 	sed->ed.ed_flags |= HTOO32(OHCI_ED_SKIP);
@@ -3363,15 +3363,15 @@ ohci_device_setintr(ohci_softc_t *sc, st
 usbd_status
 ohci_device_isoc_transfer(usbd_xfer_handle xfer)
 {
-	ohci_softc_t *sc = xfer->pipe->device->bus->hci_private;
+	//ohci_softc_t *sc = xfer->pipe->device->bus->hci_private;
 	usbd_status err;
 
 	DPRINTFN(5,("ohci_device_isoc_transfer: xfer=%p\n", xfer));
 
 	/* Put it on our queue, */
-	mutex_enter(&sc->sc_lock);
+	//mutex_enter(&sc->sc_lock);
 	err = usb_insert_transfer(xfer);
-	mutex_exit(&sc->sc_lock);
+	//mutex_exit(&sc->sc_lock);
 
 	/* bail out on error, */
 	if (err && err != USBD_IN_PROGRESS)
@@ -3496,7 +3496,7 @@ ohci_device_isoc_enter(usbd_xfer_handle 
 	}
 #endif
 
-	mutex_enter(&sc->sc_lock);
+	//mutex_enter(&sc->sc_lock);
 	usb_syncmem(&sed->dma, sed->offs, sizeof(sed->ed),
 	    BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 	sed->ed.ed_tailp = HTOO32(nsitd->physaddr);
@@ -3505,7 +3505,7 @@ ohci_device_isoc_enter(usbd_xfer_handle 
 	usb_syncmem(&sed->dma, sed->offs + offsetof(ohci_ed_t, ed_flags),
 	    sizeof(sed->ed.ed_flags),
 	    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
-	mutex_exit(&sc->sc_lock);
+	//mutex_exit(&sc->sc_lock);
 
 #ifdef OHCI_DEBUG
 	if (ohcidebug > 5) {
@@ -3540,6 +3540,8 @@ ohci_device_isoc_start(usbd_xfer_handle 
 
 	/* XXX anything to do? */
 
+	mutex_exit(&sc->sc_lock);
+
 	return (USBD_IN_PROGRESS);
 }
 
@@ -3553,7 +3555,7 @@ ohci_device_isoc_abort(usbd_xfer_handle 
 
 	DPRINTFN(1,("ohci_device_isoc_abort: xfer=%p\n", xfer));
 
-	KASSERT(mutex_owned(&sc->sc_lock));
+	//KASSERT(mutex_owned(&sc->sc_lock));
 
 	/* Transfer is already done. */
 	if (xfer->status != USBD_NOT_STARTED &&
@@ -3587,22 +3589,24 @@ ohci_device_isoc_abort(usbd_xfer_handle 
 #endif
 	}
 
-	mutex_exit(&sc->sc_lock);
+	//mutex_exit(&sc->sc_lock);
 
 	usb_delay_ms(&sc->sc_bus, OHCI_ITD_NOFFSET);
 
-	mutex_enter(&sc->sc_lock);
+	//mutex_enter(&sc->sc_lock);
 
 	/* Run callback. */
+mutex_enter(&sc->sc_lock);
 	usb_transfer_complete(xfer);
+mutex_exit(&sc->sc_lock);
 
 	sed->ed.ed_headp = HTOO32(sitd->physaddr); /* unlink TDs */
 	sed->ed.ed_flags &= HTOO32(~OHCI_ED_SKIP); /* remove hardware skip */
 	usb_syncmem(&sed->dma, sed->offs, sizeof(sed->ed),
 	    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
- done:
-	mutex_exit(&sc->sc_lock);
+ done: ;
+	//mutex_exit(&sc->sc_lock);
 }
 
 void

Index: src/sys/dev/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.134.2.1 src/sys/dev/usb/usbdi.c:1.134.2.1.2.1
--- src/sys/dev/usb/usbdi.c:1.134.2.1	Sun Dec  4 13:23:17 2011
+++ src/sys/dev/usb/usbdi.c	Thu Dec  8 07:53:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.134.2.1 2011/12/04 13:23:17 jmcneill Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.134.2.1.2.1 2011/12/08 07:53:56 mrg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.134.2.1 2011/12/04 13:23:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.134.2.1.2.1 2011/12/08 07:53:56 mrg Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_usb.h"
@@ -878,7 +878,7 @@ usb_insert_transfer(usbd_xfer_handle xfe
 	DPRINTFN(5,("usb_insert_transfer: pipe=%p running=%d timeout=%d\n",
 		    pipe, pipe->running, xfer->timeout));
 
-	KASSERT(pipe->lock == NULL || mutex_owned(pipe->lock));
+	//KASSERT(pipe->lock == NULL || mutex_owned(pipe->lock));
 
 #ifdef DIAGNOSTIC
 	if (xfer->busy_free != XFER_BUSY) {

Reply via email to