diff --git a/src/add-ons/kernel/busses/usb/ehci.cpp b/src/add-ons/kernel/busses/usb/ehci.cpp index d583e7c76d..2e0b6584d5 100644 --- a/src/add-ons/kernel/busses/usb/ehci.cpp +++ b/src/add-ons/kernel/busses/usb/ehci.cpp @@ -143,14 +143,8 @@ EHCI::AddTo(Stack *stack) for (int32 i = 0; sPCIModule->get_nth_pci_info(i, item) >= B_OK; i++) { if (item->class_base == PCI_serial_bus && item->class_sub == PCI_usb && item->class_api == PCI_usb_ehci) { - if (item->u.h0.interrupt_line == 0 - || item->u.h0.interrupt_line == 0xFF) { - TRACE_MODULE_ERROR("found device with invalid IRQ - " - "check IRQ assignement\n"); - continue; - } - - TRACE_MODULE("found device at IRQ %u\n", item->u.h0.interrupt_line); + TRACE_MODULE("found device at PCI:%d:%d:%d\n", + item->bus, item->device, item->function); EHCI *bus = new(std::nothrow) EHCI(item, stack); if (!bus) { delete item; @@ -465,6 +459,11 @@ EHCI::EHCI(pci_info *info, Stack *stack) } } + if (fIRQ == 0 || fIRQ == 0xFF) { + TRACE_MODULE_ERROR("device was assigned an invalid IRQ\n"); + return; + } + // install the interrupt handler and enable interrupts install_io_interrupt_handler(fIRQ, InterruptHandler, (void *)this, 0); diff --git a/src/add-ons/kernel/busses/usb/ohci.cpp b/src/add-ons/kernel/busses/usb/ohci.cpp index dc4df8170f..fc0652f465 100644 --- a/src/add-ons/kernel/busses/usb/ohci.cpp +++ b/src/add-ons/kernel/busses/usb/ohci.cpp @@ -94,15 +94,8 @@ OHCI::AddTo(Stack *stack) for (uint32 i = 0 ; sPCIModule->get_nth_pci_info(i, item) >= B_OK; i++) { if (item->class_base == PCI_serial_bus && item->class_sub == PCI_usb && item->class_api == PCI_usb_ohci) { - if (item->u.h0.interrupt_line == 0 - || item->u.h0.interrupt_line == 0xFF) { - TRACE_MODULE_ERROR("found device with invalid IRQ -" - " check IRQ assignement\n"); - continue; - } - - TRACE_MODULE("found device at IRQ %u\n", - item->u.h0.interrupt_line); + TRACE_MODULE("found device at PCI:%d:%d:%d\n", + item->bus, item->device, item->function); OHCI *bus = new(std::nothrow) OHCI(item, stack); if (!bus) { delete item; @@ -444,6 +437,11 @@ OHCI::OHCI(pci_info *info, Stack *stack) } } + if (fIRQ == 0 || fIRQ == 0xFF) { + TRACE_MODULE_ERROR("device was assigned an invalid IRQ\n"); + return; + } + // Install the interrupt handler TRACE("installing interrupt handler\n"); install_io_interrupt_handler(fIRQ, _InterruptHandler, (void *)this, 0); diff --git a/src/add-ons/kernel/busses/usb/uhci.cpp b/src/add-ons/kernel/busses/usb/uhci.cpp index 27cb57b1ea..c894cd8785 100644 --- a/src/add-ons/kernel/busses/usb/uhci.cpp +++ b/src/add-ons/kernel/busses/usb/uhci.cpp @@ -329,17 +329,10 @@ UHCI::AddTo(Stack *stack) } for (int32 i = 0; sPCIModule->get_nth_pci_info(i, item) >= B_OK; i++) { - if (item->class_base == PCI_serial_bus && item->class_sub == PCI_usb && item->class_api == PCI_usb_uhci) { - if (item->u.h0.interrupt_line == 0 - || item->u.h0.interrupt_line == 0xFF) { - TRACE_MODULE_ERROR("AddTo(): found with invalid IRQ - check IRQ assignement\n"); - continue; - } - - TRACE_MODULE("AddTo(): found at IRQ %u\n", - item->u.h0.interrupt_line); + TRACE_MODULE("found device at PCI:%d:%d:%d\n", + item->bus, item->device, item->function); UHCI *bus = new(std::nothrow) UHCI(item, stack); if (!bus) { delete item; @@ -577,6 +570,11 @@ UHCI::UHCI(pci_info *info, Stack *stack) } } + if (fIRQ == 0 || fIRQ == 0xFF) { + TRACE_MODULE_ERROR("device was assigned an invalid IRQ\n"); + return; + } + // Install the interrupt handler TRACE("installing interrupt handler\n"); install_io_interrupt_handler(fIRQ, InterruptHandler, (void *)this, 0);