Module Name: src
Committed By: kiyohara
Date: Sat Oct 16 05:23:42 UTC 2010
Modified Files:
src/sys/dev/usb: ehci.c ehcivar.h
Log Message:
Add vendor dependent functions.
sc_vendor_init()/sc_vendor_port_status().
To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/usb/ehcivar.h
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/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.169 src/sys/dev/usb/ehci.c:1.170
--- src/sys/dev/usb/ehci.c:1.169 Wed Jul 7 03:55:01 2010
+++ src/sys/dev/usb/ehci.c Sat Oct 16 05:23:41 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci.c,v 1.169 2010/07/07 03:55:01 msaitoh Exp $ */
+/* $NetBSD: ehci.c,v 1.170 2010/10/16 05:23:41 kiyohara Exp $ */
/*
* Copyright (c) 2004-2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.169 2010/07/07 03:55:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.170 2010/10/16 05:23:41 kiyohara Exp $");
#include "ohci.h"
#include "uhci.h"
@@ -392,6 +392,8 @@
aprint_error("%s: reset timeout\n", device_xname(sc->sc_dev));
return (USBD_IOERROR);
}
+ if (sc->sc_vendor_init)
+ sc->sc_vendor_init(sc);
/* XXX need proper intr scheduling */
sc->sc_rand = 96;
@@ -2254,6 +2256,8 @@
if (v & EHCI_PS_OCA) i |= UPS_OVERCURRENT_INDICATOR;
if (v & EHCI_PS_PR) i |= UPS_RESET;
if (v & EHCI_PS_PP) i |= UPS_PORT_POWER;
+ if (sc->sc_vendor_port_status)
+ i = sc->sc_vendor_port_status(sc, v, i);
USETW(ps.wPortStatus, i);
i = 0;
if (v & EHCI_PS_CSC) i |= UPS_C_CONNECT_STATUS;
@@ -2289,7 +2293,7 @@
case UHF_PORT_RESET:
DPRINTFN(5,("ehci_root_ctrl_start: reset port %d\n",
index));
- if (EHCI_PS_IS_LOWSPEED(v)) {
+ if (EHCI_PS_IS_LOWSPEED(v) && sc->sc_ncomp > 0) {
/* Low speed device, give up ownership. */
ehci_disown(sc, index, 1);
break;
@@ -2304,7 +2308,8 @@
goto ret;
}
/* Terminate reset sequence. */
- EOWRITE4(sc, port, v);
+ v = EOREAD4(sc, port);
+ EOWRITE4(sc, port, v & ~EHCI_PS_PR);
/* Wait for HC to complete reset. */
usb_delay_ms(&sc->sc_bus, EHCI_PORT_RESET_COMPLETE);
if (sc->sc_dying) {
Index: src/sys/dev/usb/ehcivar.h
diff -u src/sys/dev/usb/ehcivar.h:1.36 src/sys/dev/usb/ehcivar.h:1.37
--- src/sys/dev/usb/ehcivar.h:1.36 Wed Feb 24 22:38:09 2010
+++ src/sys/dev/usb/ehcivar.h Sat Oct 16 05:23:42 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: ehcivar.h,v 1.36 2010/02/24 22:38:09 dyoung Exp $ */
+/* $NetBSD: ehcivar.h,v 1.37 2010/10/16 05:23:42 kiyohara Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -167,6 +167,9 @@
device_t sc_child; /* /dev/usb# device */
char sc_dying;
struct usb_dma_reserve sc_dma_reserve;
+
+ void (*sc_vendor_init)(struct ehci_softc *);
+ int (*sc_vendor_port_status)(struct ehci_softc *, uint32_t, int);
} ehci_softc_t;
#define EREAD1(sc, a) bus_space_read_1((sc)->iot, (sc)->ioh, (a))