1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 15:08:12 +00:00

Kernel: Add dmesgln_pci logging for Kernel::PCI

A virtual method named device_name() was added to
Kernel::PCI to support logging the PCI::Device name
and address using dmesgln_pci. Previously, PCI::Device
did not store the device name.

All devices inheriting from PCI::Device now use dmesgln_pci where
they previously used dmesgln.
This commit is contained in:
Evan Smal 2022-12-28 17:55:04 -05:00 committed by Jelle Raaijmakers
parent 6a5be5f1c5
commit 288a73ea0e
24 changed files with 90 additions and 52 deletions

View file

@ -192,16 +192,17 @@ UNMAP_AFTER_INIT void E1000NetworkAdapter::setup_interrupts()
UNMAP_AFTER_INIT bool E1000NetworkAdapter::initialize()
{
dmesgln("E1000: Found @ {}", pci_address());
dmesgln_pci(*this, "Found @ {}", pci_address());
enable_bus_mastering(pci_address());
dmesgln("E1000: IO base: {}", m_registers_io_window);
dmesgln("E1000: Interrupt line: {}", interrupt_number());
dmesgln_pci(*this, "IO base: {}", m_registers_io_window);
dmesgln_pci(*this, "Interrupt line: {}", interrupt_number());
detect_eeprom();
dmesgln("E1000: Has EEPROM? {}", m_has_eeprom);
dmesgln_pci(*this, "Has EEPROM? {}", m_has_eeprom);
read_mac_address();
auto const& mac = mac_address();
dmesgln("E1000: MAC address: {}", mac.to_string());
dmesgln_pci(*this, "MAC address: {}", mac.to_string());
initialize_rx_descriptors();
initialize_tx_descriptors();