diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-03-22 05:53:37 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-03-22 05:53:37 +0000 |
commit | 11e40ec323edd0c00a1fb92e5027889d05c29bde (patch) | |
tree | 3e3e4e0a3151a2e5b771c20eb649fe4174eaab1a /sys/dev/cardbus | |
parent | 55c7994211c29cfec508c44539391d806e41e8ee (diff) |
Perform legacy emulation handover for USB1 companion controllers immediately
but defer the remainder of their initialisation until after the other devices
on their PCI bus have attached. This ensures that any USB2 controller has also
completed its initialisation before we start to initialise the USB1 parts.
This minimises the chance that a nasty SMM implementation will trash the USB1
controller's config when it performs legacy emulation handover of the USB2 part.
This time without accidentally leaving the OHCI controller shutdown, and with
some cosmetic fixes.
ok dlg@, OHCI tests mglocker@
Diffstat (limited to 'sys/dev/cardbus')
-rw-r--r-- | sys/dev/cardbus/ohci_cardbus.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/cardbus/ohci_cardbus.c b/sys/dev/cardbus/ohci_cardbus.c index 5df15b2f135..857fea72a90 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.8 2006/10/12 16:35:52 grange Exp $ */ +/* $OpenBSD: ohci_cardbus.c,v 1.9 2007/03/22 05:53:36 pascoe Exp $ */ /* $NetBSD: ohci_cardbus.c,v 1.19 2004/08/02 19:14:28 mycroft Exp $ */ /* @@ -159,7 +159,15 @@ ohci_cardbus_attach(struct device *parent, struct device *self, void *aux) else snprintf(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor), "vendor 0x%04x", CARDBUS_VENDOR(ca->ca_id)); - + + /* Display revision and perform legacy emulation handover. */ + if (ohci_checkrev(&sc->sc) != USBD_NORMAL_COMPLETION || + ohci_handover(&sc->sc) != USBD_NORMAL_COMPLETION) { + cardbus_intr_disestablish(sc->sc_cc, sc->sc_cf, sc->sc_ih); + sc->sc_ih = 0; + return; + } + r = ohci_init(&sc->sc); if (r != USBD_NORMAL_COMPLETION) { printf("%s: init failed, error=%d\n", devname, r); |