1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:37:35 +00:00

Kernel: Update Network adapter classes to use the PCI::Device class

Those classes will inherit from the PCI::Device class, thus,
they can still implement IRQ handling.
This commit is contained in:
Liav A 2020-02-22 19:45:32 +02:00 committed by Andreas Kling
parent 73a7e5875e
commit d83a3eff1f
4 changed files with 20 additions and 25 deletions

View file

@ -27,16 +27,16 @@
#pragma once
#include <AK/OwnPtr.h>
#include <Kernel/IRQHandler.h>
#include <Kernel/Net/NetworkAdapter.h>
#include <Kernel/PCI/Access.h>
#include <Kernel/PCI/Device.h>
namespace Kernel {
#define RTL8139_TX_BUFFER_COUNT 4
class RTL8139NetworkAdapter final : public NetworkAdapter
, public IRQHandler {
, public PCI::Device {
public:
static void detect(const PCI::Address&);
@ -47,7 +47,7 @@ public:
virtual bool link_up() override { return m_link_up; }
private:
virtual void handle_irq() override;
virtual void handle_irq(RegisterState&) override;
virtual const char* class_name() const override { return "RTL8139NetworkAdapter"; }
void reset();
@ -62,7 +62,6 @@ private:
u16 in16(u16 address);
u32 in32(u16 address);
PCI::Address m_pci_address;
u16 m_io_base { 0 };
u8 m_interrupt_line { 0 };
u32 m_rx_buffer_addr { 0 };
@ -72,5 +71,4 @@ private:
u32 m_packet_buffer { 0 };
bool m_link_up { false };
};
}