mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 03:27:44 +00:00
Kernel: Clarify and make it easy to not use raw numbers
Let's put the PCI IDs as enums in the PCI namespace so they're free to pollute that namespace, but it's also more easier to use them.
This commit is contained in:
parent
b4e230a7bb
commit
3fae7ca113
9 changed files with 25 additions and 21 deletions
|
@ -21,18 +21,18 @@ UNMAP_AFTER_INIT void VirtIO::detect()
|
|||
if (address.is_null() || id.is_null())
|
||||
return;
|
||||
// TODO: We should also be checking that the device_id is in between 0x1000 - 0x107F inclusive
|
||||
if (id.vendor_id != (u16)PCIVendorID::VirtIO)
|
||||
if (id.vendor_id != PCI::VendorID::VirtIO)
|
||||
return;
|
||||
switch (id.device_id) {
|
||||
case (u16)PCIDeviceID::VirtIOConsole: {
|
||||
case PCI::DeviceID::VirtIOConsole: {
|
||||
[[maybe_unused]] auto& unused = adopt_ref(*new VirtIOConsole(address)).leak_ref();
|
||||
break;
|
||||
}
|
||||
case (u16)PCIDeviceID::VirtIOEntropy: {
|
||||
case PCI::DeviceID::VirtIOEntropy: {
|
||||
[[maybe_unused]] auto& unused = adopt_ref(*new VirtIORNG(address)).leak_ref();
|
||||
break;
|
||||
}
|
||||
case (u16)PCIDeviceID::VirtIOGPU: {
|
||||
case PCI::DeviceID::VirtIOGPU: {
|
||||
// This should have been initialized by the graphics subsystem
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue