⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e1000_hw.h

📁 COPE the first practical network coding scheme which is developped on click
💻 H
📖 第 1 页 / 共 5 页
字号:
#define E1000_RXCSUM_TUOFL     0x00000200   /* TCP / UDP checksum offload */#define E1000_RXCSUM_IPV6OFL   0x00000400   /* IPv6 checksum offload *//* Definitions for power management and wakeup registers *//* Wake Up Control */#define E1000_WUC_APME       0x00000001 /* APM Enable */#define E1000_WUC_PME_EN     0x00000002 /* PME Enable */#define E1000_WUC_PME_STATUS 0x00000004 /* PME Status */#define E1000_WUC_APMPME     0x00000008 /* Assert PME on APM Wakeup *//* Wake Up Filter Control */#define E1000_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */#define E1000_WUFC_MAG  0x00000002 /* Magic Packet Wakeup Enable */#define E1000_WUFC_EX   0x00000004 /* Directed Exact Wakeup Enable */#define E1000_WUFC_MC   0x00000008 /* Directed Multicast Wakeup Enable */#define E1000_WUFC_BC   0x00000010 /* Broadcast Wakeup Enable */#define E1000_WUFC_ARP  0x00000020 /* ARP Request Packet Wakeup Enable */#define E1000_WUFC_IPV4 0x00000040 /* Directed IPv4 Packet Wakeup Enable */#define E1000_WUFC_IPV6 0x00000080 /* Directed IPv6 Packet Wakeup Enable */#define E1000_WUFC_FLX0 0x00010000 /* Flexible Filter 0 Enable */#define E1000_WUFC_FLX1 0x00020000 /* Flexible Filter 1 Enable */#define E1000_WUFC_FLX2 0x00040000 /* Flexible Filter 2 Enable */#define E1000_WUFC_FLX3 0x00080000 /* Flexible Filter 3 Enable */#define E1000_WUFC_ALL_FILTERS 0x000F00FF /* Mask for all wakeup filters */#define E1000_WUFC_FLX_OFFSET 16       /* Offset to the Flexible Filters bits */#define E1000_WUFC_FLX_FILTERS 0x000F0000 /* Mask for the 4 flexible filters *//* Wake Up Status */#define E1000_WUS_LNKC 0x00000001 /* Link Status Changed */#define E1000_WUS_MAG  0x00000002 /* Magic Packet Received */#define E1000_WUS_EX   0x00000004 /* Directed Exact Received */#define E1000_WUS_MC   0x00000008 /* Directed Multicast Received */#define E1000_WUS_BC   0x00000010 /* Broadcast Received */#define E1000_WUS_ARP  0x00000020 /* ARP Request Packet Received */#define E1000_WUS_IPV4 0x00000040 /* Directed IPv4 Packet Wakeup Received */#define E1000_WUS_IPV6 0x00000080 /* Directed IPv6 Packet Wakeup Received */#define E1000_WUS_FLX0 0x00010000 /* Flexible Filter 0 Match */#define E1000_WUS_FLX1 0x00020000 /* Flexible Filter 1 Match */#define E1000_WUS_FLX2 0x00040000 /* Flexible Filter 2 Match */#define E1000_WUS_FLX3 0x00080000 /* Flexible Filter 3 Match */#define E1000_WUS_FLX_FILTERS 0x000F0000 /* Mask for the 4 flexible filters *//* Management Control */#define E1000_MANC_SMBUS_EN      0x00000001 /* SMBus Enabled - RO */#define E1000_MANC_ASF_EN        0x00000002 /* ASF Enabled - RO */#define E1000_MANC_R_ON_FORCE    0x00000004 /* Reset on Force TCO - RO */#define E1000_MANC_RMCP_EN       0x00000100 /* Enable RCMP 026Fh Filtering */#define E1000_MANC_0298_EN       0x00000200 /* Enable RCMP 0298h Filtering */#define E1000_MANC_IPV4_EN       0x00000400 /* Enable IPv4 */#define E1000_MANC_IPV6_EN       0x00000800 /* Enable IPv6 */#define E1000_MANC_SNAP_EN       0x00001000 /* Accept LLC/SNAP */#define E1000_MANC_ARP_EN        0x00002000 /* Enable ARP Request Filtering */#define E1000_MANC_NEIGHBOR_EN   0x00004000 /* Enable Neighbor Discovery                                              * Filtering */#define E1000_MANC_TCO_RESET     0x00010000 /* TCO Reset Occurred */#define E1000_MANC_RCV_TCO_EN    0x00020000 /* Receive TCO Packets Enabled */#define E1000_MANC_REPORT_STATUS 0x00040000 /* Status Reporting Enabled */#define E1000_MANC_SMB_REQ       0x01000000 /* SMBus Request */#define E1000_MANC_SMB_GNT       0x02000000 /* SMBus Grant */#define E1000_MANC_SMB_CLK_IN    0x04000000 /* SMBus Clock In */#define E1000_MANC_SMB_DATA_IN   0x08000000 /* SMBus Data In */#define E1000_MANC_SMB_DATA_OUT  0x10000000 /* SMBus Data Out */#define E1000_MANC_SMB_CLK_OUT   0x20000000 /* SMBus Clock Out */#define E1000_MANC_SMB_DATA_OUT_SHIFT  28 /* SMBus Data Out Shift */#define E1000_MANC_SMB_CLK_OUT_SHIFT   29 /* SMBus Clock Out Shift *//* Wake Up Packet Length */#define E1000_WUPL_LENGTH_MASK 0x0FFF   /* Only the lower 12 bits are valid */#define E1000_MDALIGN          4096/* EEPROM Commands */#define EEPROM_READ_OPCODE  0x6  /* EERPOM read opcode */#define EEPROM_WRITE_OPCODE 0x5  /* EERPOM write opcode */#define EEPROM_ERASE_OPCODE 0x7  /* EERPOM erase opcode */#define EEPROM_EWEN_OPCODE  0x13 /* EERPOM erase/write enable */#define EEPROM_EWDS_OPCODE  0x10 /* EERPOM erast/write disable *//* EEPROM Word Offsets */#define EEPROM_COMPAT              0x0003#define EEPROM_ID_LED_SETTINGS     0x0004#define EEPROM_INIT_CONTROL1_REG   0x000A#define EEPROM_INIT_CONTROL2_REG   0x000F#define EEPROM_FLASH_VERSION       0x0032#define EEPROM_CHECKSUM_REG        0x003F/* Word definitions for ID LED Settings */#define ID_LED_RESERVED_0000 0x0000#define ID_LED_RESERVED_FFFF 0xFFFF#define ID_LED_DEFAULT       ((ID_LED_OFF1_ON2 << 12) | \                              (ID_LED_OFF1_OFF2 << 8) | \                              (ID_LED_DEF1_DEF2 << 4) | \                              (ID_LED_DEF1_DEF2))#define ID_LED_DEF1_DEF2     0x1#define ID_LED_DEF1_ON2      0x2#define ID_LED_DEF1_OFF2     0x3#define ID_LED_ON1_DEF2      0x4#define ID_LED_ON1_ON2       0x5#define ID_LED_ON1_OFF2      0x6#define ID_LED_OFF1_DEF2     0x7#define ID_LED_OFF1_ON2      0x8#define ID_LED_OFF1_OFF2     0x9/* Mask bits for fields in Word 0x03 of the EEPROM */#define EEPROM_COMPAT_SERVER 0x0400#define EEPROM_COMPAT_CLIENT 0x0200/* Mask bits for fields in Word 0x0a of the EEPROM */#define EEPROM_WORD0A_ILOS   0x0010#define EEPROM_WORD0A_SWDPIO 0x01E0#define EEPROM_WORD0A_LRST   0x0200#define EEPROM_WORD0A_FD     0x0400#define EEPROM_WORD0A_66MHZ  0x0800/* Mask bits for fields in Word 0x0f of the EEPROM */#define EEPROM_WORD0F_PAUSE_MASK 0x3000#define EEPROM_WORD0F_PAUSE      0x1000#define EEPROM_WORD0F_ASM_DIR    0x2000#define EEPROM_WORD0F_ANE        0x0800#define EEPROM_WORD0F_SWPDIO_EXT 0x00F0/* For checksumming, the sum of all words in the EEPROM should equal 0xBABA. */#define EEPROM_SUM 0xBABA/* EEPROM Map defines (WORD OFFSETS)*/#define EEPROM_NODE_ADDRESS_BYTE_0 0#define EEPROM_PBA_BYTE_1          8/* EEPROM Map Sizes (Byte Counts) */#define PBA_SIZE 4/* Collision related configuration parameters */#define E1000_COLLISION_THRESHOLD       16#define E1000_CT_SHIFT                  4#define E1000_COLLISION_DISTANCE        64#define E1000_FDX_COLLISION_DISTANCE    E1000_COLLISION_DISTANCE#define E1000_HDX_COLLISION_DISTANCE    E1000_COLLISION_DISTANCE#define E1000_GB_HDX_COLLISION_DISTANCE 512#define E1000_COLD_SHIFT                12/* The number of Transmit and Receive Descriptors must be a multiple of 8 */#define REQ_TX_DESCRIPTOR_MULTIPLE  8#define REQ_RX_DESCRIPTOR_MULTIPLE  8/* Default values for the transmit IPG register */#define DEFAULT_82542_TIPG_IPGT        10#define DEFAULT_82543_TIPG_IPGT_FIBER  9#define DEFAULT_82543_TIPG_IPGT_COPPER 8#define E1000_TIPG_IPGT_MASK  0x000003FF#define E1000_TIPG_IPGR1_MASK 0x000FFC00#define E1000_TIPG_IPGR2_MASK 0x3FF00000#define DEFAULT_82542_TIPG_IPGR1 2#define DEFAULT_82543_TIPG_IPGR1 8#define E1000_TIPG_IPGR1_SHIFT  10#define DEFAULT_82542_TIPG_IPGR2 10#define DEFAULT_82543_TIPG_IPGR2 6#define E1000_TIPG_IPGR2_SHIFT  20#define E1000_TXDMAC_DPP 0x00000001/* Adaptive IFS defines */#define TX_THRESHOLD_START     8#define TX_THRESHOLD_INCREMENT 10#define TX_THRESHOLD_DECREMENT 1#define TX_THRESHOLD_STOP      190#define TX_THRESHOLD_DISABLE   0#define TX_THRESHOLD_TIMER_MS  10000#define MIN_NUM_XMITS          1000#define IFS_MAX                80#define IFS_STEP               10#define IFS_MIN                40#define IFS_RATIO              4/* PBA constants */#define E1000_PBA_16K 0x0010    /* 16KB, default TX allocation */#define E1000_PBA_24K 0x0018#define E1000_PBA_40K 0x0028#define E1000_PBA_48K 0x0030    /* 48KB, default RX allocation *//* Flow Control Constants */#define FLOW_CONTROL_ADDRESS_LOW  0x00C28001#define FLOW_CONTROL_ADDRESS_HIGH 0x00000100#define FLOW_CONTROL_TYPE         0x8808/* The historical defaults for the flow control values are given below. */#define FC_DEFAULT_HI_THRESH        (0x8000)    /* 32KB */#define FC_DEFAULT_LO_THRESH        (0x4000)    /* 16KB */#define FC_DEFAULT_TX_TIMER         (0x100)     /* ~130 us *//* PCIX Config space */#define PCIX_COMMAND_REGISTER    0xE6#define PCIX_STATUS_REGISTER_LO  0xE8#define PCIX_STATUS_REGISTER_HI  0xEA#define PCIX_COMMAND_MMRBC_MASK      0x000C#define PCIX_COMMAND_MMRBC_SHIFT     0x2#define PCIX_STATUS_HI_MMRBC_MASK    0x0060#define PCIX_STATUS_HI_MMRBC_SHIFT   0x5#define PCIX_STATUS_HI_MMRBC_4K      0x3#define PCIX_STATUS_HI_MMRBC_2K      0x2/* The number of bits that we need to shift right to move the "pause" * bits from the EEPROM (bits 13:12) to the "pause" (bits 8:7) field * in the TXCW register  */#define PAUSE_SHIFT 5/* The number of bits that we need to shift left to move the "SWDPIO" * bits from the EEPROM (bits 8:5) to the "SWDPIO" (bits 25:22) field * in the CTRL register  */#define SWDPIO_SHIFT 17/* The number of bits that we need to shift left to move the "SWDPIO_EXT" * bits from the EEPROM word F (bits 7:4) to the bits 11:8 of The * Extended CTRL register. * in the CTRL register  */#define SWDPIO__EXT_SHIFT 4/* The number of bits that we need to shift left to move the "ILOS" * bit from the EEPROM (bit 4) to the "ILOS" (bit 7) field * in the CTRL register  */#define ILOS_SHIFT  3#define RECEIVE_BUFFER_ALIGN_SIZE  (256)/* The number of milliseconds we wait for auto-negotiation to complete */#define LINK_UP_TIMEOUT             500#define E1000_TX_BUFFER_SIZE ((uint32_t)1514)/* The carrier extension symbol, as received by the NIC. */#define CARRIER_EXTENSION   0x0F/* TBI_ACCEPT macro definition: * * This macro requires: *      adapter = a pointer to struct e1000_hw  *      status = the 8 bit status field of the RX descriptor with EOP set *      error = the 8 bit error field of the RX descriptor with EOP set *      length = the sum of all the length fields of the RX descriptors that *               make up the current frame *      last_byte = the last byte of the frame DMAed by the hardware *      max_frame_length = the maximum frame length we want to accept. *      min_frame_length = the minimum frame length we want to accept. * * This macro is a conditional that should be used in the interrupt  * handler's Rx processing routine when RxErrors have been detected. * * Typical use: *  ... *  if (TBI_ACCEPT) { *      accept_frame = TRUE; *      e1000_tbi_adjust_stats(adapter, MacAddress); *      frame_length--; *  } else { *      accept_frame = FALSE; *  } *  ... */#define TBI_ACCEPT(adapter, status, errors, length, last_byte) \    ((adapter)->tbi_compatibility_on && \     (((errors) & E1000_RXD_ERR_FRAME_ERR_MASK) == E1000_RXD_ERR_CE) && \     ((last_byte) == CARRIER_EXTENSION) && \     (((status) & E1000_RXD_STAT_VP) ? \          (((length) > ((adapter)->min_frame_size - VLAN_TAG_SIZE)) && \           ((length) <= ((adapter)->max_frame_size + 1))) : \          (((length) > (adapter)->min_frame_size) && \           ((length) <= ((adapter)->max_frame_size + VLAN_TAG_SIZE + 1)))))/* Structures, enums, and macros for the PHY *//* Bit definitions for the Management Data IO (MDIO) and Management Data * Clock (MDC) pins in the Device Control Register. */#define E1000_CTRL_PHY_RESET_DIR  E1000_CTRL_SWDPIO0#define E1000_CTRL_PHY_RESET      E1000_CTRL_SWDPIN0#define E1000_CTRL_MDIO_DIR       E1000_CTRL_SWDPIO2#define E1000_CTRL_MDIO           E1000_CTRL_SWDPIN2#define E1000_CTRL_MDC_DIR        E1000_CTRL_SWDPIO3#define E1000_CTRL_MDC            E1000_CTRL_SWDPIN3#define E1000_CTRL_PHY_RESET_DIR4 E1000_CTRL_EXT_SDP4_DIR#define E1000_CTRL_PHY_RESET4     E1000_CTRL_EXT_SDP4_DATA/* PHY 1000 MII Register/Bit Definitions *//* PHY Registers defined by IEEE */#define PHY_CTRL         0x00 /* Control Register */#define PHY_STATUS       0x01 /* Status Regiser */#define PHY_ID1          0x02 /* Phy Id Reg (word 1) */#define PHY_ID2          0x03 /* Phy Id Reg (word 2) */#define PHY_AUTONEG_ADV  0x04 /* Autoneg Advertisement */#define PHY_LP_ABILITY   0x05 /* Link Partner Ability (Base Page) */#define PHY_AUTONEG_EXP  0x06 /* Autoneg 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -