diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2007-03-18 20:14:52 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2007-03-18 20:14:52 +0000 |
commit | 2820d116979e135234d1261ada149c763a9c0e8f (patch) | |
tree | 0bf89f6bb84c1a9536807c2a741a63210ccaa24d /sys/dev/pci/ohci_pci.c | |
parent | ac1137b6a847c7588490a81e52944d5a73b778ac (diff) |
Backout pascoe@'s last USB change because it page faults at attachment
time.
Chris; Get your shiz fixed and tested for the next time. We have
better todo then wasting our time by backing out untested stuff.
OK deraadt, OK ckuethe
Diffstat (limited to 'sys/dev/pci/ohci_pci.c')
-rw-r--r-- | sys/dev/pci/ohci_pci.c | 58 |
1 files changed, 3 insertions, 55 deletions
diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c index 7c3f3507b23..9b435a1b80f 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.30 2007/03/18 06:08:24 pascoe Exp $ */ +/* $OpenBSD: ohci_pci.c,v 1.31 2007/03/18 20:14:51 mglocker Exp $ */ /* $NetBSD: ohci_pci.c,v 1.23 2002/10/02 16:51:47 thorpej Exp $ */ /* @@ -64,17 +64,8 @@ #include <dev/usb/ohcireg.h> #include <dev/usb/ohcivar.h> -#ifdef OHCI_DEBUG -#define DPRINTF(x) do { if (ohcidebug) logprintf x; } while (0) -extern int ohcidebug; -#else -#define DPRINTF(x) -#define DPRINTFN(n,x) -#endif - int ohci_pci_match(struct device *, void *, void *); void ohci_pci_attach(struct device *, struct device *, void *); -void ohci_pci_attach_deferred(struct device *); int ohci_pci_detach(struct device *, int); struct ohci_pci_softc { @@ -109,10 +100,10 @@ ohci_pci_attach(struct device *parent, struct device *self, void *aux) pci_chipset_tag_t pc = pa->pa_pc; char const *intrstr; pci_intr_handle_t ih; - int s, i; + usbd_status r; + int s; const char *vendor; char *devname = sc->sc.sc_bus.bdev.dv_xname; - u_int32_t ctl, sts; /* Map I/O registers */ if (pci_mapreg_map(pa, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0, @@ -167,49 +158,6 @@ ohci_pci_attach(struct device *parent, struct device *self, void *aux) else snprintf(sc->sc.sc_vendor, sizeof (sc->sc.sc_vendor), "vendor 0x%04x", PCI_VENDOR(pa->pa_id)); - - /* Ignore interrupts for now */ - sc->sc.sc_dying = 1; - - /* Perform legacy handover if required. */ - ctl = bus_space_read_4(sc->sc.iot, sc->sc.ioh, OHCI_CONTROL); - if (ctl & OHCI_IR) { - /* SMM active, request change */ - DPRINTF(("ohci_init: SMM active, request owner change\n")); - if ((sc->sc.sc_intre & (OHCI_OC | OHCI_MIE)) == - (OHCI_OC | OHCI_MIE)) - bus_space_write_4(sc->sc.iot, sc->sc.ioh, - OHCI_INTERRUPT_ENABLE, OHCI_MIE); - sts = bus_space_read_4(sc->sc.iot, sc->sc.ioh, - OHCI_COMMAND_STATUS); - bus_space_write_4(sc->sc.iot, sc->sc.ioh, OHCI_COMMAND_STATUS, - sts | OHCI_OCR); - for (i = 0; i < 100 && (ctl & OHCI_IR); i++) { - usb_delay_ms(&sc->sc.sc_bus, 1); - ctl = bus_space_read_4(sc->sc.iot, sc->sc.ioh, - OHCI_CONTROL); - } - bus_space_write_4(sc->sc.iot, sc->sc.ioh, - OHCI_INTERRUPT_DISABLE, OHCI_MIE); - } - - config_defer(self, ohci_pci_attach_deferred); - - splx(s); - - return; -} - -void -ohci_pci_attach_deferred(struct device *self) -{ - struct ohci_pci_softc *sc = (struct ohci_pci_softc *)self; - usbd_status r; - int s; - - s = splusb(); - - sc->sc.sc_dying = 1; r = ohci_init(&sc->sc); if (r != USBD_NORMAL_COMPLETION) { |