|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include <e1000.hpp>
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_device * | findDevice (uint16_t vendor_id, uint16_t device_id) |
Public Member Functions inherited from IOForge | |
| IOForge (const char *mod) | |
Static Public Member Functions | |
| static E1000Module * | getInstance () |
| 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_device * | device |
| 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_service * | nic = 0 |
Additional Inherited Members | |
Protected Attributes inherited from IOForge | |
| const char * | mod |
| E1000Module::E1000Module | ( | ) |
Definition at line 9 of file init.cpp.
References IOforgePCI::IOforgePCI().
Referenced by fireHandler(), and getInstance().
| boolean_t E1000Module::detectEeprom | ( | ) |
Definition at line 129 of file e1000.cpp.
References eerprom_exists, read(), REG_EEPROM, and write().
Referenced by load().
| void E1000Module::disableInterrupt | ( | ) |
| void E1000Module::enableInterrupt | ( | ) |
|
static |
Definition at line 421 of file e1000.cpp.
References E1000Module(), getInstance(), log, and status.
Referenced by load().
|
static |
Definition at line 13 of file init.cpp.
References E1000Module(), and instance.
Referenced by __attribute__(), and fireHandler().
| int E1000Module::getMacAddress | ( | uint8_t | mac[6] | ) |
|
private |
Definition at line 238 of file e1000.cpp.
References BUFFER_POOL_SIZE, rx_buffer_pool::buffers, E1000_NUM_RX_DESC, g_buf_lookup, g_buf_lookup_count, rx_buffer_pool::head, log, IOForge::mod, rx_buffer::paddr, pool_pop(), ptr, RCTL_BAM, RCTL_BSIZE_2048, RCTL_EN, RCTL_SECRC, REG_RADV, REG_RCTRL, REG_RDTR, REG_RXDCTL, REG_RXDESCHEAD, REG_RXDESCHI, REG_RXDESCLEN, REG_RXDESCLO, REG_RXDESCTAIL, rx_comp, rx_cur, rx_descs, rx_buffer_pool::tail, rx_buffer::vaddr, and write().
Referenced by load().
|
private |
Definition at line 321 of file e1000.cpp.
References E1000_NUM_TX_DESC, log, IOForge::mod, ptr, REG_TCTRL, REG_TIPG, REG_TXDESCHEAD, REG_TXDESCHI, REG_TXDESCLEN, REG_TXDESCLO, REG_TXDESCTAIL, serial2_printf(), setup_tx_done, TCTL_COLD_SHIFT, TCTL_CT_SHIFT, TCTL_EN, TCTL_PSP, TCTL_RTLC, TSTA_DD, tx_cur, tx_descs, and write().
Referenced by load().
| void E1000Module::linkup | ( | ) |
|
overridevirtual |
Implements IOforgePCI.
Definition at line 21 of file init.cpp.
References detectEeprom(), device, enableInterrupt(), IOforgePCI::findDevice(), fireHandler(), IMS_OTHER, IMS_RXQ0, IMS_TXQ0, initReceiverX(), initTransmitterX(), ioforge_get_current_core_id(), isr_irq_register(), linkup(), log, IOForge::mod, msix, pci_cap_find_msi(), pci_cap_find_msix(), pci_enable_msi(), pci_enable_msix(), read(), serial2_printf(), status, syncMacAddress(), and write().
Definition at line 125 of file e1000.cpp.
References device.
Referenced by detectEeprom(), disableInterrupt(), enableInterrupt(), linkup(), load(), readEeprom(), and syncMacAddress().
Definition at line 144 of file e1000.cpp.
References addr, data, eerprom_exists, read(), REG_EEPROM, and write().
| void E1000Module::receiveHandle | ( | ) |
Definition at line 460 of file e1000.cpp.
References addr, E1000_NUM_RX_MASK, ioforge_nic_rx(), nic, rx_buffer::paddr, pool_pop(), REG_RXDESCTAIL, rx_comp, rx_cur, rx_descs, status, rx_buffer::vaddr, and write().
| int E1000Module::sendPacket | ( | const struct data_template | data[], |
| size_t | count ) |
Definition at line 358 of file e1000.cpp.
References data_template::buffer, CMD_EOP, CMD_IFCS, CMD_RS, count, data, E1000_NUM_TX_DESC, data_template::len, REG_TXDESCTAIL, serial2_printf(), setup_tx_done, tx_cur, tx_descs, data_template::wait_next_data, and write().
|
inline |
| 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().
| boolean_t E1000Module::syncMacAddress | ( | ) |
|
overridevirtual |
Implements IOforgePCI.
Definition at line 119 of file e1000.cpp.
Referenced by detectEeprom(), disableInterrupt(), enableInterrupt(), initReceiverX(), initTransmitterX(), linkup(), load(), readEeprom(), receiveHandle(), sendPacket(), and syncMacAddress().
|
private |
|
private |
Definition at line 69 of file e1000.hpp.
Referenced by detectEeprom(), and readEeprom().
|
private |
Definition at line 67 of file e1000.hpp.
Referenced by getMacAddress(), and syncMacAddress().
|
private |
Definition at line 66 of file e1000.hpp.
Referenced by getMacAddress(), and syncMacAddress().
|
private |
Definition at line 79 of file e1000.hpp.
Referenced by receiveHandle(), and setNIC().
|
private |
Definition at line 73 of file e1000.hpp.
Referenced by initReceiverX(), and receiveHandle().
|
private |
Definition at line 74 of file e1000.hpp.
Referenced by initTransmitterX(), and sendPacket().