busses/usb: Don't reject devices with "invalid" IRQs immediately.
We may be able to allocate an MSI for them. This was done for XHCI already in hrev52742. Probably fixes #15004.
This commit is contained in:
parent
5c6d92d72f
commit
67b05100d2
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user