mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:27: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:
parent
73a7e5875e
commit
d83a3eff1f
4 changed files with 20 additions and 25 deletions
|
@ -27,14 +27,15 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <Kernel/IRQHandler.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
#include <Kernel/Net/NetworkAdapter.h>
|
||||
#include <Kernel/PCI/Access.h>
|
||||
#include <Kernel/PCI/Device.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class E1000NetworkAdapter final : public NetworkAdapter
|
||||
, public IRQHandler {
|
||||
, public PCI::Device {
|
||||
public:
|
||||
static void detect(const PCI::Address&);
|
||||
|
||||
|
@ -45,7 +46,7 @@ public:
|
|||
virtual bool link_up() override;
|
||||
|
||||
private:
|
||||
virtual void handle_irq() override;
|
||||
virtual void handle_irq(RegisterState&) override;
|
||||
virtual const char* class_name() const override { return "E1000NetworkAdapter"; }
|
||||
|
||||
struct [[gnu::packed]] e1000_rx_desc
|
||||
|
@ -88,7 +89,6 @@ private:
|
|||
|
||||
void receive();
|
||||
|
||||
PCI::Address m_pci_address;
|
||||
u16 m_io_base { 0 };
|
||||
VirtualAddress m_mmio_base;
|
||||
OwnPtr<Region> m_mmio_region;
|
||||
|
@ -104,5 +104,4 @@ private:
|
|||
|
||||
WaitQueue m_wait_queue;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue