9#ifndef MAXOS_DRIVERS_ETHERNET_INTEL_I127_H
10#define MAXOS_DRIVERS_ETHERNET_INTEL_I127_H
14#include <common/macros.h>
24namespace MaxOS::drivers::ethernet {
40 } receive_descriptor_t;
66 uint8_t bar_type = { 0 };
67 uint16_t port_base = { 0 };
68 uint64_t mem_base = { 0 };
69 uint8_t mac_address[6] = { 0 };
73 uint16_t control_register;
74 uint16_t status_register;
75 uint16_t eprom_register;
76 uint16_t control_ext_register;
77 uint16_t interrupt_mask_register;
80 uint16_t receive_control_register;
81 uint16_t receive_descriptor_low_register;
82 uint16_t receive_descriptor_high_register;
83 uint16_t receive_descriptor_length_register;
84 uint16_t receive_descriptor_head_register;
85 uint16_t receive_descriptor_tail_register;
88 uint16_t send_control_register;
89 uint16_t send_descriptor_low_register;
90 uint16_t send_descriptor_high_register;
91 uint16_t send_descriptor_length_register;
92 uint16_t send_descriptor_head_register;
93 uint16_t send_descriptor_tail_register;
100 uint16_t current_receive_buffer;
103 uint16_t current_send_buffer;
107 void write(uint16_t address, uint32_t data)
const;
108 [[nodiscard]] uint32_t read(uint16_t address)
const;
111 bool eprom_present =
false;
112 bool detect_ee_prom();
113 uint32_t eeprom_read(uint8_t addr);
116 bool read_mac_address();
123 volatile bool active;
124 volatile bool init_done;
126 void fetch_data_received();
135 uint32_t
reset()
final;
147 void do_send(uint8_t* buffer, uint32_t size)
final;
Driver for the Ethernet Controller, manages the sending and receiving of data, the mac address,...
Driver for the Intel I217 Ethernet Controller.
void deactivate() final
Deactivate the driver.
void do_send(uint8_t *buffer, uint32_t size) final
(Device Side) send the data
uint64_t get_media_access_control_address() final
Get the MAC address.
void activate() final
Activate the driver.
uint32_t reset() final
Reset the driver.
string device_name() final
Get the device name of the driver.
string vendor_name() final
Get who created the device.
void handle_interrupt() final
Handles an interrupt.
Handles a certain interrupt number.
Stores information about a PCI device.
Defines a base Driver class and DriverManager for managing drivers.
Defines an EthernetDriver class for managing Ethernet communication, including sending and receiving ...
uint64_t MediaAccessControlAddress
Used to make MAC addresses more readable.
struct PACKED MaxOS::drivers::ethernet::SendDescriptor send_descriptor_t
Alias for SendDescriptor struct.
struct PACKED MaxOS::drivers::ethernet::ReceiveDescriptor receive_descriptor_t
Alias for ReceiveDescriptor struct.
Defines a InterruptManager and InterruptHandler for managing hardware and software interrupts.
Defines classes for memory input and output operations of various bit widths (8, 16,...
Defines a MemoryManager class for handling memory allocation and deallocation.
Defines OutputStream and GenericOutputStream classes for writing data to streams.
Defines a Peripheral Component Interconnect (PCI) controller for managing PCI devices and loading the...
Defines classes for handling hardware communication ports (8, 16, and 32 bit)
The receive descriptor for the Intel I217 Ethernet Controller.
uint16_t length
The length of the received frame.
uint8_t errors
Any errors that occurred.
uint64_t buffer_address
The address of the receive buffer.
uint16_t checksum
The checksum of the received frame.
uint8_t status
The status of the received frame.
The send descriptor for the Intel I217 Ethernet Controller.
uint8_t cso
The checksum offset.
uint8_t css
The checksum start.
uint16_t length
The length of the send frame.
uint8_t status
The status.
uint64_t buffer_address
The address of the send buffer.