Mon Jan 21 07:39:59 2013 UTC ()
Don't panic when trying to do isoc transfer, just return an error.


(skrll)
diff -r1.29 -r1.30 src/sys/dev/usb/dwc_otg.c

cvs diff -r1.29 -r1.30 src/sys/dev/usb/Attic/dwc_otg.c (expand / switch to unified diff)

--- src/sys/dev/usb/Attic/dwc_otg.c 2013/01/21 07:37:06 1.29
+++ src/sys/dev/usb/Attic/dwc_otg.c 2013/01/21 07:39:59 1.30
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: dwc_otg.c,v 1.29 2013/01/21 07:37:06 skrll Exp $ */ 1/* $NetBSD: dwc_otg.c,v 1.30 2013/01/21 07:39:59 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2012 Hans Petter Selasky. All rights reserved. 4 * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
5 * Copyright (c) 2010-2011 Aleksandr Rybalko. All rights reserved. 5 * Copyright (c) 2010-2011 Aleksandr Rybalko. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -50,27 +50,27 @@ @@ -50,27 +50,27 @@
50 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 50 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
51 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 51 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
52 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 52 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
53 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 53 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 54 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
55 * POSSIBILITY OF SUCH DAMAGE. 55 * POSSIBILITY OF SUCH DAMAGE.
56 */ 56 */
57 57
58/* 58/*
59 * Designware USB 2.0 OTG 59 * Designware USB 2.0 OTG
60 */ 60 */
61 61
62#include <sys/cdefs.h> 62#include <sys/cdefs.h>
63__KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.29 2013/01/21 07:37:06 skrll Exp $"); 63__KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.30 2013/01/21 07:39:59 skrll Exp $");
64 64
65#include <sys/param.h> 65#include <sys/param.h>
66#include <sys/systm.h> 66#include <sys/systm.h>
67#include <sys/kmem.h> 67#include <sys/kmem.h>
68#include <sys/kernel.h> 68#include <sys/kernel.h>
69#include <sys/device.h> 69#include <sys/device.h>
70#include <sys/select.h> 70#include <sys/select.h>
71#include <sys/proc.h> 71#include <sys/proc.h>
72#include <sys/queue.h> 72#include <sys/queue.h>
73#include <sys/cpu.h> 73#include <sys/cpu.h>
74 74
75#include <machine/endian.h> 75#include <machine/endian.h>
76 76
@@ -1497,32 +1497,33 @@ dwc_otg_device_intr_done(usbd_xfer_handl @@ -1497,32 +1497,33 @@ dwc_otg_device_intr_done(usbd_xfer_handl
1497 dwc_otg_xfer_end(xfer); 1497 dwc_otg_xfer_end(xfer);
1498 } 1498 }
1499} 1499}
1500 1500
1501/***********************************************************************/ 1501/***********************************************************************/
1502 1502
1503usbd_status 1503usbd_status
1504dwc_otg_device_isoc_transfer(usbd_xfer_handle xfer) 1504dwc_otg_device_isoc_transfer(usbd_xfer_handle xfer)
1505{ 1505{
1506 struct dwc_otg_softc *sc = xfer->pipe->device->bus->hci_private; 1506 struct dwc_otg_softc *sc = xfer->pipe->device->bus->hci_private;
1507 usbd_status err; 1507 usbd_status err;
1508 1508
1509 DPRINTF("\n"); 1509 DPRINTF("\n");
1510 panic("not yet\n"); 
1511 1510
1512 /* Insert last in queue. */ 1511 /* Insert last in queue. */
1513 mutex_enter(&sc->sc_lock); 1512 mutex_enter(&sc->sc_lock);
1514 err = usb_insert_transfer(xfer); 1513 err = usb_insert_transfer(xfer);
1515 mutex_exit(&sc->sc_lock); 1514 mutex_exit(&sc->sc_lock);
 1515
 1516 err = USBD_IOERROR;
1516 if (err) 1517 if (err)
1517 return err; 1518 return err;
1518 1519
1519 /* Pipe isn't running, start first */ 1520 /* Pipe isn't running, start first */
1520 return dwc_otg_device_isoc_start(SIMPLEQ_FIRST(&xfer->pipe->queue)); 1521 return dwc_otg_device_isoc_start(SIMPLEQ_FIRST(&xfer->pipe->queue));
1521} 1522}
1522 1523
1523#if 0 1524#if 0
1524void 1525void
1525dwc_otg_device_isoc_enter(usbd_xfer_handle xfer) 1526dwc_otg_device_isoc_enter(usbd_xfer_handle xfer)
1526{ 1527{
1527 struct dwc_otg_pipe *dpipe = (struct dwc_otg_pipe *)xfer->pipe; 1528 struct dwc_otg_pipe *dpipe = (struct dwc_otg_pipe *)xfer->pipe;
1528 usbd_device_handle dev = dpipe->pipe.device; 1529 usbd_device_handle dev = dpipe->pipe.device;