mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
Kernel/USB: Tighten up USBManagement enumeration code a bit
This commit is contained in:
parent
1479ee3f3e
commit
d16d116b65
Notes:
sideshowbarker
2024-07-18 07:10:42 +09:00
Author: https://github.com/supercomputer7
Commit: d16d116b65
Pull-request: https://github.com/SerenityOS/serenity/pull/9313
1 changed files with 27 additions and 26 deletions
|
@ -22,9 +22,12 @@ UNMAP_AFTER_INIT USBManagement::USBManagement()
|
||||||
|
|
||||||
UNMAP_AFTER_INIT void USBManagement::enumerate_controllers()
|
UNMAP_AFTER_INIT void USBManagement::enumerate_controllers()
|
||||||
{
|
{
|
||||||
if (!kernel_command_line().disable_usb()) {
|
if (kernel_command_line().disable_usb())
|
||||||
|
return;
|
||||||
|
|
||||||
PCI::enumerate([this](PCI::Address const& address, PCI::ID) {
|
PCI::enumerate([this](PCI::Address const& address, PCI::ID) {
|
||||||
if (PCI::get_class(address) == 0xc && PCI::get_subclass(address) == 0x3) {
|
if (!(PCI::get_class(address) == 0xc && PCI::get_subclass(address) == 0x3))
|
||||||
|
return;
|
||||||
if (PCI::get_programming_interface(address) == 0x0) {
|
if (PCI::get_programming_interface(address) == 0x0) {
|
||||||
if (kernel_command_line().disable_uhci_controller())
|
if (kernel_command_line().disable_uhci_controller())
|
||||||
return;
|
return;
|
||||||
|
@ -51,9 +54,7 @@ UNMAP_AFTER_INIT void USBManagement::enumerate_controllers()
|
||||||
}
|
}
|
||||||
|
|
||||||
dmesgln("USBManagement: Unknown/unsupported controller at {} with programming interface 0x{:02x}", address, PCI::get_programming_interface(address));
|
dmesgln("USBManagement: Unknown/unsupported controller at {} with programming interface 0x{:02x}", address, PCI::get_programming_interface(address));
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool USBManagement::initialized()
|
bool USBManagement::initialized()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue