Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs
meth.h File Reference

Go to the source code of this file.

Data Structures

struct  tx_status_vector
 
struct  tx_packet_hdr
 
union  tx_cat_ptr
 
struct  tx_packet
 
union  rx_status_vector
 
struct  rx_packet
 

Macros

#define TX_RING_ENTRIES   64 /* 64-512?*/
 
#define RX_RING_ENTRIES   16 /* Do not change */
 
#define TX_RING_BUFFER_SIZE   (TX_RING_ENTRIES*sizeof(tx_packet))
 
#define RX_BUFFER_SIZE   1546 /* ethenet packet size */
 
#define METH_RX_BUFF_SIZE   4096
 
#define METH_RX_HEAD   34 /* status + 3 quad garbage-fill + 2 byte zero-pad */
 
#define RX_BUFFER_OFFSET   (sizeof(rx_status_vector)+2) /* staus vector + 2 bytes of padding */
 
#define RX_BUCKET_SIZE   256
 
#define TX_INFO_RPTR   0x00FF0000
 
#define TX_INFO_WPTR   0x000000FF
 
#define SGI_MAC_RESET   BIT(0) /* 0: MAC110 active in run mode, 1: Global reset signal to MAC110 core is active */
 
#define METH_PHY_FDX   BIT(1) /* 0: Disable full duplex, 1: Enable full duplex */
 
#define METH_PHY_LOOP   BIT(2) /* 0: Normal operation, follows 10/100mbit and M10T/MII select, 1: loops internal MII bus */
 
#define METH_100MBIT   BIT(3) /* 0: 10meg mode, 1: 100meg mode */
 
#define METH_PHY_MII   BIT(4) /* 0: MII selected, 1: SIA selected */
 
#define METH_ACCEPT_MY   0 /* 00: Accept PHY address only */
 
#define METH_ACCEPT_MCAST   0x20 /* 01: Accept physical, broadcast, and multicast filter matches only */
 
#define METH_ACCEPT_AMCAST   0x40 /* 10: Accept physical, broadcast, and all multicast packets */
 
#define METH_PROMISC   0x60 /* 11: Promiscious mode */
 
#define METH_PHY_LINK_FAIL   BIT(7) /* 0: Link failure detection disabled, 1: Hardware scans for link failure in PHY */
 
#define METH_MAC_IPG   0x1ffff00
 
#define METH_DEFAULT_IPG   ((17<<15) | (11<<22) | (21<<8))
 
#define METH_REV_SHIFT   29 /* Bits 29 through 31 are used to determine the revision */
 
#define METH_RX_OFFSET_SHIFT   12 /* Bits 12:14 of DMA control register indicate starting offset of packet data for RX operation */
 
#define METH_RX_DEPTH_SHIFT   4 /* Bits 8:4 define RX fifo depth -- when # of RX fifo entries != depth, interrupt is generted */
 
#define METH_DMA_TX_EN   BIT(1) /* enable TX DMA */
 
#define METH_DMA_TX_INT_EN   BIT(0) /* enable TX Buffer Empty interrupt */
 
#define METH_DMA_RX_EN   BIT(15) /* Enable RX */
 
#define METH_DMA_RX_INT_EN   BIT(9) /* Enable interrupt on RX packet */
 
#define METH_RX_FIFO_WPTR(x)   (((x)>>16)&0xf)
 
#define METH_RX_FIFO_RPTR(x)   (((x)>>8)&0xf)
 
#define METH_RX_FIFO_DEPTH(x)   ((x)&0x1f)
 
#define METH_RX_ST_VALID   BIT(63)
 
#define METH_RX_ST_RCV_CODE_VIOLATION   BIT(16)
 
#define METH_RX_ST_DRBL_NBL   BIT(17)
 
#define METH_RX_ST_CRC_ERR   BIT(18)
 
#define METH_RX_ST_MCAST_PKT   BIT(19)
 
#define METH_RX_ST_BCAST_PKT   BIT(20)
 
#define METH_RX_ST_INV_PREAMBLE_CTX   BIT(21)
 
#define METH_RX_ST_LONG_EVT_SEEN   BIT(22)
 
#define METH_RX_ST_BAD_PACKET   BIT(23)
 
#define METH_RX_ST_CARRIER_EVT_SEEN   BIT(24)
 
#define METH_RX_ST_MCAST_FILTER_MATCH   BIT(25)
 
#define METH_RX_ST_PHYS_ADDR_MATCH   BIT(26)
 
#define METH_RX_STATUS_ERRORS
 
#define METH_INT_TX_EMPTY   BIT(0) /* 0: No interrupt pending, 1: The TX ring buffer is empty */
 
#define METH_INT_TX_PKT   BIT(1) /* 0: No interrupt pending */
 
#define METH_INT_TX_LINK_FAIL   BIT(2) /* 0: No interrupt pending, 1: PHY has reported a link failure */
 
#define METH_INT_MEM_ERROR   BIT(3) /* 0: No interrupt pending */
 
#define METH_INT_TX_ABORT   BIT(4) /* 0: No interrupt pending, 1: The TX aborted operation, DMA stopped, FATAL */
 
#define METH_INT_RX_THRESHOLD   BIT(5) /* 0: No interrupt pending, 1: Selected receive threshold condition Valid */
 
#define METH_INT_RX_UNDERFLOW   BIT(6) /* 0: No interrupt pending, 1: FIFO was empty, packet could not be queued */
 
#define METH_INT_RX_OVERFLOW   BIT(7) /* 0: No interrupt pending, 1: DMA FIFO Overflow, DMA stopped, FATAL */
 
#define METH_INT_RX_RPTR_MASK   0x0000F00 /* Bits 8 through 11 alias of RX read-pointer - so, is Rx FIFO 16 or 32 entry?*/
 
#define METH_INT_TX_RPTR_MASK   0x1FF0000 /* Bits 16 through 24 alias of TX read-pointer */
 
#define METH_INT_RX_SEQ_MASK   0x2E000000 /* Bits 25 through 29 are the starting seq number for the message at the */
 
#define METH_INT_ERROR
 
#define METH_INT_MCAST_HASH   BIT(30) /* If RX DMA is enabled the hash select logic output is latched here */
 
#define METH_TX_ST_DONE   BIT(63) /* TX complete */
 
#define METH_TX_ST_SUCCESS   BIT(23) /* Packet was transmitted successfully */
 
#define METH_TX_ST_TOOLONG   BIT(24) /* TX abort due to excessive length */
 
#define METH_TX_ST_UNDERRUN   BIT(25) /* TX abort due to underrun (?) */
 
#define METH_TX_ST_EXCCOLL   BIT(26) /* TX abort due to excess collisions */
 
#define METH_TX_ST_DEFER   BIT(27) /* TX abort due to excess deferals */
 
#define METH_TX_ST_LATECOLL   BIT(28) /* TX abort due to late collision */
 
#define METH_TX_CMD_INT_EN   BIT(24) /* Generate TX interrupt when packet is sent */
 
#define MDIO_BUSY   BIT(16)
 
#define MDIO_DATA_MASK   0xFFFF
 
#define PHY_QS6612X   0x0181441 /* Quality TX */
 
#define PHY_ICS1889   0x0015F41 /* ICS FX */
 
#define PHY_ICS1890   0x0015F42 /* ICS TX */
 
#define PHY_DP83840   0x20005C0 /* National TX */
 
#define ADVANCE_RX_PTR(x)   x=(x+1)&(RX_RING_ENTRIES-1)
 

Typedefs

typedef struct tx_status_vector tx_status_vector
 
typedef struct tx_packet_hdr tx_packet_hdr
 
typedef union tx_cat_ptr tx_cat_ptr
 
typedef struct tx_packet tx_packet
 
typedef union rx_status_vector rx_status_vector
 
typedef struct rx_packet rx_packet
 

Macro Definition Documentation

#define ADVANCE_RX_PTR (   x)    x=(x+1)&(RX_RING_ENTRIES-1)

Definition at line 243 of file meth.h.

#define MDIO_BUSY   BIT(16)

Definition at line 235 of file meth.h.

#define MDIO_DATA_MASK   0xFFFF

Definition at line 236 of file meth.h.

#define METH_100MBIT   BIT(3) /* 0: 10meg mode, 1: 100meg mode */

Definition at line 121 of file meth.h.

#define METH_ACCEPT_AMCAST   0x40 /* 10: Accept physical, broadcast, and all multicast packets */

Definition at line 129 of file meth.h.

#define METH_ACCEPT_MCAST   0x20 /* 01: Accept physical, broadcast, and multicast filter matches only */

Definition at line 128 of file meth.h.

#define METH_ACCEPT_MY   0 /* 00: Accept PHY address only */

Definition at line 127 of file meth.h.

#define METH_DEFAULT_IPG   ((17<<15) | (11<<22) | (21<<8))

Definition at line 136 of file meth.h.

#define METH_DMA_RX_EN   BIT(15) /* Enable RX */

Definition at line 157 of file meth.h.

#define METH_DMA_RX_INT_EN   BIT(9) /* Enable interrupt on RX packet */

Definition at line 158 of file meth.h.

#define METH_DMA_TX_EN   BIT(1) /* enable TX DMA */

Definition at line 155 of file meth.h.

#define METH_DMA_TX_INT_EN   BIT(0) /* enable TX Buffer Empty interrupt */

Definition at line 156 of file meth.h.

#define METH_INT_ERROR
Value:
METH_INT_MEM_ERROR| \
METH_INT_TX_ABORT| \
METH_INT_RX_OVERFLOW| \
METH_INT_RX_UNDERFLOW)

Definition at line 213 of file meth.h.

#define METH_INT_MCAST_HASH   BIT(30) /* If RX DMA is enabled the hash select logic output is latched here */

Definition at line 219 of file meth.h.

#define METH_INT_MEM_ERROR   BIT(3) /* 0: No interrupt pending */

Definition at line 195 of file meth.h.

#define METH_INT_RX_OVERFLOW   BIT(7) /* 0: No interrupt pending, 1: DMA FIFO Overflow, DMA stopped, FATAL */

Definition at line 200 of file meth.h.

#define METH_INT_RX_RPTR_MASK   0x0000F00 /* Bits 8 through 11 alias of RX read-pointer - so, is Rx FIFO 16 or 32 entry?*/

Definition at line 203 of file meth.h.

#define METH_INT_RX_SEQ_MASK   0x2E000000 /* Bits 25 through 29 are the starting seq number for the message at the */

Definition at line 209 of file meth.h.

#define METH_INT_RX_THRESHOLD   BIT(5) /* 0: No interrupt pending, 1: Selected receive threshold condition Valid */

Definition at line 198 of file meth.h.

#define METH_INT_RX_UNDERFLOW   BIT(6) /* 0: No interrupt pending, 1: FIFO was empty, packet could not be queued */

Definition at line 199 of file meth.h.

#define METH_INT_TX_ABORT   BIT(4) /* 0: No interrupt pending, 1: The TX aborted operation, DMA stopped, FATAL */

Definition at line 197 of file meth.h.

#define METH_INT_TX_EMPTY   BIT(0) /* 0: No interrupt pending, 1: The TX ring buffer is empty */

Definition at line 191 of file meth.h.

#define METH_INT_TX_LINK_FAIL   BIT(2) /* 0: No interrupt pending, 1: PHY has reported a link failure */

Definition at line 194 of file meth.h.

#define METH_INT_TX_PKT   BIT(1) /* 0: No interrupt pending */

Definition at line 192 of file meth.h.

#define METH_INT_TX_RPTR_MASK   0x1FF0000 /* Bits 16 through 24 alias of TX read-pointer */

Definition at line 207 of file meth.h.

#define METH_MAC_IPG   0x1ffff00

Definition at line 134 of file meth.h.

#define METH_PHY_FDX   BIT(1) /* 0: Disable full duplex, 1: Enable full duplex */

Definition at line 118 of file meth.h.

#define METH_PHY_LINK_FAIL   BIT(7) /* 0: Link failure detection disabled, 1: Hardware scans for link failure in PHY */

Definition at line 132 of file meth.h.

#define METH_PHY_LOOP   BIT(2) /* 0: Normal operation, follows 10/100mbit and M10T/MII select, 1: loops internal MII bus */

Definition at line 119 of file meth.h.

#define METH_PHY_MII   BIT(4) /* 0: MII selected, 1: SIA selected */

Definition at line 122 of file meth.h.

#define METH_PROMISC   0x60 /* 11: Promiscious mode */

Definition at line 130 of file meth.h.

#define METH_REV_SHIFT   29 /* Bits 29 through 31 are used to determine the revision */

Definition at line 146 of file meth.h.

#define METH_RX_BUFF_SIZE   4096

Definition at line 26 of file meth.h.

#define METH_RX_DEPTH_SHIFT   4 /* Bits 8:4 define RX fifo depth -- when # of RX fifo entries != depth, interrupt is generted */

Definition at line 153 of file meth.h.

#define METH_RX_FIFO_DEPTH (   x)    ((x)&0x1f)

Definition at line 163 of file meth.h.

#define METH_RX_FIFO_RPTR (   x)    (((x)>>8)&0xf)

Definition at line 162 of file meth.h.

#define METH_RX_FIFO_WPTR (   x)    (((x)>>16)&0xf)

Definition at line 161 of file meth.h.

#define METH_RX_HEAD   34 /* status + 3 quad garbage-fill + 2 byte zero-pad */

Definition at line 27 of file meth.h.

#define METH_RX_OFFSET_SHIFT   12 /* Bits 12:14 of DMA control register indicate starting offset of packet data for RX operation */

Definition at line 152 of file meth.h.

#define METH_RX_ST_BAD_PACKET   BIT(23)

Definition at line 175 of file meth.h.

#define METH_RX_ST_BCAST_PKT   BIT(20)

Definition at line 172 of file meth.h.

#define METH_RX_ST_CARRIER_EVT_SEEN   BIT(24)

Definition at line 176 of file meth.h.

#define METH_RX_ST_CRC_ERR   BIT(18)

Definition at line 170 of file meth.h.

#define METH_RX_ST_DRBL_NBL   BIT(17)

Definition at line 169 of file meth.h.

#define METH_RX_ST_INV_PREAMBLE_CTX   BIT(21)

Definition at line 173 of file meth.h.

#define METH_RX_ST_LONG_EVT_SEEN   BIT(22)

Definition at line 174 of file meth.h.

#define METH_RX_ST_MCAST_FILTER_MATCH   BIT(25)

Definition at line 177 of file meth.h.

#define METH_RX_ST_MCAST_PKT   BIT(19)

Definition at line 171 of file meth.h.

#define METH_RX_ST_PHYS_ADDR_MATCH   BIT(26)

Definition at line 178 of file meth.h.

#define METH_RX_ST_RCV_CODE_VIOLATION   BIT(16)

Definition at line 168 of file meth.h.

#define METH_RX_ST_VALID   BIT(63)

Definition at line 167 of file meth.h.

#define METH_RX_STATUS_ERRORS
Value:
( \
METH_RX_ST_RCV_CODE_VIOLATION| \
METH_RX_ST_CRC_ERR| \
METH_RX_ST_INV_PREAMBLE_CTX| \
METH_RX_ST_LONG_EVT_SEEN| \
METH_RX_ST_BAD_PACKET| \
METH_RX_ST_CARRIER_EVT_SEEN \
)

Definition at line 180 of file meth.h.

#define METH_TX_CMD_INT_EN   BIT(24) /* Generate TX interrupt when packet is sent */

Definition at line 232 of file meth.h.

#define METH_TX_ST_DEFER   BIT(27) /* TX abort due to excess deferals */

Definition at line 227 of file meth.h.

#define METH_TX_ST_DONE   BIT(63) /* TX complete */

Definition at line 222 of file meth.h.

#define METH_TX_ST_EXCCOLL   BIT(26) /* TX abort due to excess collisions */

Definition at line 226 of file meth.h.

#define METH_TX_ST_LATECOLL   BIT(28) /* TX abort due to late collision */

Definition at line 228 of file meth.h.

#define METH_TX_ST_SUCCESS   BIT(23) /* Packet was transmitted successfully */

Definition at line 223 of file meth.h.

#define METH_TX_ST_TOOLONG   BIT(24) /* TX abort due to excessive length */

Definition at line 224 of file meth.h.

#define METH_TX_ST_UNDERRUN   BIT(25) /* TX abort due to underrun (?) */

Definition at line 225 of file meth.h.

#define PHY_DP83840   0x20005C0 /* National TX */

Definition at line 241 of file meth.h.

#define PHY_ICS1889   0x0015F41 /* ICS FX */

Definition at line 239 of file meth.h.

#define PHY_ICS1890   0x0015F42 /* ICS TX */

Definition at line 240 of file meth.h.

#define PHY_QS6612X   0x0181441 /* Quality TX */

Definition at line 238 of file meth.h.

#define RX_BUCKET_SIZE   256

Definition at line 29 of file meth.h.

#define RX_BUFFER_OFFSET   (sizeof(rx_status_vector)+2) /* staus vector + 2 bytes of padding */

Definition at line 28 of file meth.h.

#define RX_BUFFER_SIZE   1546 /* ethenet packet size */

Definition at line 25 of file meth.h.

#define RX_RING_ENTRIES   16 /* Do not change */

Definition at line 22 of file meth.h.

#define SGI_MAC_RESET   BIT(0) /* 0: MAC110 active in run mode, 1: Global reset signal to MAC110 core is active */

Definition at line 117 of file meth.h.

#define TX_INFO_RPTR   0x00FF0000

Definition at line 112 of file meth.h.

#define TX_INFO_WPTR   0x000000FF

Definition at line 113 of file meth.h.

#define TX_RING_BUFFER_SIZE   (TX_RING_ENTRIES*sizeof(tx_packet))

Definition at line 24 of file meth.h.

#define TX_RING_ENTRIES   64 /* 64-512?*/

Definition at line 20 of file meth.h.

Typedef Documentation

typedef union tx_cat_ptr tx_cat_ptr