📄 ucc_geth.h
字号:
u8 res2[0x1]; u8 rxgstpack; /* acknowledgement on GRACEFUL STOP RX command*/ u32 rxrmonbaseptr; /* base pointer to Rx RMON statistics counter */ u8 res3[0x30 - 0x28]; u32 intcoalescingptr; /* Interrupt coalescing table pointer */ u8 res4[0x36 - 0x34]; u8 rstate; /* rx internal state. High byte contains function code */ u8 res5[0x46 - 0x37]; u16 mrblr; /* max receive buffer length reg. */ u32 rbdqptr; /* base pointer to RxBD parameter table description */ u16 mflr; /* max frame length reg. */ u16 minflr; /* min frame length reg. */ u16 maxd1; /* max dma1 length reg. */ u16 maxd2; /* max dma2 length reg. */ u32 ecamptr; /* external CAM address */ u32 l2qt; /* VLAN priority mapping table. */ u32 l3qt[0x8]; /* IP priority mapping table. */ u16 vlantype; /* vlan type */ u16 vlantci; /* default vlan tci */ u8 addressfiltering[64]; /* address filtering data structure */ u32 exfGlobalParam; /* base address for extended filtering global parameters */ u8 res6[0x100 - 0xC4]; /* Initialize to zero */} __attribute__ ((packed));#define GRACEFUL_STOP_ACKNOWLEDGE_RX 0x01/* structure representing InitEnet command */struct ucc_geth_init_pram { u8 resinit1; u8 resinit2; u8 resinit3; u8 resinit4; u16 resinit5; u8 res1[0x1]; u8 largestexternallookupkeysize; u32 rgftgfrxglobal; u32 rxthread[ENET_INIT_PARAM_MAX_ENTRIES_RX]; /* rx threads */ u8 res2[0x38 - 0x30]; u32 txglobal; /* tx global */ u32 txthread[ENET_INIT_PARAM_MAX_ENTRIES_TX]; /* tx threads */ u8 res3[0x1];} __attribute__ ((packed));#define ENET_INIT_PARAM_RGF_SHIFT (32 - 4)#define ENET_INIT_PARAM_TGF_SHIFT (32 - 8)#define ENET_INIT_PARAM_RISC_MASK 0x0000003f#define ENET_INIT_PARAM_PTR_MASK 0x00ffffc0#define ENET_INIT_PARAM_SNUM_MASK 0xff000000#define ENET_INIT_PARAM_SNUM_SHIFT 24#define ENET_INIT_PARAM_MAGIC_RES_INIT1 0x06#define ENET_INIT_PARAM_MAGIC_RES_INIT2 0x30#define ENET_INIT_PARAM_MAGIC_RES_INIT3 0xff#define ENET_INIT_PARAM_MAGIC_RES_INIT4 0x00#define ENET_INIT_PARAM_MAGIC_RES_INIT5 0x0400/* structure representing 82xx Address Filtering Enet Address in PRAM */struct ucc_geth_82xx_enet_address { u8 res1[0x2]; u16 h; /* address (MSB) */ u16 m; /* address */ u16 l; /* address (LSB) */} __attribute__ ((packed));/* structure representing 82xx Address Filtering PRAM */struct ucc_geth_82xx_address_filtering_pram { u32 iaddr_h; /* individual address filter, high */ u32 iaddr_l; /* individual address filter, low */ u32 gaddr_h; /* group address filter, high */ u32 gaddr_l; /* group address filter, low */ struct ucc_geth_82xx_enet_address taddr; struct ucc_geth_82xx_enet_address paddr[NUM_OF_PADDRS]; u8 res0[0x40 - 0x38];} __attribute__ ((packed));/* GETH Tx firmware statistics structure, used when calling UCC_GETH_GetStatistics. */struct ucc_geth_tx_firmware_statistics { u32 sicoltx; /* single collision */ u32 mulcoltx; /* multiple collision */ u32 latecoltxfr; /* late collision */ u32 frabortduecol; /* frames aborted due to transmit collision */ u32 frlostinmactxer; /* frames lost due to internal MAC error transmission that are not counted on any other counter */ u32 carriersenseertx; /* carrier sense error */ u32 frtxok; /* frames transmitted OK */ u32 txfrexcessivedefer; /* frames with defferal time greater than specified threshold */ u32 txpkts256; /* total packets (including bad) between 256 and 511 octets */ u32 txpkts512; /* total packets (including bad) between 512 and 1023 octets */ u32 txpkts1024; /* total packets (including bad) between 1024 and 1518 octets */ u32 txpktsjumbo; /* total packets (including bad) between 1024 and MAXLength octets */} __attribute__ ((packed));/* GETH Rx firmware statistics structure, used when calling UCC_GETH_GetStatistics. */struct ucc_geth_rx_firmware_statistics { u32 frrxfcser; /* frames with crc error */ u32 fraligner; /* frames with alignment error */ u32 inrangelenrxer; /* in range length error */ u32 outrangelenrxer; /* out of range length error */ u32 frtoolong; /* frame too long */ u32 runt; /* runt */ u32 verylongevent; /* very long event */ u32 symbolerror; /* symbol error */ u32 dropbsy; /* drop because of BD not ready */ u8 res0[0x8]; u32 mismatchdrop; /* drop because of MAC filtering (e.g. address or type mismatch) */ u32 underpkts; /* total frames less than 64 octets */ u32 pkts256; /* total frames (including bad) between 256 and 511 octets */ u32 pkts512; /* total frames (including bad) between 512 and 1023 octets */ u32 pkts1024; /* total frames (including bad) between 1024 and 1518 octets */ u32 pktsjumbo; /* total frames (including bad) between 1024 and MAXLength octets */ u32 frlossinmacer; /* frames lost because of internal MAC error that is not counted in any other counter */ u32 pausefr; /* pause frames */ u8 res1[0x4]; u32 removevlan; /* total frames that had their VLAN tag removed */ u32 replacevlan; /* total frames that had their VLAN tag replaced */ u32 insertvlan; /* total frames that had their VLAN tag inserted */} __attribute__ ((packed));/* GETH hardware statistics structure, used when calling UCC_GETH_GetStatistics. */struct ucc_geth_hardware_statistics { u32 tx64; /* Total number of frames (including bad frames) transmitted that were exactly of the minimal length (64 for un tagged, 68 for tagged, or with length exactly equal to the parameter MINLength */ u32 tx127; /* Total number of frames (including bad frames) transmitted that were between MINLength (Including FCS length==4) and 127 octets */ u32 tx255; /* Total number of frames (including bad frames) transmitted that were between 128 (Including FCS length==4) and 255 octets */ u32 rx64; /* Total number of frames received including bad frames that were exactly of the mninimal length (64 bytes) */ u32 rx127; /* Total number of frames (including bad frames) received that were between MINLength (Including FCS length==4) and 127 octets */ u32 rx255; /* Total number of frames (including bad frames) received that were between 128 (Including FCS length==4) and 255 octets */ u32 txok; /* Total number of octets residing in frames that where involved in succesfull transmission */ u16 txcf; /* Total number of PAUSE control frames transmitted by this MAC */ u32 tmca; /* Total number of frames that were transmitted succesfully with the group address bit set that are not broadcast frames */ u32 tbca; /* Total number of frames transmitted succesfully that had destination address field equal to the broadcast address */ u32 rxfok; /* Total number of frames received OK */ u32 rxbok; /* Total number of octets received OK */ u32 rbyt; /* Total number of octets received including octets in bad frames. Must be implemented in HW because it includes octets in frames that never even reach the UCC */ u32 rmca; /* Total number of frames that were received succesfully with the group address bit set that are not broadcast frames */ u32 rbca; /* Total number of frames received succesfully that had destination address equal to the broadcast address */} __attribute__ ((packed));/* UCC GETH Tx errors returned via TxConf callback */#define TX_ERRORS_DEF 0x0200#define TX_ERRORS_EXDEF 0x0100#define TX_ERRORS_LC 0x0080#define TX_ERRORS_RL 0x0040#define TX_ERRORS_RC_MASK 0x003C#define TX_ERRORS_RC_SHIFT 2#define TX_ERRORS_UN 0x0002#define TX_ERRORS_CSL 0x0001/* UCC GETH Rx errors returned via RxStore callback */#define RX_ERRORS_CMR 0x0200#define RX_ERRORS_M 0x0100#define RX_ERRORS_BC 0x0080#define RX_ERRORS_MC 0x0040/* Transmit BD. These are in addition to values defined in uccf. */#define T_VID 0x003c0000 /* insert VLAN id index mask. */#define T_DEF (((u32) TX_ERRORS_DEF ) << 16)#define T_EXDEF (((u32) TX_ERRORS_EXDEF ) << 16)#define T_LC (((u32) TX_ERRORS_LC ) << 16)#define T_RL (((u32) TX_ERRORS_RL ) << 16)#define T_RC_MASK (((u32) TX_ERRORS_RC_MASK ) << 16)#define T_UN (((u32) TX_ERRORS_UN ) << 16)#define T_CSL (((u32) TX_ERRORS_CSL ) << 16)#define T_ERRORS_REPORT (T_DEF | T_EXDEF | T_LC | T_RL | T_RC_MASK \ | T_UN | T_CSL) /* transmit errors to report *//* Receive BD. These are in addition to values defined in uccf. */#define R_LG 0x00200000 /* Frame length violation. */#define R_NO 0x00100000 /* Non-octet aligned frame. */#define R_SH 0x00080000 /* Short frame. */#define R_CR 0x00040000 /* CRC error. */#define R_OV 0x00020000 /* Overrun. */#define R_IPCH 0x00010000 /* IP checksum check failed. */#define R_CMR (((u32) RX_ERRORS_CMR ) << 16)#define R_M (((u32) RX_ERRORS_M ) << 16)#define R_BC (((u32) RX_ERRORS_BC ) << 16)#define R_MC (((u32) RX_ERRORS_MC ) << 16)#define R_ERRORS_REPORT (R_CMR | R_M | R_BC | R_MC) /* receive errors to report */#define R_ERRORS_FATAL (R_LG | R_NO | R_SH | R_CR | \ R_OV | R_IPCH) /* receive errors to discard *//* Alignments */#define UCC_GETH_RX_GLOBAL_PRAM_ALIGNMENT 256#define UCC_GETH_TX_GLOBAL_PRAM_ALIGNMENT 128#define UCC_GETH_THREAD_RX_PRAM_ALIGNMENT 128#define UCC_GETH_THREAD_TX_PRAM_ALIGNMENT 64#define UCC_GETH_THREAD_DATA_ALIGNMENT 256 /* spec gives values based on num of threads, but always using the maximum is easier */#define UCC_GETH_SEND_QUEUE_QUEUE_DESCRIPTOR_ALIGNMENT 32#define UCC_GETH_SCHEDULER_ALIGNMENT 4 /* This is a guess */#define UCC_GETH_TX_STATISTICS_ALIGNMENT 4 /* This is a guess */#define UCC_GETH_RX_STATISTICS_ALIGNMENT 4 /* This is a guess */#define UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT 64#define UCC_GETH_RX_BD_QUEUES_ALIGNMENT 8 /* This is a guess */#define UCC_GETH_RX_PREFETCHED_BDS_ALIGNMENT 128 /* This is a guess */#define UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT 4 /* This is a guess */#define UCC_GETH_RX_BD_RING_ALIGNMENT 32#define UCC_GETH_TX_BD_RING_ALIGNMENT 32#define UCC_GETH_MRBLR_ALIGNMENT 128#define UCC_GETH_RX_BD_RING_SIZE_ALIGNMENT 4#define UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT 32#define UCC_GETH_RX_DATA_BUF_ALIGNMENT 64#define UCC_GETH_TAD_EF 0x80#define UCC_GETH_TAD_V 0x40#define UCC_GETH_TAD_REJ 0x20#define UCC_GETH_TAD_VTAG_OP_RIGHT_SHIFT 2#define UCC_GETH_TAD_VTAG_OP_SHIFT 6#define UCC_GETH_TAD_V_NON_VTAG_OP 0x20#define UCC_GETH_TAD_RQOS_SHIFT 0#define UCC_GETH_TAD_V_PRIORITY_SHIFT 5#define UCC_GETH_TAD_CFI 0x10#define UCC_GETH_VLAN_PRIORITY_MAX 8#define UCC_GETH_IP_PRIORITY_MAX 64#define UCC_GETH_TX_VTAG_TABLE_ENTRY_MAX 8#define UCC_GETH_RX_BD_RING_SIZE_MIN 8#define UCC_GETH_TX_BD_RING_SIZE_MIN 2#define UCC_GETH_BD_RING_SIZE_MAX 0xffff#define UCC_GETH_SIZE_OF_BD QE_SIZEOF_BD/* Driver definitions */#define TX_BD_RING_LEN 0x10#define RX_BD_RING_LEN 0x10#define UCC_GETH_DEV_WEIGHT TX_BD_RING_LEN#define TX_RING_MOD_MASK(size) (size-1)#define RX_RING_MOD_MASK(size) (size-1)#define ENET_NUM_OCTETS_PER_ADDRESS 6#define ENET_GROUP_ADDR 0x01 /* Group address mask for ethernet addresses */#define TX_TIMEOUT (1*HZ)#define SKB_ALLOC_TIMEOUT 100000#define PHY_INIT_TIMEOUT 100000#define PHY_CHANGE_TIME 2/* Fast Ethernet (10/100 Mbps) */#define UCC_GETH_URFS_INIT 512 /* Rx virtual FIFO size */#define UCC_GETH_URFET_INIT 256 /* 1/2 urfs */#define UCC_GETH_URFSET_INIT 384 /* 3/4 urfs */#define UCC_GETH_UTFS_INIT 512 /* Tx virtual FIFO size */#define UCC_GETH_UTFET_INIT 256 /* 1/2 utfs */#define UCC_GETH_UTFTT_INIT 128/* Gigabit Ethernet (1000 Mbps) */#define UCC_GETH_URFS_GIGA_INIT 4096/*2048*/ /* Rx virtual FIFO size */#define UCC_GETH_URFET_GIGA_INIT 2048/*1024*/ /* 1/2 urfs */#define UCC_GETH_URFSET_GIGA_INIT 3072/*1536*/ /* 3/4 urfs */#define UCC_GETH_UTFS_GIGA_INIT 8192/*2048*/ /* Tx virtual FIFO size */#define UCC_GETH_UTFET_GIGA_INIT 4096/*1024*/ /* 1/2 utfs */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -