1000th COMMIT: Kernel: Add basic E1000 driver

This driver is only capable to read mac address and enable and read
link status
This commit is contained in:
2023-09-13 19:09:12 +03:00
parent 63dc2b6aa6
commit a740bf8df4
6 changed files with 517 additions and 1 deletions

View File

@@ -7,6 +7,14 @@ namespace Kernel
class PCIDevice
{
public:
enum class BarType
{
INVAL,
MEM,
IO,
};
public:
PCIDevice(uint8_t, uint8_t, uint8_t);
@@ -24,6 +32,9 @@ namespace Kernel
uint8_t subclass() const { return m_subclass; }
uint8_t prog_if() const { return m_prog_if; }
BarType read_bar_type(uint8_t) const;
uint64_t read_bar_address(uint8_t) const;
void enable_bus_mastering() const;
void disable_bus_mastering() const;
@@ -41,6 +52,8 @@ namespace Kernel
uint8_t m_class_code;
uint8_t m_subclass;
uint8_t m_prog_if;
uint8_t m_header_type;
};
class PCI