Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
E1000Module Class Reference

#include <e1000.hpp>

Inheritance diagram for E1000Module:
IOforgePCI IOForge

Public Member Functions

 E1000Module ()
 
void load () override
 
void unload () override
 
int sendPacket (const struct data_template data[], size_t count)
 
void setNIC (struct ioforge_nic_service *nic)
 
boolean_t detectEeprom ()
 
uint32_t readEeprom (uint32_t addr)
 
boolean_t syncMacAddress ()
 
void enableInterrupt ()
 
void disableInterrupt ()
 
void linkup ()
 
void write (uint16_t p_address, uint32_t p_value)
 
void receiveHandle ()
 
uint32_t read (uint16_t p_address)
 
int getMacAddress (uint8_t mac[6])
 
void storeBufferToPool (int rx_id, void *vaddr)
 
- Public Member Functions inherited from IOforgePCI
 IOforgePCI (const char *mod)
 
struct ioforge_pci_devicefindDevice (uint16_t vendor_id, uint16_t device_id)
 
- Public Member Functions inherited from IOForge
 IOForge (const char *mod)
 

Static Public Member Functions

static E1000ModulegetInstance ()
 
static void fireHandler ()
 

Data Fields

uint8_t msix
 

Private Member Functions

void initReceiverX ()
 
void initTransmitterX ()
 

Private Attributes

bool mac_ready = 0
 
uint32_t mac_addr [6]
 
ioforge_pci_devicedevice
 
boolean_t eerprom_exists = 0
 
uint32_t rx_cur
 
uint32_t tx_cur
 
bool got_packet = 0
 
int last_readed_rx_cur = 0
 
ioforge_nic_servicenic = 0
 

Additional Inherited Members

- Protected Attributes inherited from IOForge
const char * mod
 

Detailed Description

Definition at line 38 of file e1000.hpp.

Constructor & Destructor Documentation

◆ E1000Module()

E1000Module::E1000Module ( )

Definition at line 9 of file init.cpp.

References IOforgePCI::IOforgePCI().

Referenced by fireHandler(), and getInstance().

Member Function Documentation

◆ detectEeprom()

boolean_t E1000Module::detectEeprom ( )

Definition at line 129 of file e1000.cpp.

References eerprom_exists, read(), REG_EEPROM, and write().

Referenced by load().

◆ disableInterrupt()

void E1000Module::disableInterrupt ( )

Definition at line 218 of file e1000.cpp.

References read(), REG_IMASK, and write().

◆ enableInterrupt()

void E1000Module::enableInterrupt ( )

Definition at line 206 of file e1000.cpp.

References IMS_OTHER, IMS_RXQ0, IMS_TXQ0, read(), REG_ICR, REG_IMASK, and write().

Referenced by load().

◆ fireHandler()

void E1000Module::fireHandler ( )
static

Definition at line 421 of file e1000.cpp.

References E1000Module(), getInstance(), log, and status.

Referenced by load().

◆ getInstance()

E1000Module * E1000Module::getInstance ( )
static

Definition at line 13 of file init.cpp.

References E1000Module(), and instance.

Referenced by __attribute__(), and fireHandler().

◆ getMacAddress()

int E1000Module::getMacAddress ( uint8_t mac[6])

Definition at line 537 of file e1000.cpp.

References mac_addr, and mac_ready.

◆ initReceiverX()

◆ initTransmitterX()

◆ linkup()

void E1000Module::linkup ( )

Definition at line 396 of file e1000.cpp.

References read(), REG_CTRL, and write().

Referenced by load().

◆ load()

◆ read()

uint32_t E1000Module::read ( uint16_t p_address)

Definition at line 125 of file e1000.cpp.

References device.

Referenced by detectEeprom(), disableInterrupt(), enableInterrupt(), linkup(), load(), readEeprom(), and syncMacAddress().

◆ readEeprom()

uint32_t E1000Module::readEeprom ( uint32_t addr)

Definition at line 144 of file e1000.cpp.

References addr, data, eerprom_exists, read(), REG_EEPROM, and write().

◆ receiveHandle()

void E1000Module::receiveHandle ( )

◆ sendPacket()

◆ setNIC()

void E1000Module::setNIC ( struct ioforge_nic_service * nic)
inline

Definition at line 46 of file e1000.hpp.

References nic.

Referenced by __attribute__().

◆ storeBufferToPool()

void E1000Module::storeBufferToPool ( int rx_id,
void * vaddr )

Definition at line 516 of file e1000.cpp.

References g_buf_lookup, g_buf_lookup_count, pool_push(), and serial2_printf().

◆ syncMacAddress()

boolean_t E1000Module::syncMacAddress ( )

Definition at line 162 of file e1000.cpp.

References hexmap, log, mac_addr, mac_ready, read(), and write().

Referenced by load().

◆ unload()

void E1000Module::unload ( )
overridevirtual

Implements IOforgePCI.

Definition at line 11 of file init.cpp.

◆ write()

void E1000Module::write ( uint16_t p_address,
uint32_t p_value )

Field Documentation

◆ device

ioforge_pci_device* E1000Module::device
private

Definition at line 68 of file e1000.hpp.

Referenced by load(), read(), and write().

◆ eerprom_exists

boolean_t E1000Module::eerprom_exists = 0
private

Definition at line 69 of file e1000.hpp.

Referenced by detectEeprom(), and readEeprom().

◆ got_packet

bool E1000Module::got_packet = 0
private

Definition at line 77 of file e1000.hpp.

◆ last_readed_rx_cur

int E1000Module::last_readed_rx_cur = 0
private

Definition at line 78 of file e1000.hpp.

◆ mac_addr

uint32_t E1000Module::mac_addr[6]
private

Definition at line 67 of file e1000.hpp.

Referenced by getMacAddress(), and syncMacAddress().

◆ mac_ready

bool E1000Module::mac_ready = 0
private

Definition at line 66 of file e1000.hpp.

Referenced by getMacAddress(), and syncMacAddress().

◆ msix

uint8_t E1000Module::msix

Definition at line 63 of file e1000.hpp.

Referenced by load().

◆ nic

ioforge_nic_service* E1000Module::nic = 0
private

Definition at line 79 of file e1000.hpp.

Referenced by receiveHandle(), and setNIC().

◆ rx_cur

uint32_t E1000Module::rx_cur
private

Definition at line 73 of file e1000.hpp.

Referenced by initReceiverX(), and receiveHandle().

◆ tx_cur

uint32_t E1000Module::tx_cur
private

Definition at line 74 of file e1000.hpp.

Referenced by initTransmitterX(), and sendPacket().


The documentation for this class was generated from the following files: