summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/cardbus/ehci_cardbus.c37
-rw-r--r--sys/dev/cardbus/files.cardbus4
-rw-r--r--sys/dev/cardbus/ohci_cardbus.c19
-rw-r--r--sys/dev/cardbus/usb_cardbus.h55
-rw-r--r--sys/dev/pci/ehci_pci.c21
-rw-r--r--sys/dev/pci/files.pci3
-rw-r--r--sys/dev/pci/ohci_pci.c7
-rw-r--r--sys/dev/pci/uhci_pci.c6
-rw-r--r--sys/dev/pci/usb_pci.c81
-rw-r--r--sys/dev/pci/usb_pci.h58
-rw-r--r--sys/dev/usb/ehci.c57
-rw-r--r--sys/dev/usb/ehcivar.h6
12 files changed, 20 insertions, 334 deletions
diff --git a/sys/dev/cardbus/ehci_cardbus.c b/sys/dev/cardbus/ehci_cardbus.c
index 402028d0848..63e07ddb1c8 100644
--- a/sys/dev/cardbus/ehci_cardbus.c
+++ b/sys/dev/cardbus/ehci_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci_cardbus.c,v 1.2 2004/12/29 01:52:26 dlg Exp $ */
+/* $OpenBSD: ehci_cardbus.c,v 1.3 2005/04/11 08:09:32 dlg Exp $ */
/* $NetBSD: ehci_cardbus.c,v 1.6.6.3 2004/09/21 13:27:25 skrll Exp $ */
/*
@@ -60,8 +60,6 @@ __KERNEL_RCSID(0, "$NetBSD: ehci_cardbus.c,v 1.6.6.3 2004/09/21 13:27:25 skrll E
#include <dev/cardbus/cardbusvar.h>
#include <dev/pci/pcidevs.h>
-#include <dev/cardbus/usb_cardbus.h>
-
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdivar.h>
@@ -145,9 +143,7 @@ ehci_cardbus_attach(struct device *parent, struct device *self, void *aux)
char devinfo[256];
usbd_status r;
const char *vendor;
- u_int ncomp;
const char *devname = sc->sc.sc_bus.bdev.dv_xname;
- struct usb_cardbus *up;
cardbus_devinfo(ca->ca_id, ca->ca_class, 0, devinfo, sizeof(devinfo));
printf(": %s (rev. 0x%02x)\n", devinfo,
@@ -201,22 +197,6 @@ XXX (ct->ct_cf->cardbus_mem_open)(cc, 0, iob, iob + 0x40);
snprintf(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor),
"vendor 0x%04x", CARDBUS_VENDOR(ca->ca_id));
- /*
- * Find companion controllers. According to the spec they always
- * have lower function numbers so they should be enumerated already.
- */
- ncomp = 0;
- TAILQ_FOREACH(up, &ehci_cardbus_alldevs, next) {
- if (up->bus == ca->ca_bus && up->device == ca->ca_device) {
- DPRINTF(("ehci_cardbus_attach: companion %s\n",
- USBDEVNAME(up->usb->bdev)));
- sc->sc.sc_comps[ncomp++] = up->usb;
- if (ncomp >= EHCI_COMPANION_MAX)
- break;
- }
- }
- sc->sc.sc_ncomp = ncomp;
-
r = ehci_init(&sc->sc);
if (r != USBD_NORMAL_COMPLETION) {
printf("%s: init failed, error=%d\n", devname, r);
@@ -261,18 +241,3 @@ ehci_cardbus_detach(struct device *self, int flags)
return (0);
}
-void
-usb_cardbus_add(struct usb_cardbus *up, struct cardbus_attach_args *ca, struct usbd_bus *bu)
-{
- TAILQ_INSERT_TAIL(&ehci_cardbus_alldevs, up, next);
- up->bus = ca->ca_bus;
- up->device = ca->ca_device;
- up->function = ca->ca_function;
- up->usb = bu;
-}
-
-void
-usb_cardbus_rem(struct usb_cardbus *up)
-{
- TAILQ_REMOVE(&ehci_cardbus_alldevs, up, next);
-}
diff --git a/sys/dev/cardbus/files.cardbus b/sys/dev/cardbus/files.cardbus
index 19ca48b614e..0d2621054eb 100644
--- a/sys/dev/cardbus/files.cardbus
+++ b/sys/dev/cardbus/files.cardbus
@@ -1,4 +1,4 @@
-# $OpenBSD: files.cardbus,v 1.16 2005/03/08 20:00:24 tdeval Exp $
+# $OpenBSD: files.cardbus,v 1.17 2005/04/11 08:09:32 dlg Exp $
# $NetBSD: files.cardbus,v 1.8 2000/01/26 06:37:24 thorpej Exp $
#
# files.cardbus
@@ -76,7 +76,7 @@ file dev/cardbus/if_ral_cardbus.c ral_cardbus
# EHCI USB controller
#
attach ehci at cardbus with ehci_cardbus
-file dev/cardbus/ehci_cardbus.c ehci_cardbus needs-flag
+file dev/cardbus/ehci_cardbus.c ehci_cardbus
#
# OHCI USB controller
diff --git a/sys/dev/cardbus/ohci_cardbus.c b/sys/dev/cardbus/ohci_cardbus.c
index 409f5b2553a..58983520c49 100644
--- a/sys/dev/cardbus/ohci_cardbus.c
+++ b/sys/dev/cardbus/ohci_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci_cardbus.c,v 1.2 2005/03/30 14:02:02 dlg Exp $ */
+/* $OpenBSD: ohci_cardbus.c,v 1.3 2005/04/11 08:09:32 dlg Exp $ */
/* $NetBSD: ohci_cardbus.c,v 1.19 2004/08/02 19:14:28 mycroft Exp $ */
/*
@@ -50,8 +50,6 @@
__KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.19 2004/08/02 19:14:28 mycroft Exp $");
#endif
-#include "ehci_cardbus.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -63,10 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.19 2004/08/02 19:14:28 mycroft Ex
#include <dev/cardbus/cardbusvar.h>
#include <dev/pci/pcidevs.h>
-#if NEHCI_CARDBUS > 0
-#include <dev/cardbus/usb_cardbus.h>
-#endif
-
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdivar.h>
@@ -89,9 +83,6 @@ int ohci_cardbus_detach(struct device *, int);
struct ohci_cardbus_softc {
ohci_softc_t sc;
-#if NEHCI_CARDBUS > 0
- struct usb_cardbus sc_cardbus;
-#endif
cardbus_chipset_tag_t sc_cc;
cardbus_function_tag_t sc_cf;
cardbus_devfunc_t sc_ct;
@@ -210,10 +201,6 @@ XXX (ct->ct_cf->cardbus_mem_open)(cc, 0, iob, iob + 0x40);
sc->sc.sc_powerhook = powerhook_establish(ohci_power, &sc->sc);
-#if NEHCI_CARDBUS > 0
- usb_cardbus_add(&sc->sc_cardbus, ca, &sc->sc.sc_bus);
-#endif
-
/* Attach usb device. */
sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
usbctlprint);
@@ -244,8 +231,6 @@ ohci_cardbus_detach(struct device *self, int flags)
sc->sc.ioh, sc->sc.sc_size);
sc->sc.sc_size = 0;
}
-#if NEHCI_CARDBUS > 0
- usb_cardbus_rem(&sc->sc_cardbus);
-#endif
+
return (0);
}
diff --git a/sys/dev/cardbus/usb_cardbus.h b/sys/dev/cardbus/usb_cardbus.h
deleted file mode 100644
index 4d5485144c6..00000000000
--- a/sys/dev/cardbus/usb_cardbus.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* $OpenBSD: usb_cardbus.h,v 1.1 2004/12/07 05:42:41 dlg Exp $ */
-/* $NetBSD: usb_cardbus.h,v 1.1.6.1 2002/01/10 19:53:47 thorpej Exp $ */
-
-/*
- * Copyright (c) 2001 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (lennart@augustsson.net) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * EHCI controllers need a way to find their compainion controllers
- * so we keep track of them as we attach.
- */
-
-struct usb_cardbus {
- TAILQ_ENTRY(usb_cardbus) next;
- u_int bus;
- u_int device;
- u_int function;
- struct usbd_bus *usb;
-};
-void usb_cardbus_add(struct usb_cardbus *, struct cardbus_attach_args *,
- struct usbd_bus *);
-void usb_cardbus_rem(struct usb_cardbus *);
diff --git a/sys/dev/pci/ehci_pci.c b/sys/dev/pci/ehci_pci.c
index eaf5df4ea19..3bb2b4ec76c 100644
--- a/sys/dev/pci/ehci_pci.c
+++ b/sys/dev/pci/ehci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci_pci.c,v 1.5 2005/03/07 11:12:04 pascoe Exp $ */
+/* $OpenBSD: ehci_pci.c,v 1.6 2005/04/11 08:09:32 dlg Exp $ */
/* $NetBSD: ehci_pci.c,v 1.15 2004/04/23 21:13:06 itojun Exp $ */
/*
@@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.15 2004/04/23 21:13:06 itojun Exp $")
#include <dev/pci/pcidevs.h>
#include <dev/pci/pcivar.h>
-#include <dev/pci/usb_pci.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
@@ -116,8 +115,6 @@ ehci_pci_attach(struct device *parent, struct device *self, void *aux)
const char *vendor;
char *devname = sc->sc.sc_bus.bdev.dv_xname;
usbd_status r;
- int ncomp;
- struct usb_pci *up;
#if defined(__NetBSD__)
char devinfo[256];
@@ -195,22 +192,6 @@ ehci_pci_attach(struct device *parent, struct device *self, void *aux)
if (sc->sc.sc_id_vendor == PCI_VENDOR_VIATECH)
sc->sc.sc_flags |= EHCIF_DROPPED_INTR_WORKAROUND;
- /*
- * Find companion controllers. According to the spec they always
- * have lower function numbers so they should be enumerated already.
- */
- ncomp = 0;
- TAILQ_FOREACH(up, &ehci_pci_alldevs, next) {
- if (up->bus == pa->pa_bus && up->device == pa->pa_device) {
- DPRINTF(("ehci_pci_attach: companion %s\n",
- USBDEVNAME(up->usb->bdev)));
- sc->sc.sc_comps[ncomp++] = up->usb;
- if (ncomp >= EHCI_COMPANION_MAX)
- break;
- }
- }
- sc->sc.sc_ncomp = ncomp;
-
ehci_pci_takecontroller(sc);
r = ehci_init(&sc->sc);
if (r != USBD_NORMAL_COMPLETION) {
diff --git a/sys/dev/pci/files.pci b/sys/dev/pci/files.pci
index 41752444325..3b2396e487c 100644
--- a/sys/dev/pci/files.pci
+++ b/sys/dev/pci/files.pci
@@ -1,4 +1,4 @@
-# $OpenBSD: files.pci,v 1.173 2005/03/08 20:00:25 tdeval Exp $
+# $OpenBSD: files.pci,v 1.174 2005/04/11 08:09:32 dlg Exp $
# $NetBSD: files.pci,v 1.20 1996/09/24 17:47:15 christos Exp $
#
# Config file and device description for machine-independent PCI code.
@@ -392,7 +392,6 @@ file dev/pci/ohci_pci.c ohci
# EHCI USB controller
attach ehci at pci with ehci_pci
file dev/pci/ehci_pci.c ehci
-file dev/pci/usb_pci.c ehci | uhci | ohci
# YENTA PCI-CardBus bridge
#device cbb: cbbus, pcmciabus
diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c
index 804c65225f4..ca7ddc4a1e6 100644
--- a/sys/dev/pci/ohci_pci.c
+++ b/sys/dev/pci/ohci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci_pci.c,v 1.23 2005/03/30 14:02:03 dlg Exp $ */
+/* $OpenBSD: ohci_pci.c,v 1.24 2005/04/11 08:09:32 dlg Exp $ */
/* $NetBSD: ohci_pci.c,v 1.23 2002/10/02 16:51:47 thorpej Exp $ */
/*
@@ -55,7 +55,6 @@
#include <machine/bus.h>
#include <dev/pci/pcivar.h>
-#include <dev/pci/usb_pci.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
@@ -71,7 +70,6 @@ int ohci_pci_detach(device_ptr_t, int);
struct ohci_pci_softc {
ohci_softc_t sc;
- struct usb_pci sc_pci;
pci_chipset_tag_t sc_pc;
void *sc_ih; /* interrupt vectoring */
};
@@ -183,8 +181,6 @@ ohci_pci_attach(struct device *parent, struct device *self, void *aux)
splx(s);
- usb_pci_add(&sc->sc_pci, pa, &sc->sc.sc_bus);
-
/* Attach usb device. */
sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
usbctlprint);
@@ -210,6 +206,5 @@ ohci_pci_detach(device_ptr_t self, int flags)
bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size);
sc->sc.sc_size = 0;
}
- usb_pci_rem(&sc->sc_pci);
return (0);
}
diff --git a/sys/dev/pci/uhci_pci.c b/sys/dev/pci/uhci_pci.c
index e853fc50153..c26ae50b878 100644
--- a/sys/dev/pci/uhci_pci.c
+++ b/sys/dev/pci/uhci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci_pci.c,v 1.18 2004/12/31 04:22:32 dlg Exp $ */
+/* $OpenBSD: uhci_pci.c,v 1.19 2005/04/11 08:09:32 dlg Exp $ */
/* $NetBSD: uhci_pci.c,v 1.24 2002/10/02 16:51:58 thorpej Exp $ */
/*
@@ -48,7 +48,6 @@
#include <machine/bus.h>
#include <dev/pci/pcivar.h>
-#include <dev/pci/usb_pci.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
@@ -64,7 +63,6 @@ int uhci_pci_detach(device_ptr_t, int);
struct uhci_pci_softc {
uhci_softc_t sc;
- struct usb_pci sc_pci;
pci_chipset_tag_t sc_pc;
pcitag_t sc_tag;
void *sc_ih; /* interrupt vectoring */
@@ -187,7 +185,6 @@ uhci_pci_attach(struct device *parent, struct device *self, void *aux)
return;
}
- usb_pci_add(&sc->sc_pci, pa, &sc->sc.sc_bus);
/* Attach usb device. */
sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
usbctlprint);
@@ -210,7 +207,6 @@ uhci_pci_detach(device_ptr_t self, int flags)
bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size);
sc->sc.sc_size = 0;
}
- usb_pci_rem(&sc->sc_pci);
return (0);
}
diff --git a/sys/dev/pci/usb_pci.c b/sys/dev/pci/usb_pci.c
deleted file mode 100644
index 941d290d947..00000000000
--- a/sys/dev/pci/usb_pci.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* $OpenBSD: usb_pci.c,v 1.2 2004/10/01 04:08:46 jsg Exp $ */
-/* $NetBSD: usb_pci.c,v 1.3 2002/02/14 21:58:30 augustss Exp $ */
-
-/*
- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (lennart@augustsson.net).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-#if defined(__NetBSD__)
-__KERNEL_RCSID(0, "$NetBSD: usb_pci.c,v 1.3 2002/02/14 21:58:30 augustss Exp $");
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/device.h>
-#include <sys/proc.h>
-#include <sys/queue.h>
-
-#include <machine/bus.h>
-
-#include <dev/pci/pcivar.h>
-#include <dev/pci/usb_pci.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h>
-
-#include <dev/usb/ehcireg.h>
-#include <dev/usb/ehcivar.h>
-
-struct usb_pci_alldevs ehci_pci_alldevs =
- TAILQ_HEAD_INITIALIZER(ehci_pci_alldevs);
-
-void
-usb_pci_add(struct usb_pci *up, struct pci_attach_args *pa, struct usbd_bus *bu)
-{
- TAILQ_INSERT_TAIL(&ehci_pci_alldevs, up, next);
- up->bus = pa->pa_bus;
- up->device = pa->pa_device;
- up->function = pa->pa_function;
- up->usb = bu;
-}
-
-void
-usb_pci_rem(struct usb_pci *up)
-{
- TAILQ_REMOVE(&ehci_pci_alldevs, up, next);
-}
diff --git a/sys/dev/pci/usb_pci.h b/sys/dev/pci/usb_pci.h
deleted file mode 100644
index 880bf08b952..00000000000
--- a/sys/dev/pci/usb_pci.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* $OpenBSD: usb_pci.h,v 1.2 2004/10/01 04:08:46 jsg Exp $ */
-/* $NetBSD: usb_pci.h,v 1.3 2002/02/14 21:58:30 augustss Exp $ */
-
-/*
- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (lennart@augustsson.net) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * EHCI controllers need a way to find their compainion controllers
- * so we keep track of them as we attach.
- */
-
-struct usb_pci {
- TAILQ_ENTRY(usb_pci) next;
- u_int bus;
- u_int device;
- u_int function;
- struct usbd_bus *usb;
-};
-
-TAILQ_HEAD(usb_pci_alldevs, usb_pci);
-extern struct usb_pci_alldevs ehci_pci_alldevs;
-
-void usb_pci_add(struct usb_pci *, struct pci_attach_args *, struct usbd_bus *);
-void usb_pci_rem(struct usb_pci *);
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index d336d399ae8..fb4a6331840 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci.c,v 1.47 2005/04/10 09:57:02 dlg Exp $ */
+/* $OpenBSD: ehci.c,v 1.48 2005/04/11 08:09:32 dlg Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
@@ -59,9 +59,6 @@
* 2) Command failures are not recovered correctly.
*/
-#include "ohci.h"
-#include "uhci.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -336,44 +333,26 @@ ehci_reverse_bits(u_int8_t c, int nbits)
usbd_status
ehci_init(ehci_softc_t *sc)
{
- u_int32_t version, sparams, cparams, hcr;
+ u_int32_t sparams, cparams, hcr;
u_int i, j;
usbd_status err;
ehci_soft_qh_t *sqh;
- DPRINTF(("ehci_init: start\n"));
#ifdef EHCI_DEBUG
+ u_int32_t version;
theehci = sc;
-#endif
- sc->sc_offs = EREAD1(sc, EHCI_CAPLENGTH);
+ DPRINTF(("ehci_init: start\n"));
version = EREAD2(sc, EHCI_HCIVERSION);
- printf("%s: EHCI version %x.%x\n", USBDEVNAME(sc->sc_bus.bdev),
- version >> 8, version & 0xff);
+ DPRINTF(("%s: EHCI version %x.%x\n", USBDEVNAME(sc->sc_bus.bdev),
+ version >> 8, version & 0xff));
+#endif
+
+ sc->sc_offs = EREAD1(sc, EHCI_CAPLENGTH);
sparams = EREAD4(sc, EHCI_HCSPARAMS);
DPRINTF(("ehci_init: sparams=0x%x\n", sparams));
- sc->sc_npcomp = EHCI_HCS_N_PCC(sparams);
- if (EHCI_HCS_N_CC(sparams) != sc->sc_ncomp) {
- printf("%s: wrong number of companions (%d != %d)\n",
- USBDEVNAME(sc->sc_bus.bdev),
- EHCI_HCS_N_CC(sparams), sc->sc_ncomp);
-#if NOHCI == 0 || NUHCI == 0
- printf("%s: ohci or uhci probably not configured\n",
- USBDEVNAME(sc->sc_bus.bdev));
-#endif
- return (USBD_IOERROR);
- }
- if (sc->sc_ncomp > 0) {
- printf("%s: companion controller%s, %d port%s each:",
- USBDEVNAME(sc->sc_bus.bdev), sc->sc_ncomp!=1 ? "s" : "",
- EHCI_HCS_N_PCC(sparams),
- EHCI_HCS_N_PCC(sparams)!=1 ? "s" : "");
- for (i = 0; i < sc->sc_ncomp; i++)
- printf(" %s", USBDEVNAME(sc->sc_comps[i]->bdev));
- printf("\n");
- }
sc->sc_noport = EHCI_HCS_N_PORTS(sparams);
cparams = EREAD4(sc, EHCI_HCCPARAMS);
DPRINTF(("ehci_init: cparams=0x%x\n", cparams));
@@ -2064,24 +2043,8 @@ ehci_disown(ehci_softc_t *sc, int index, int lowspeed)
int port;
u_int32_t v;
-#if 0
DPRINTF(("ehci_disown: index=%d lowspeed=%d\n", index, lowspeed));
-#endif
-#ifdef EHCI_DEBUG
- if (sc->sc_npcomp != 0) {
- int i = (index-1) / sc->sc_npcomp;
- if (i >= sc->sc_ncomp)
- DPRINTF(("%s: strange port\n",
- USBDEVNAME(sc->sc_bus.bdev)));
- else
- DPRINTF(("%s: handing over %s speed device on "
- "port %d to %s\n", USBDEVNAME(sc->sc_bus.bdev),
- lowspeed ? "low" : "full", index,
- USBDEVNAME(sc->sc_comps[i]->bdev)));
- } else {
- DPRINTF(("%s: npcomp == 0\n", USBDEVNAME(sc->sc_bus.bdev)));
- }
-#endif
+
port = EHCI_PORTSC(index);
v = EOREAD4(sc, port) &~ EHCI_PS_CLEAR;
EOWRITE4(sc, port, v | EHCI_PS_PO);
diff --git a/sys/dev/usb/ehcivar.h b/sys/dev/usb/ehcivar.h
index 8e79b5fd3e4..145e9e85bcc 100644
--- a/sys/dev/usb/ehcivar.h
+++ b/sys/dev/usb/ehcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehcivar.h,v 1.8 2005/03/07 11:12:04 pascoe Exp $ */
+/* $OpenBSD: ehcivar.h,v 1.9 2005/04/11 08:09:32 dlg Exp $ */
/* $NetBSD: ehcivar.h,v 1.12 2001/12/31 12:16:57 augustss Exp $ */
/*
@@ -102,10 +102,6 @@ typedef struct ehci_softc {
void *sc_powerhook; /* cookie from power hook */
void *sc_shutdownhook; /* cookie from shutdown hook */
- u_int sc_ncomp;
- u_int sc_npcomp;
- struct usbd_bus *sc_comps[EHCI_COMPANION_MAX];
-
usb_dma_t sc_fldma;
ehci_link_t *sc_flist;
u_int sc_flsize;