summaryrefslogtreecommitdiff
path: root/Kernel/Net/E1000NetworkAdapter.cpp
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-09-23 10:50:45 +0300
committerAndreas Kling <kling@serenityos.org>2021-09-29 11:24:33 +0200
commita411a44fda3ba713e139331d4c29ea32f70c99d8 (patch)
tree8f17520fc4f614a622cd2a30b591db9beff61ae6 /Kernel/Net/E1000NetworkAdapter.cpp
parent057f5a12c2c69b1bad1d8b778d3cb934b3a8f346 (diff)
downloadserenity-a411a44fda3ba713e139331d4c29ea32f70c99d8.zip
Kernel/PCI: Cache interrupt line and interrupt pin of a device
This allows us to remove the PCI::get_interrupt_line API function. As a result, this removes a bunch of not so great patterns that we used to cache PCI interrupt line in many IRQHandler derived classes instead of just using interrupt_number method of IRQHandler class.
Diffstat (limited to 'Kernel/Net/E1000NetworkAdapter.cpp')
-rw-r--r--Kernel/Net/E1000NetworkAdapter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Kernel/Net/E1000NetworkAdapter.cpp b/Kernel/Net/E1000NetworkAdapter.cpp
index d8f4ac617a..04679da459 100644
--- a/Kernel/Net/E1000NetworkAdapter.cpp
+++ b/Kernel/Net/E1000NetworkAdapter.cpp
@@ -164,7 +164,7 @@ UNMAP_AFTER_INIT RefPtr<E1000NetworkAdapter> E1000NetworkAdapter::try_to_initial
return {};
if (!is_valid_device_id(pci_device_identifier.hardware_id().device_id))
return {};
- u8 irq = PCI::get_interrupt_line(pci_device_identifier.address());
+ u8 irq = pci_device_identifier.interrupt_line().value();
auto adapter = adopt_ref_if_nonnull(new (nothrow) E1000NetworkAdapter(pci_device_identifier.address(), irq));
if (!adapter)
return {};
@@ -201,11 +201,10 @@ UNMAP_AFTER_INIT bool E1000NetworkAdapter::initialize()
m_mmio_region = region_or_error.release_value();
m_mmio_base = m_mmio_region->vaddr();
m_use_mmio = true;
- m_interrupt_line = PCI::get_interrupt_line(pci_address());
dmesgln("E1000: port base: {}", m_io_base);
dmesgln("E1000: MMIO base: {}", PhysicalAddress(PCI::get_BAR0(pci_address()) & 0xfffffffc));
dmesgln("E1000: MMIO base size: {} bytes", mmio_base_size);
- dmesgln("E1000: Interrupt line: {}", m_interrupt_line);
+ dmesgln("E1000: Interrupt line: {}", interrupt_number());
detect_eeprom();
dmesgln("E1000: Has EEPROM? {}", m_has_eeprom);
read_mac_address();