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

📄 e1000_defines.h

📁 linux下的网卡驱动
💻 H
📖 第 1 页 / 共 5 页
字号:
#define E1000_ERR_HOST_INTERFACE_COMMAND 11#define E1000_BLK_PHY_RESET   12#define E1000_ERR_SWFW_SYNC 13#define E1000_NOT_IMPLEMENTED 14/* Loop limit on how long we wait for auto-negotiation to complete */#define FIBER_LINK_UP_LIMIT               50#define COPPER_LINK_UP_LIMIT              10#define PHY_AUTO_NEG_LIMIT                45#define PHY_FORCE_LIMIT                   20/* Number of 100 microseconds we wait for PCI Express master disable */#define MASTER_DISABLE_TIMEOUT      800/* Number of milliseconds we wait for PHY configuration done after MAC reset */#define PHY_CFG_TIMEOUT             100/* Number of 2 milliseconds we wait for acquiring MDIO ownership. */#define MDIO_OWNERSHIP_TIMEOUT      10/* Number of milliseconds for NVM auto read done after MAC reset. */#define AUTO_READ_DONE_TIMEOUT      10/* Flow Control */#define E1000_FCRTH_RTH  0x0000FFF8     /* Mask Bits[15:3] for RTH */#define E1000_FCRTH_XFCE 0x80000000     /* External Flow Control Enable */#define E1000_FCRTL_RTL  0x0000FFF8     /* Mask Bits[15:3] for RTL */#define E1000_FCRTL_XONE 0x80000000     /* Enable XON frame transmission *//* Transmit Configuration Word */#define E1000_TXCW_FD         0x00000020        /* TXCW full duplex */#define E1000_TXCW_HD         0x00000040        /* TXCW half duplex */#define E1000_TXCW_PAUSE      0x00000080        /* TXCW sym pause request */#define E1000_TXCW_ASM_DIR    0x00000100        /* TXCW astm pause direction */#define E1000_TXCW_PAUSE_MASK 0x00000180        /* TXCW pause request mask */#define E1000_TXCW_RF         0x00003000        /* TXCW remote fault */#define E1000_TXCW_NP         0x00008000        /* TXCW next page */#define E1000_TXCW_CW         0x0000ffff        /* TxConfigWord mask */#define E1000_TXCW_TXC        0x40000000        /* Transmit Config control */#define E1000_TXCW_ANE        0x80000000        /* Auto-neg enable *//* Receive Configuration Word */#define E1000_RXCW_CW         0x0000ffff        /* RxConfigWord mask */#define E1000_RXCW_NC         0x04000000        /* Receive config no carrier */#define E1000_RXCW_IV         0x08000000        /* Receive config invalid */#define E1000_RXCW_CC         0x10000000        /* Receive config change */#define E1000_RXCW_C          0x20000000        /* Receive config */#define E1000_RXCW_SYNCH      0x40000000        /* Receive config synch */#define E1000_RXCW_ANC        0x80000000        /* Auto-neg complete *//* PCI Express Control */#define E1000_GCR_RXD_NO_SNOOP          0x00000001#define E1000_GCR_RXDSCW_NO_SNOOP       0x00000002#define E1000_GCR_RXDSCR_NO_SNOOP       0x00000004#define E1000_GCR_TXD_NO_SNOOP          0x00000008#define E1000_GCR_TXDSCW_NO_SNOOP       0x00000010#define E1000_GCR_TXDSCR_NO_SNOOP       0x00000020#define PCIE_NO_SNOOP_ALL (E1000_GCR_RXD_NO_SNOOP         | \                           E1000_GCR_RXDSCW_NO_SNOOP      | \                           E1000_GCR_RXDSCR_NO_SNOOP      | \                           E1000_GCR_TXD_NO_SNOOP         | \                           E1000_GCR_TXDSCW_NO_SNOOP      | \                           E1000_GCR_TXDSCR_NO_SNOOP)/* PHY Control Register */#define MII_CR_SPEED_SELECT_MSB 0x0040  /* bits 6,13: 10=1000, 01=100, 00=10 */#define MII_CR_COLL_TEST_ENABLE 0x0080  /* Collision test enable */#define MII_CR_FULL_DUPLEX      0x0100  /* FDX =1, half duplex =0 */#define MII_CR_RESTART_AUTO_NEG 0x0200  /* Restart auto negotiation */#define MII_CR_ISOLATE          0x0400  /* Isolate PHY from MII */#define MII_CR_POWER_DOWN       0x0800  /* Power down */#define MII_CR_AUTO_NEG_EN      0x1000  /* Auto Neg Enable */#define MII_CR_SPEED_SELECT_LSB 0x2000  /* bits 6,13: 10=1000, 01=100, 00=10 */#define MII_CR_LOOPBACK         0x4000  /* 0 = normal, 1 = loopback */#define MII_CR_RESET            0x8000  /* 0 = normal, 1 = PHY reset */#define MII_CR_SPEED_1000       0x0040#define MII_CR_SPEED_100        0x2000#define MII_CR_SPEED_10         0x0000/* PHY Status Register */#define MII_SR_EXTENDED_CAPS     0x0001 /* Extended register capabilities */#define MII_SR_JABBER_DETECT     0x0002 /* Jabber Detected */#define MII_SR_LINK_STATUS       0x0004 /* Link Status 1 = link */#define MII_SR_AUTONEG_CAPS      0x0008 /* Auto Neg Capable */#define MII_SR_REMOTE_FAULT      0x0010 /* Remote Fault Detect */#define MII_SR_AUTONEG_COMPLETE  0x0020 /* Auto Neg Complete */#define MII_SR_PREAMBLE_SUPPRESS 0x0040 /* Preamble may be suppressed */#define MII_SR_EXTENDED_STATUS   0x0100 /* Ext. status info in Reg 0x0F */#define MII_SR_100T2_HD_CAPS     0x0200 /* 100T2 Half Duplex Capable */#define MII_SR_100T2_FD_CAPS     0x0400 /* 100T2 Full Duplex Capable */#define MII_SR_10T_HD_CAPS       0x0800 /* 10T   Half Duplex Capable */#define MII_SR_10T_FD_CAPS       0x1000 /* 10T   Full Duplex Capable */#define MII_SR_100X_HD_CAPS      0x2000 /* 100X  Half Duplex Capable */#define MII_SR_100X_FD_CAPS      0x4000 /* 100X  Full Duplex Capable */#define MII_SR_100T4_CAPS        0x8000 /* 100T4 Capable *//* Autoneg Advertisement Register */#define NWAY_AR_SELECTOR_FIELD   0x0001   /* indicates IEEE 802.3 CSMA/CD */#define NWAY_AR_10T_HD_CAPS      0x0020   /* 10T   Half Duplex Capable */#define NWAY_AR_10T_FD_CAPS      0x0040   /* 10T   Full Duplex Capable */#define NWAY_AR_100TX_HD_CAPS    0x0080   /* 100TX Half Duplex Capable */#define NWAY_AR_100TX_FD_CAPS    0x0100   /* 100TX Full Duplex Capable */#define NWAY_AR_100T4_CAPS       0x0200   /* 100T4 Capable */#define NWAY_AR_PAUSE            0x0400   /* Pause operation desired */#define NWAY_AR_ASM_DIR          0x0800   /* Asymmetric Pause Direction bit */#define NWAY_AR_REMOTE_FAULT     0x2000   /* Remote Fault detected */#define NWAY_AR_NEXT_PAGE        0x8000   /* Next Page ability supported *//* Link Partner Ability Register (Base Page) */#define NWAY_LPAR_SELECTOR_FIELD 0x0000 /* LP protocol selector field */#define NWAY_LPAR_10T_HD_CAPS    0x0020 /* LP is 10T   Half Duplex Capable */#define NWAY_LPAR_10T_FD_CAPS    0x0040 /* LP is 10T   Full Duplex Capable */#define NWAY_LPAR_100TX_HD_CAPS  0x0080 /* LP is 100TX Half Duplex Capable */#define NWAY_LPAR_100TX_FD_CAPS  0x0100 /* LP is 100TX Full Duplex Capable */#define NWAY_LPAR_100T4_CAPS     0x0200 /* LP is 100T4 Capable */#define NWAY_LPAR_PAUSE          0x0400 /* LP Pause operation desired */#define NWAY_LPAR_ASM_DIR        0x0800 /* LP Asymmetric Pause Direction bit */#define NWAY_LPAR_REMOTE_FAULT   0x2000 /* LP has detected Remote Fault */#define NWAY_LPAR_ACKNOWLEDGE    0x4000 /* LP has rx'd link code word */#define NWAY_LPAR_NEXT_PAGE      0x8000 /* Next Page ability supported *//* Autoneg Expansion Register */#define NWAY_ER_LP_NWAY_CAPS      0x0001 /* LP has Auto Neg Capability */#define NWAY_ER_PAGE_RXD          0x0002 /* LP is 10T   Half Duplex Capable */#define NWAY_ER_NEXT_PAGE_CAPS    0x0004 /* LP is 10T   Full Duplex Capable */#define NWAY_ER_LP_NEXT_PAGE_CAPS 0x0008 /* LP is 100TX Half Duplex Capable */#define NWAY_ER_PAR_DETECT_FAULT  0x0010 /* LP is 100TX Full Duplex Capable *//* 1000BASE-T Control Register */#define CR_1000T_ASYM_PAUSE      0x0080 /* Advertise asymmetric pause bit */#define CR_1000T_HD_CAPS         0x0100 /* Advertise 1000T HD capability */#define CR_1000T_FD_CAPS         0x0200 /* Advertise 1000T FD capability  */#define CR_1000T_REPEATER_DTE    0x0400 /* 1=Repeater/switch device port */                                        /* 0=DTE device */#define CR_1000T_MS_VALUE        0x0800 /* 1=Configure PHY as Master */                                        /* 0=Configure PHY as Slave */#define CR_1000T_MS_ENABLE       0x1000 /* 1=Master/Slave manual config value */                                        /* 0=Automatic Master/Slave config */#define CR_1000T_TEST_MODE_NORMAL 0x0000 /* Normal Operation */#define CR_1000T_TEST_MODE_1     0x2000 /* Transmit Waveform test */#define CR_1000T_TEST_MODE_2     0x4000 /* Master Transmit Jitter test */#define CR_1000T_TEST_MODE_3     0x6000 /* Slave Transmit Jitter test */#define CR_1000T_TEST_MODE_4     0x8000 /* Transmitter Distortion test *//* 1000BASE-T Status Register */#define SR_1000T_IDLE_ERROR_CNT   0x00FF /* Num idle errors since last read */#define SR_1000T_ASYM_PAUSE_DIR   0x0100 /* LP asymmetric pause direction bit */#define SR_1000T_LP_HD_CAPS       0x0400 /* LP is 1000T HD capable */#define SR_1000T_LP_FD_CAPS       0x0800 /* LP is 1000T FD capable */#define SR_1000T_REMOTE_RX_STATUS 0x1000 /* Remote receiver OK */#define SR_1000T_LOCAL_RX_STATUS  0x2000 /* Local receiver OK */#define SR_1000T_MS_CONFIG_RES    0x4000 /* 1=Local TX is Master, 0=Slave */#define SR_1000T_MS_CONFIG_FAULT  0x8000 /* Master/Slave config fault */#define SR_1000T_PHY_EXCESSIVE_IDLE_ERR_COUNT 5/* PHY 1000 MII Register/Bit Definitions *//* PHY Registers defined by IEEE */#define PHY_CONTROL      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 Expansion Reg */#define PHY_NEXT_PAGE_TX 0x07 /* Next Page TX */#define PHY_LP_NEXT_PAGE 0x08 /* Link Partner Next Page */#define PHY_1000T_CTRL   0x09 /* 1000Base-T Control Reg */#define PHY_1000T_STATUS 0x0A /* 1000Base-T Status Reg */#define PHY_EXT_STATUS   0x0F /* Extended Status Reg *//* NVM Control */#define E1000_EECD_SK        0x00000001 /* NVM Clock */#define E1000_EECD_CS        0x00000002 /* NVM Chip Select */#define E1000_EECD_DI        0x00000004 /* NVM Data In */#define E1000_EECD_DO        0x00000008 /* NVM 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 /* NVM Access Request */#define E1000_EECD_GNT       0x00000080 /* NVM Access Grant */#define E1000_EECD_PRES      0x00000100 /* NVM Present */#define E1000_EECD_SIZE      0x00000200 /* NVM Size (0=64 word 1=256 word) */#define E1000_EECD_ADDR_BITS 0x00000400 /* NVM Addressing bits based on type                                         * (0-small, 1-large) */#define E1000_EECD_TYPE      0x00002000 /* NVM Type (1-SPI, 0-Microwire) */#define E1000_NVM_GRANT_ATTEMPTS   1000 /* NVM # attempts to gain grant */#define E1000_EECD_AUTO_RD          0x00000200  /* NVM Auto Read done */#define E1000_EECD_SIZE_EX_MASK     0x00007800  /* NVM 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_NVM_SWDPIN0   0x0001   /* SWDPIN 0 NVM Value */#define E1000_NVM_LED_LOGIC 0x0020   /* Led Logic Word */#define E1000_NVM_RW_REG_DATA   16   /* Offset to data in NVM read/write registers */#define E1000_NVM_RW_REG_DONE   2    /* Offset to READ/WRITE done bit */#define E1000_NVM_RW_REG_START  1    /* Start operation */#define E1000_NVM_RW_ADDR_SHIFT 2    /* Shift to the address bits */#define E1000_NVM_POLL_WRITE    1    /* Flag for polling for write complete */#define E1000_NVM_POLL_READ     0    /* Flag for polling for read complete */#define E1000_FLASH_UPDATES  2000/* NVM Word Offsets */#define NVM_COMPAT                 0x0003#define NVM_ID_LED_SETTINGS        0x0004#define NVM_VERSION                0x0005#define NVM_SERDES_AMPLITUDE       0x0006 /* For SERDES output amplitude adjustment. */#define NVM_PHY_CLASS_WORD         0x0007#define NVM_INIT_CONTROL1_REG      0x000A#define NVM_INIT_CONTROL2_REG      0x000F#define NVM_SWDEF_PINS_CTRL_PORT_1 0x0010#define NVM_INIT_CONTROL3_PORT_B   0x0014#define NVM_INIT_3GIO_3            0x001A#define NVM_SWDEF_PINS_CTRL_PORT_0 0x0020#define NVM_INIT_CONTROL3_PORT_A   0x0024#define NVM_CFG                    0x0012#define NVM_FLASH_VERSION          0x0032#define NVM_CHECKSUM_REG           0x003F#define E1000_NVM_CFG_DONE_PORT_0  0x40000 /* MNG config cycle done */#define E1000_NVM_CFG_DONE_PORT_1  0x80000 /* ...for second port *//* Mask bits for fields in Word 0x0f of the NVM */#define NVM_WORD0F_PAUSE_MASK       0x3000#define NVM_WORD0F_PAUSE            0x1000#define NVM_WORD0F_ASM_DIR          0x2000#define NVM_WORD0F_ANE              0x0800#define NVM_WORD0F_SWPDIO_EXT_MASK  0x00F0#define NVM_WORD0F_LPLU             0x0001/* Mask bits for fields in Word 0x1a of the NVM */#define NVM_WORD1A_ASPM_MASK  0x000C/* For checksumming, the sum of all words in the NVM should equal 0xBABA. */#define NVM_SUM                    0xBABA#define NVM_MAC_ADDR_OFFSET        0#define NVM_PBA_OFFSET_0           8#define NVM_PBA_OFFSET_1           9#define NVM_RESERVED_WORD          0xFFFF#define NVM_PHY_CLASS_A            0x8000#define NVM_SERDES_AMPLITUDE_MASK  0x000F#define NVM_SIZE_MASK              0x1C00#define NVM_SIZE_SHIFT             10#define NVM_WORD_SIZE_BASE_SHIFT   6#define NVM_SWDPIO_EXT_SHIFT       4

⌨️ 快捷键说明

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