diff --git a/headers/os/drivers/PCI.h b/headers/os/drivers/PCI.h index da33102b62..3cfd6eae5b 100644 --- a/headers/os/drivers/PCI.h +++ b/headers/os/drivers/PCI.h @@ -480,6 +480,7 @@ struct pci_module_info { #define PCI_usb_uhci 0x00 /* Universal Host Controller Interface */ #define PCI_usb_ohci 0x10 /* Open Host Controller Interface */ +#define PCI_usb_ehci 0x20 /* Enhanced Host Controller Interface */ /* --- diff --git a/src/add-ons/kernel/busses/usb/ehci.cpp b/src/add-ons/kernel/busses/usb/ehci.cpp index 8e5b7fb9d2..db9f41693d 100644 --- a/src/add-ons/kernel/busses/usb/ehci.cpp +++ b/src/add-ons/kernel/busses/usb/ehci.cpp @@ -256,9 +256,9 @@ EHCI::AddTo(Stack *stack) } for (int32 i = 0; sPCIModule->get_nth_pci_info(i, item) >= B_OK; i++) { - // class_base: 0C (Serial Bus); class_sub: 03 (USB); class_api: 20 (EHCI) - if (item->class_base == 0x0C && item->class_sub == 0x03 - && item->class_api == 0x20) { + + 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_ERROR(("usb_ehci: found device with invalid IRQ - check IRQ assignement\n")); diff --git a/src/add-ons/kernel/busses/usb/ohci.cpp b/src/add-ons/kernel/busses/usb/ohci.cpp index 14993ee12e..0c7d3d7d21 100644 --- a/src/add-ons/kernel/busses/usb/ohci.cpp +++ b/src/add-ons/kernel/busses/usb/ohci.cpp @@ -115,11 +115,8 @@ ohci_add_to( Stack *stack ) item = new pci_info; for ( i = 0 ; OHCI::pci_module->get_nth_pci_info( i , item ) == B_OK ; i++ ) { - // - // class_base = 0C (serial bus) class_sub = 03 (usb) prog_int: 10 (OHCI) - // - if ( ( item->class_base == 0x0C ) && ( item->class_sub == 0x03 ) && - ( item->class_api == 0x10 ) ) + 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)) { diff --git a/src/add-ons/kernel/busses/usb/uhci.cpp b/src/add-ons/kernel/busses/usb/uhci.cpp index 6e6fcbcd12..a9b0b146f5 100644 --- a/src/add-ons/kernel/busses/usb/uhci.cpp +++ b/src/add-ons/kernel/busses/usb/uhci.cpp @@ -1052,9 +1052,9 @@ UHCI::AddTo(Stack *stack) } for (int32 i = 0; sPCIModule->get_nth_pci_info(i, item) >= B_OK; i++) { - //class_base = 0C (serial bus) class_sub = 03 (usb) prog_int: 00 (UHCI) - if (item->class_base == 0x0C && item->class_sub == 0x03 - && item->class_api == 0x00) { + + 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_ERROR(("usb_uhci: AddTo(): found with invalid IRQ - check IRQ assignement\n"));