diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2000-02-20 14:22:44 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2000-02-20 14:22:44 +0000 |
commit | d0fd416b57d88747573af7c8e4b48891ff0382f6 (patch) | |
tree | 8a085b86d864260059e9e47a5da84509ddf1bc50 | |
parent | 21e6913264b1b666cc015d6e9e730f75dddbd3d1 (diff) | |
download | FreeBSD-src-d0fd416b57d88747573af7c8e4b48891ff0382f6.zip FreeBSD-src-d0fd416b57d88747573af7c8e4b48891ff0382f6.tar.gz |
Move the warning on wrong IRQ values to the right place, before any
resource allocation is attempted.
It will present the user with a message that he has to switch on USB
support in his BIOS.
-rw-r--r-- | sys/dev/usb/ohci_pci.c | 16 | ||||
-rw-r--r-- | sys/dev/usb/uhci_pci.c | 16 | ||||
-rw-r--r-- | sys/pci/ohci_pci.c | 16 | ||||
-rw-r--r-- | sys/pci/uhci_pci.c | 16 |
4 files changed, 32 insertions, 32 deletions
diff --git a/sys/dev/usb/ohci_pci.c b/sys/dev/usb/ohci_pci.c index 591f665..7bce5f2 100644 --- a/sys/dev/usb/ohci_pci.c +++ b/sys/dev/usb/ohci_pci.c @@ -150,6 +150,14 @@ ohci_pci_attach(device_t self) void *ih; int intr; + /* For the moment, put in a message stating what is wrong */ + intr = pci_read_config(self, PCIR_INTLINE, 1); + if (intr == 0 || intr == 255) { + device_printf(self, "Invalid irq %d\n", intr); + device_printf(self, "Please switch on USB support and switch PNP-OS to 'No' in BIOS\n"); + return ENXIO; + } + /* XXX where does it say so in the spec? */ sc->sc_bus.usbrev = USBREV_1_0; @@ -214,14 +222,6 @@ ohci_pci_attach(device_t self) sprintf(sc->sc_vendor, "(unknown)"); } - intr = pci_read_config(self, PCIR_INTLINE, 1); - if (intr == 0 || intr == 255) { - device_printf(self, "Invalid irq %d\n", intr); - device_printf(self, "Please switch on USB support and switch PNP-OS to 'No' in BIOS\n"); - err = ENXIO; - goto bad3; - } - err = BUS_SETUP_INTR(parent, self, irq_res, INTR_TYPE_BIO, (driver_intr_t *) ohci_intr, sc, &ih); if (err) { diff --git a/sys/dev/usb/uhci_pci.c b/sys/dev/usb/uhci_pci.c index a5d6c9e..8859e50 100644 --- a/sys/dev/usb/uhci_pci.c +++ b/sys/dev/usb/uhci_pci.c @@ -168,6 +168,14 @@ uhci_pci_attach(device_t self) int intr; int err; + /* For the moment, put in a message stating what is wrong */ + intr = pci_read_config(self, PCIR_INTLINE, 1); + if (intr == 0 || intr == 255) { + device_printf(self, "Invalid irq %d\n", intr); + device_printf(self, "Please switch on USB support and switch PNP-OS to 'No' in BIOS\n"); + return ENXIO; + } + rid = PCI_UHCI_BASE_REG; io_res = bus_alloc_resource(self, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); @@ -239,14 +247,6 @@ uhci_pci_attach(device_t self) break; } - intr = pci_read_config(self, PCIR_INTLINE, 1); - if (intr == 0 || intr == 255) { - device_printf(self, "Invalid irq %d\n", intr); - device_printf(self, "Please switch on USB support and switch PNP-OS to 'No' in BIOS\n"); - err = ENXIO; - goto bad3; - } - err = BUS_SETUP_INTR(parent, self, irq_res, INTR_TYPE_BIO, (driver_intr_t *) uhci_intr, sc, &ih); if (err) { diff --git a/sys/pci/ohci_pci.c b/sys/pci/ohci_pci.c index 591f665..7bce5f2 100644 --- a/sys/pci/ohci_pci.c +++ b/sys/pci/ohci_pci.c @@ -150,6 +150,14 @@ ohci_pci_attach(device_t self) void *ih; int intr; + /* For the moment, put in a message stating what is wrong */ + intr = pci_read_config(self, PCIR_INTLINE, 1); + if (intr == 0 || intr == 255) { + device_printf(self, "Invalid irq %d\n", intr); + device_printf(self, "Please switch on USB support and switch PNP-OS to 'No' in BIOS\n"); + return ENXIO; + } + /* XXX where does it say so in the spec? */ sc->sc_bus.usbrev = USBREV_1_0; @@ -214,14 +222,6 @@ ohci_pci_attach(device_t self) sprintf(sc->sc_vendor, "(unknown)"); } - intr = pci_read_config(self, PCIR_INTLINE, 1); - if (intr == 0 || intr == 255) { - device_printf(self, "Invalid irq %d\n", intr); - device_printf(self, "Please switch on USB support and switch PNP-OS to 'No' in BIOS\n"); - err = ENXIO; - goto bad3; - } - err = BUS_SETUP_INTR(parent, self, irq_res, INTR_TYPE_BIO, (driver_intr_t *) ohci_intr, sc, &ih); if (err) { diff --git a/sys/pci/uhci_pci.c b/sys/pci/uhci_pci.c index a5d6c9e..8859e50 100644 --- a/sys/pci/uhci_pci.c +++ b/sys/pci/uhci_pci.c @@ -168,6 +168,14 @@ uhci_pci_attach(device_t self) int intr; int err; + /* For the moment, put in a message stating what is wrong */ + intr = pci_read_config(self, PCIR_INTLINE, 1); + if (intr == 0 || intr == 255) { + device_printf(self, "Invalid irq %d\n", intr); + device_printf(self, "Please switch on USB support and switch PNP-OS to 'No' in BIOS\n"); + return ENXIO; + } + rid = PCI_UHCI_BASE_REG; io_res = bus_alloc_resource(self, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); @@ -239,14 +247,6 @@ uhci_pci_attach(device_t self) break; } - intr = pci_read_config(self, PCIR_INTLINE, 1); - if (intr == 0 || intr == 255) { - device_printf(self, "Invalid irq %d\n", intr); - device_printf(self, "Please switch on USB support and switch PNP-OS to 'No' in BIOS\n"); - err = ENXIO; - goto bad3; - } - err = BUS_SETUP_INTR(parent, self, irq_res, INTR_TYPE_BIO, (driver_intr_t *) uhci_intr, sc, &ih); if (err) { |