From a17e9da139e1c52635143c4adcda172513d28c19 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Fri, 9 Aug 2013 23:33:02 +0200 Subject: [PATCH] XHCI/UHCI USB: forgot to get the x86 PCI module. --- src/add-ons/kernel/busses/usb/uhci.cpp | 8 ++++++++ src/add-ons/kernel/busses/usb/xhci.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/add-ons/kernel/busses/usb/uhci.cpp b/src/add-ons/kernel/busses/usb/uhci.cpp index 42b898a3fa..f764d0d6e1 100644 --- a/src/add-ons/kernel/busses/usb/uhci.cpp +++ b/src/add-ons/kernel/busses/usb/uhci.cpp @@ -1973,6 +1973,14 @@ UHCI::AddTo(Stack *stack) return B_NO_MEMORY; } + // Try to get the PCI x86 module as well so we can enable possible MSIs. + if (sPCIx86Module == NULL && get_module(B_PCI_X86_MODULE_NAME, + (module_info **)&sPCIx86Module) != B_OK) { + // If it isn't there, that's not critical though. + TRACE_MODULE_ERROR("failed to get pci x86 module\n"); + sPCIx86Module = NULL; + } + 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 diff --git a/src/add-ons/kernel/busses/usb/xhci.cpp b/src/add-ons/kernel/busses/usb/xhci.cpp index 72edc4485d..a83075f9d3 100644 --- a/src/add-ons/kernel/busses/usb/xhci.cpp +++ b/src/add-ons/kernel/busses/usb/xhci.cpp @@ -690,6 +690,14 @@ XHCI::AddTo(Stack *stack) return B_NO_MEMORY; } + // Try to get the PCI x86 module as well so we can enable possible MSIs. + if (sPCIx86Module == NULL && get_module(B_PCI_X86_MODULE_NAME, + (module_info **)&sPCIx86Module) != B_OK) { + // If it isn't there, that's not critical though. + TRACE_MODULE_ERROR("failed to get pci x86 module\n"); + sPCIx86Module = NULL; + } + 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_xhci) {