📄 e1000_hw.h
字号:
struct e1000_hw_stats { uint64_t crcerrs; uint64_t algnerrc; uint64_t symerrs; uint64_t rxerrc; uint64_t mpc; uint64_t scc; uint64_t ecol; uint64_t mcc; uint64_t latecol; uint64_t colc; uint64_t dc; uint64_t tncrs; uint64_t sec; uint64_t cexterr; uint64_t rlec; uint64_t xonrxc; uint64_t xontxc; uint64_t xoffrxc; uint64_t xofftxc; uint64_t fcruc; uint64_t prc64; uint64_t prc127; uint64_t prc255; uint64_t prc511; uint64_t prc1023; uint64_t prc1522; uint64_t gprc; uint64_t bprc; uint64_t mprc; uint64_t gptc; uint64_t gorcl; uint64_t gorch; uint64_t gotcl; uint64_t gotch; uint64_t rnbc; uint64_t ruc; uint64_t rfc; uint64_t roc; uint64_t rjc; uint64_t mgprc; uint64_t mgpdc; uint64_t mgptc; uint64_t torl; uint64_t torh; uint64_t totl; uint64_t toth; uint64_t tpr; uint64_t tpt; uint64_t ptc64; uint64_t ptc127; uint64_t ptc255; uint64_t ptc511; uint64_t ptc1023; uint64_t ptc1522; uint64_t mptc; uint64_t bptc; uint64_t tsctc; uint64_t tsctfc; uint64_t iac; uint64_t icrxptc; uint64_t icrxatc; uint64_t ictxptc; uint64_t ictxatc; uint64_t ictxqec; uint64_t ictxqmtc; uint64_t icrxdmtc; uint64_t icrxoc; uint64_t cbtmpc; uint64_t htdpmc; uint64_t cbrdpc; uint64_t cbrmpc; uint64_t rpthc; uint64_t hgptc; uint64_t htcbdpc; uint64_t hgorcl; uint64_t hgorch; uint64_t hgotcl; uint64_t hgotch; uint64_t lenerrs; uint64_t scvpc; uint64_t hrmpc;};/* Structure containing variables used by the shared code (e1000_hw.c) */struct e1000_hw { uint8_t *hw_addr; uint8_t *flash_address; e1000_mac_type mac_type; e1000_phy_type phy_type; uint32_t phy_init_script; e1000_media_type media_type; void *back; struct e1000_shadow_ram *eeprom_shadow_ram; uint32_t flash_bank_size; uint32_t flash_base_addr; uint32_t fc; e1000_bus_speed bus_speed; e1000_bus_width bus_width; e1000_bus_type bus_type; struct e1000_eeprom_info eeprom; e1000_ms_type master_slave; e1000_ms_type original_master_slave; e1000_ffe_config ffe_config_state; uint32_t asf_firmware_present; uint32_t eeprom_semaphore_present; uint32_t swfw_sync_present; uint32_t swfwhw_semaphore_present; unsigned long io_base; uint32_t phy_id; uint32_t phy_revision; uint32_t phy_addr; uint32_t original_fc; uint32_t txcw; uint32_t autoneg_failed; uint32_t max_frame_size; uint32_t min_frame_size; uint32_t mc_filter_type; uint32_t num_mc_addrs; uint32_t collision_delta; uint32_t tx_packet_delta; uint32_t ledctl_default; uint32_t ledctl_mode1; uint32_t ledctl_mode2; boolean_t tx_pkt_filtering; struct e1000_host_mng_dhcp_cookie mng_cookie; uint16_t phy_spd_default; uint16_t autoneg_advertised; uint16_t pci_cmd_word; uint16_t fc_high_water; uint16_t fc_low_water; uint16_t fc_pause_time; uint16_t current_ifs_val; uint16_t ifs_min_val; uint16_t ifs_max_val; uint16_t ifs_step_size; uint16_t ifs_ratio; uint16_t device_id; uint16_t vendor_id; uint16_t subsystem_id; uint16_t subsystem_vendor_id; uint8_t revision_id; uint8_t autoneg; uint8_t mdix; uint8_t forced_speed_duplex; uint8_t wait_autoneg_complete; uint8_t dma_fairness; uint8_t mac_addr[NODE_ADDRESS_SIZE]; uint8_t perm_mac_addr[NODE_ADDRESS_SIZE]; boolean_t disable_polarity_correction; boolean_t speed_downgraded; e1000_smart_speed smart_speed; e1000_dsp_config dsp_config_state; boolean_t get_link_status; boolean_t serdes_link_down; boolean_t tbi_compatibility_en; boolean_t tbi_compatibility_on; boolean_t laa_is_present; boolean_t phy_reset_disable; boolean_t initialize_hw_bits_disable; boolean_t fc_send_xon; boolean_t fc_strict_ieee; boolean_t report_tx_early; boolean_t adaptive_ifs; boolean_t ifs_params_forced; boolean_t in_ifs_mode; boolean_t mng_reg_access_disabled; boolean_t leave_av_bit_off; boolean_t kmrn_lock_loss_workaround_disabled;};#define E1000_EEPROM_SWDPIN0 0x0001 /* SWDPIN 0 EEPROM Value */#define E1000_EEPROM_LED_LOGIC 0x0020 /* Led Logic Word */#define E1000_EEPROM_RW_REG_DATA 16 /* Offset to data in EEPROM read/write registers */#define E1000_EEPROM_RW_REG_DONE 2 /* Offset to READ/WRITE done bit */#define E1000_EEPROM_RW_REG_START 1 /* First bit for telling part to start operation */#define E1000_EEPROM_RW_ADDR_SHIFT 2 /* Shift to the address bits */#define E1000_EEPROM_POLL_WRITE 1 /* Flag for polling for write complete */#define E1000_EEPROM_POLL_READ 0 /* Flag for polling for read complete *//* Register Bit Masks *//* Device Control */#define E1000_CTRL_FD 0x00000001 /* Full duplex.0=half; 1=full */#define E1000_CTRL_BEM 0x00000002 /* Endian Mode.0=little,1=big */#define E1000_CTRL_PRIOR 0x00000004 /* Priority on PCI. 0=rx,1=fair */#define E1000_CTRL_GIO_MASTER_DISABLE 0x00000004 /*Blocks new Master requests */#define E1000_CTRL_LRST 0x00000008 /* Link reset. 0=normal,1=reset */#define E1000_CTRL_TME 0x00000010 /* Test mode. 0=normal,1=test */#define E1000_CTRL_SLE 0x00000020 /* Serial Link on 0=dis,1=en */#define E1000_CTRL_ASDE 0x00000020 /* Auto-speed detect enable */#define E1000_CTRL_SLU 0x00000040 /* Set link up (Force Link) */#define E1000_CTRL_ILOS 0x00000080 /* Invert Loss-Of Signal */#define E1000_CTRL_SPD_SEL 0x00000300 /* Speed Select Mask */#define E1000_CTRL_SPD_10 0x00000000 /* Force 10Mb */#define E1000_CTRL_SPD_100 0x00000100 /* Force 100Mb */#define E1000_CTRL_SPD_1000 0x00000200 /* Force 1Gb */#define E1000_CTRL_BEM32 0x00000400 /* Big Endian 32 mode */#define E1000_CTRL_FRCSPD 0x00000800 /* Force Speed */#define E1000_CTRL_FRCDPX 0x00001000 /* Force Duplex */#define E1000_CTRL_D_UD_EN 0x00002000 /* Dock/Undock enable */#define E1000_CTRL_D_UD_POLARITY 0x00004000 /* Defined polarity of Dock/Undock indication in SDP[0] */#define E1000_CTRL_FORCE_PHY_RESET 0x00008000 /* Reset both PHY ports, through PHYRST_N pin */#define E1000_CTRL_EXT_LINK_EN 0x00010000 /* enable link status from external LINK_0 and LINK_1 pins */#define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */#define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */#define E1000_CTRL_SWDPIN2 0x00100000 /* SWDPIN 2 value */#define E1000_CTRL_SWDPIN3 0x00200000 /* SWDPIN 3 value */#define E1000_CTRL_SWDPIO0 0x00400000 /* SWDPIN 0 Input or output */#define E1000_CTRL_SWDPIO1 0x00800000 /* SWDPIN 1 input or output */#define E1000_CTRL_SWDPIO2 0x01000000 /* SWDPIN 2 input or output */#define E1000_CTRL_SWDPIO3 0x02000000 /* SWDPIN 3 input or output */#define E1000_CTRL_RST 0x04000000 /* Global reset */#define E1000_CTRL_RFCE 0x08000000 /* Receive Flow Control enable */#define E1000_CTRL_TFCE 0x10000000 /* Transmit flow control enable */#define E1000_CTRL_RTE 0x20000000 /* Routing tag enable */#define E1000_CTRL_VME 0x40000000 /* IEEE VLAN mode enable */#define E1000_CTRL_PHY_RST 0x80000000 /* PHY Reset */#define E1000_CTRL_SW2FW_INT 0x02000000 /* Initiate an interrupt to manageability engine *//* Device Status */#define E1000_STATUS_FD 0x00000001 /* Full duplex.0=half,1=full */#define E1000_STATUS_LU 0x00000002 /* Link up.0=no,1=link */#define E1000_STATUS_FUNC_MASK 0x0000000C /* PCI Function Mask */#define E1000_STATUS_FUNC_SHIFT 2#define E1000_STATUS_FUNC_0 0x00000000 /* Function 0 */#define E1000_STATUS_FUNC_1 0x00000004 /* Function 1 */#define E1000_STATUS_TXOFF 0x00000010 /* transmission paused */#define E1000_STATUS_TBIMODE 0x00000020 /* TBI mode */#define E1000_STATUS_SPEED_MASK 0x000000C0#define E1000_STATUS_SPEED_10 0x00000000 /* Speed 10Mb/s */#define E1000_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */#define E1000_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */#define E1000_STATUS_LAN_INIT_DONE 0x00000200 /* Lan Init Completion by EEPROM/Flash */#define E1000_STATUS_ASDV 0x00000300 /* Auto speed detect value */#define E1000_STATUS_DOCK_CI 0x00000800 /* Change in Dock/Undock state. Clear on write '0'. */#define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000 /* Status of Master requests. */#define E1000_STATUS_MTXCKOK 0x00000400 /* MTX clock running OK */#define E1000_STATUS_PCI66 0x00000800 /* In 66Mhz slot */#define E1000_STATUS_BUS64 0x00001000 /* In 64 bit slot */#define E1000_STATUS_PCIX_MODE 0x00002000 /* PCI-X mode */#define E1000_STATUS_PCIX_SPEED 0x0000C000 /* PCI-X bus speed */#define E1000_STATUS_BMC_SKU_0 0x00100000 /* BMC USB redirect disabled */#define E1000_STATUS_BMC_SKU_1 0x00200000 /* BMC SRAM disabled */#define E1000_STATUS_BMC_SKU_2 0x00400000 /* BMC SDRAM disabled */#define E1000_STATUS_BMC_CRYPTO 0x00800000 /* BMC crypto disabled */#define E1000_STATUS_BMC_LITE 0x01000000 /* BMC external code execution disabled */#define E1000_STATUS_RGMII_ENABLE 0x02000000 /* RGMII disabled */#define E1000_STATUS_FUSE_8 0x04000000#define E1000_STATUS_FUSE_9 0x08000000#define E1000_STATUS_SERDES0_DIS 0x10000000 /* SERDES disabled on port 0 */#define E1000_STATUS_SERDES1_DIS 0x20000000 /* SERDES disabled on port 1 *//* Constants used to intrepret the masked PCI-X bus speed. */#define E1000_STATUS_PCIX_SPEED_66 0x00000000 /* PCI-X bus speed 50-66 MHz */#define E1000_STATUS_PCIX_SPEED_100 0x00004000 /* PCI-X bus speed 66-100 MHz */#define E1000_STATUS_PCIX_SPEED_133 0x00008000 /* PCI-X bus speed 100-133 MHz *//* EEPROM/Flash Control */#define E1000_EECD_SK 0x00000001 /* EEPROM Clock */#define E1000_EECD_CS 0x00000002 /* EEPROM Chip Select */#define E1000_EECD_DI 0x00000004 /* EEPROM Data In */#define E1000_EECD_DO 0x00000008 /* EEPROM Data Out */#define E1000_EECD_FWE_MASK 0x00000030#define E1000_EECD_FWE_DIS 0x00000010 /* Disable FLASH writes */#define E1000_EECD_FWE_EN 0x00000020 /* Enable FLASH writes */#define E1000_EECD_FWE_SHIFT 4#define E1000_EECD_REQ 0x00000040 /* EEPROM Access Request */#define E1000_EECD_GNT 0x00000080 /* EEPROM Access Grant */#define E1000_EECD_PRES 0x00000100 /* EEPROM Present */#define E1000_EECD_SIZE 0x00000200 /* EEPROM Size (0=64 word 1=256 word) */#define E1000_EECD_ADDR_BITS 0x00000400 /* EEPROM Addressing bits based on type * (0-small, 1-large) */#define E1000_EECD_TYPE 0x00002000 /* EEPROM Type (1-SPI, 0-Microwire) */#ifndef E1000_EEPROM_GRANT_ATTEMPTS#define E1000_EEPROM_GRANT_ATTEMPTS 1000 /* EEPROM # attempts to gain grant */#endif#define E1000_EECD_AUTO_RD 0x00000200 /* EEPROM Auto Read done */#define E1000_EECD_SIZE_EX_MASK 0x00007800 /* EEprom Size */#define E1000_EECD_SIZE_EX_SHIFT 11#define E1000_EECD_NVADDS 0x00018000 /* NVM Address Size */#define E1000_EECD_SELSHAD 0x00020000 /* Select Shadow RAM */#define E1000_EECD_INITSRAM 0x00040000 /* Initialize Shadow RAM */#define E1000_EECD_FLUPD 0x00080000 /* Update FLASH */#define E1000_EECD_AUPDEN 0x00100000 /* Enable Autonomous FLASH update */#define E1000_EECD_SHADV 0x00200000 /* Shadow RAM Data Valid */#define E1000_EECD_SEC1VAL 0x00400000 /* Sector One Valid */#define E1000_EECD_SECVAL_SHIFT 22#define E1000_STM_OPCODE 0xDB00#define E1000_HICR_FW_RESET 0xC0#define E1000_SHADOW_RAM_WORDS 2048#define E1000_ICH8_NVM_SIG_WORD 0x13#define E1000_ICH8_NVM_SIG_MASK 0xC0/* EEPROM Read */#define E1000_EERD_START 0x00000001 /* Start Read */#define E1000_EERD_DONE 0x00000010 /* Read Done */#define E1000_EERD_ADDR_SHIFT 8#define E1000_EERD_ADDR_MASK 0x0000FF00 /* Read Address */#define E1000_EERD_DATA_SHIFT 16#define E1000_EERD_DATA_MASK 0xFFFF0000 /* Read Data *//* SPI EEPROM Status Register */#define EEPROM_STATUS_RDY_SPI 0x01#define EEPROM_STATUS_WEN_SPI 0x02#define EEPROM_STATUS_BP0_SPI 0x04#define EEPROM_STATUS_BP1_SPI 0x08#define EEPROM_STATUS_WPEN_SPI 0x80/* Extended Device Control */#define E1000_CTRL_EXT_GPI0_EN 0x00000001 /* Maps SDP4 to GPI0 */#define E1000_CTRL_EXT_GPI1_EN 0x00000002 /* Maps SDP5 to GPI1 */#define E1000_CTRL_EXT_PHYINT_EN E1000_CTRL_EXT_GPI1_EN#define E1000_CTRL_EXT_GPI2_EN 0x00000004 /* Maps SDP6 to GPI2 */#define E1000_CTRL_EXT_GPI3_EN 0x00000008 /* Maps SDP7 to GPI3 */#define E1000_CTRL_EXT_SDP4_DATA 0x00000010 /* Value of SW Defineable Pin 4 */#define E1000_CTRL_EXT_SDP5_DATA 0x00000020 /* Value of SW Defineable Pin 5 */#define E1000_CTRL_EXT_PHY_INT E1000_CTRL_EXT_SDP5_DATA#define E1000_CTRL_EXT_SDP6_DATA 0x00000040 /* Value of SW Defineable Pin 6 */#define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Defineable Pin 7 */#define E1000_CTRL_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -