|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include "e1000/e1000.hpp"#include "ioforge/ioforge.h"#include "ioforge/ioforge_nic.h"#include <type.h>Go to the source code of this file.
Data Structures | |
| struct | rx_buf_lookup_entry |
Macros | |
| #define | IO_ADDR_OFFSET 0x0 |
| #define | IO_DATA_OFFSET 0x4 |
| #define | REG_CTRL 0x0000 |
| #define | REG_STATUS 0x0008 |
| #define | REG_EEPROM 0x0014 |
| #define | REG_CTRL_EXT 0x0018 |
| #define | REG_IMASK 0x00D0 |
| #define | REG_RCTRL 0x0100 |
| #define | REG_RXDESCLO 0x2800 |
| #define | REG_RXDESCHI 0x2804 |
| #define | REG_RXDESCLEN 0x2808 |
| #define | REG_RXDESCHEAD 0x2810 |
| #define | REG_RXDESCTAIL 0x2818 |
| #define | IMS_RXT0 (1 << 7) |
| #define | IMS_RXO (1 << 6) |
| #define | IMS_RXDMT0 (1 << 4) |
| #define | IMS_LSC (1 << 2) |
| #define | IMS_RXQ0 (1 << 20) |
| #define | IMS_TXQ0 (1 << 22) |
| #define | IMS_OTHER (1 << 24) |
| #define | REG_TCTRL 0x0400 |
| #define | REG_TXDESCLO 0x3800 |
| #define | REG_TXDESCHI 0x3804 |
| #define | REG_TXDESCLEN 0x3808 |
| #define | REG_TXDESCHEAD 0x3810 |
| #define | REG_TXDESCTAIL 0x3818 |
| #define | REG_RDTR 0x2820 |
| #define | REG_RXDCTL 0x2828 |
| #define | REG_RADV 0x282C |
| #define | REG_RSRPD 0x2C00 |
| #define | REG_TIPG 0x0410 |
| #define | ECTRL_SLU 0x40 |
| #define | RCTL_EN (1 << 1) |
| #define | RCTL_SBP (1 << 2) |
| #define | RCTL_UPE (1 << 3) |
| #define | RCTL_MPE (1 << 4) |
| #define | RCTL_LPE (1 << 5) |
| #define | RCTL_LBM_NONE (0 << 6) |
| #define | RCTL_LBM_PHY (3 << 6) |
| #define | RTCL_RDMTS_HALF (0 << 8) |
| #define | RTCL_RDMTS_QUARTER (1 << 8) |
| #define | RTCL_RDMTS_EIGHTH (2 << 8) |
| #define | RCTL_MO_36 (0 << 12) |
| #define | RCTL_MO_35 (1 << 12) |
| #define | RCTL_MO_34 (2 << 12) |
| #define | RCTL_MO_32 (3 << 12) |
| #define | RCTL_BAM (1 << 15) |
| #define | RCTL_VFE (1 << 18) |
| #define | RCTL_CFIEN (1 << 19) |
| #define | RCTL_CFI (1 << 20) |
| #define | RCTL_DPF (1 << 22) |
| #define | RCTL_PMCF (1 << 23) |
| #define | RCTL_SECRC (1 << 26) |
| #define | RCTL_BSIZE_256 (3 << 16) |
| #define | RCTL_BSIZE_512 (2 << 16) |
| #define | RCTL_BSIZE_1024 (1 << 16) |
| #define | RCTL_BSIZE_2048 (0 << 16) |
| #define | RCTL_BSIZE_4096 ((3 << 16) | (1 << 25)) |
| #define | RCTL_BSIZE_8192 ((2 << 16) | (1 << 25)) |
| #define | RCTL_BSIZE_16384 ((1 << 16) | (1 << 25)) |
| #define | CMD_EOP (1 << 0) |
| #define | CMD_IFCS (1 << 1) |
| #define | CMD_IC (1 << 2) |
| #define | CMD_RS (1 << 3) |
| #define | CMD_RPS (1 << 4) |
| #define | CMD_VLE (1 << 6) |
| #define | CMD_IDE (1 << 7) |
| #define | TCTL_EN (1 << 1) |
| #define | TCTL_PSP (1 << 3) |
| #define | TCTL_CT_SHIFT 4 |
| #define | TCTL_COLD_SHIFT 12 |
| #define | TCTL_SWXOFF (1 << 22) |
| #define | TCTL_RTLC (1 << 24) |
| #define | TSTA_DD (1 << 0) |
| #define | TSTA_EC (1 << 1) |
| #define | TSTA_LC (1 << 2) |
| #define | LSTA_TU (1 << 3) |
| #define | REG_ICR 0x00C0 |
| #define | ICR_TXDW (1 << 0) |
| #define | ICR_TXQE (1 << 1) |
| #define | ICR_LSC (1 << 2) |
| #define | ICR_RXSEQ (1 << 3) |
| #define | ICR_RXDMT0 (1 << 4) |
| #define | ICR_RXO (1 << 6) |
| #define | ICR_RXT0 (1 << 7) |
| #define | ICR_MDAC (1 << 9) |
| #define | ICR_RXCFG (1 << 10) |
| #define | ICR_GPI_EN0 (1 << 11) |
| #define | ICR_GPI_EN1 (1 << 12) |
| #define | ICR_GPI_EN2 (1 << 13) |
| #define | ICR_GPI_EN3 (1 << 14) |
Functions | |
| static bool | pool_pop (struct rx_buffer *out) |
| static void | pool_push (uint8_t *vaddr, uint64_t paddr) |
Variables | |
| static struct e1000_rx_desc * | rx_descs [256] |
| static struct e1000_rx_comp | rx_comp [256] |
| static struct e1000_tx_desc * | tx_descs [64] |
| static volatile int | setup_tx_done = 0 |
| static struct rx_buffer_pool | rx_buffer_pool |
| static rx_buf_lookup_entry | g_buf_lookup [1280] |
| static uint32_t | g_buf_lookup_count = 0 |
| static const char | hexmap [] = "0123456789ABCDEF" |
| #define CMD_EOP (1 << 0) |
Definition at line 78 of file e1000.cpp.
Referenced by E1000Module::sendPacket().
| #define CMD_IFCS (1 << 1) |
Definition at line 79 of file e1000.cpp.
Referenced by E1000Module::sendPacket().
| #define CMD_RS (1 << 3) |
Definition at line 81 of file e1000.cpp.
Referenced by E1000Module::sendPacket().
| #define IMS_OTHER (1 << 24) |
Definition at line 28 of file e1000.cpp.
Referenced by E1000Module::enableInterrupt(), and E1000Module::load().
| #define IMS_RXQ0 (1 << 20) |
Definition at line 26 of file e1000.cpp.
Referenced by E1000Module::enableInterrupt(), and E1000Module::load().
| #define IMS_TXQ0 (1 << 22) |
Definition at line 27 of file e1000.cpp.
Referenced by E1000Module::enableInterrupt(), and E1000Module::load().
| #define RCTL_BAM (1 << 15) |
Definition at line 59 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define RCTL_BSIZE_2048 (0 << 16) |
Definition at line 71 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define RCTL_EN (1 << 1) |
Definition at line 45 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define RCTL_SECRC (1 << 26) |
Definition at line 65 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define REG_CTRL 0x0000 |
Definition at line 9 of file e1000.cpp.
Referenced by E1000Module::linkup().
| #define REG_EEPROM 0x0014 |
Definition at line 11 of file e1000.cpp.
Referenced by E1000Module::detectEeprom(), and E1000Module::readEeprom().
| #define REG_ICR 0x00C0 |
Definition at line 101 of file e1000.cpp.
Referenced by E1000Module::enableInterrupt().
| #define REG_IMASK 0x00D0 |
Definition at line 13 of file e1000.cpp.
Referenced by E1000Module::disableInterrupt(), and E1000Module::enableInterrupt().
| #define REG_RADV 0x282C |
Definition at line 39 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define REG_RCTRL 0x0100 |
Definition at line 14 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define REG_RDTR 0x2820 |
Definition at line 37 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define REG_RXDCTL 0x2828 |
Definition at line 38 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define REG_RXDESCHEAD 0x2810 |
Definition at line 18 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define REG_RXDESCHI 0x2804 |
Definition at line 16 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define REG_RXDESCLEN 0x2808 |
Definition at line 17 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define REG_RXDESCLO 0x2800 |
Definition at line 15 of file e1000.cpp.
Referenced by E1000Module::initReceiverX().
| #define REG_RXDESCTAIL 0x2818 |
Definition at line 19 of file e1000.cpp.
Referenced by E1000Module::initReceiverX(), and E1000Module::receiveHandle().
| #define REG_TCTRL 0x0400 |
Definition at line 30 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
| #define REG_TIPG 0x0410 |
Definition at line 42 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
| #define REG_TXDESCHEAD 0x3810 |
Definition at line 34 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
| #define REG_TXDESCHI 0x3804 |
Definition at line 32 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
| #define REG_TXDESCLEN 0x3808 |
Definition at line 33 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
| #define REG_TXDESCLO 0x3800 |
Definition at line 31 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
| #define REG_TXDESCTAIL 0x3818 |
Definition at line 35 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX(), and E1000Module::sendPacket().
| #define TCTL_COLD_SHIFT 12 |
Definition at line 91 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
| #define TCTL_CT_SHIFT 4 |
Definition at line 90 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
| #define TCTL_EN (1 << 1) |
Definition at line 88 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
| #define TCTL_PSP (1 << 3) |
Definition at line 89 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
| #define TCTL_RTLC (1 << 24) |
Definition at line 93 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
| #define TSTA_DD (1 << 0) |
Definition at line 95 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX().
|
static |
Definition at line 223 of file e1000.cpp.
References BUFFER_POOL_MASK, rx_buffer_pool::buffers, h, rx_buffer_pool::head, and rx_buffer_pool::tail.
Referenced by E1000Module::initReceiverX(), and E1000Module::receiveHandle().
Definition at line 499 of file e1000.cpp.
References BUFFER_POOL_MASK, BUFFER_POOL_SIZE, rx_buffer_pool::buffers, h, rx_buffer_pool::head, rx_buffer::paddr, serial2_printf(), slot, rx_buffer_pool::tail, and rx_buffer::vaddr.
Referenced by E1000Module::storeBufferToPool().
|
static |
Definition at line 116 of file e1000.cpp.
Referenced by E1000Module::initReceiverX(), and E1000Module::storeBufferToPool().
|
static |
Definition at line 117 of file e1000.cpp.
Referenced by E1000Module::initReceiverX(), and E1000Module::storeBufferToPool().
|
static |
Definition at line 160 of file e1000.cpp.
Referenced by E1000Module::syncMacAddress().
|
static |
Definition at line 104 of file e1000.cpp.
Referenced by E1000Module::initReceiverX(), and E1000Module::receiveHandle().
|
static |
Definition at line 103 of file e1000.cpp.
Referenced by E1000Module::initReceiverX(), and E1000Module::receiveHandle().
|
static |
Definition at line 107 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX(), and E1000Module::sendPacket().
|
static |
Definition at line 105 of file e1000.cpp.
Referenced by E1000Module::initTransmitterX(), and E1000Module::sendPacket().