mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
Kernel: Reorder VirtIODevice PCI initialization steps
We can't reset the device before we've read the PCI configuration space, because we read the reset register location from the configuration space.
This commit is contained in:
parent
7cf34b5549
commit
cbc845c8a8
1 changed files with 3 additions and 3 deletions
|
@ -48,9 +48,6 @@ VirtIODevice::VirtIODevice(PCI::Address address, String class_name)
|
|||
PCI::enable_interrupt_line(pci_address());
|
||||
enable_irq();
|
||||
|
||||
reset_device();
|
||||
set_status_bit(DEVICE_STATUS_ACKNOWLEDGE);
|
||||
|
||||
auto capabilities = PCI::get_physical_id(address).capabilities();
|
||||
for (auto& capability : capabilities) {
|
||||
if (capability.id() == PCI_CAPABILITY_VENDOR_SPECIFIC) {
|
||||
|
@ -90,6 +87,9 @@ VirtIODevice::VirtIODevice(PCI::Address address, String class_name)
|
|||
m_isr_cfg = get_config(ConfigurationType::ISR, 0);
|
||||
}
|
||||
|
||||
reset_device();
|
||||
set_status_bit(DEVICE_STATUS_ACKNOWLEDGE);
|
||||
|
||||
set_status_bit(DEVICE_STATUS_DRIVER);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue