if_seeq.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:6k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* if_seeq.h - Seeq 8005 Ethernet interface header */
  2. /* Copyright 1984-1996 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01a,21apr96,mem  written.
  7. */
  8. #ifndef __INCif_seeqh
  9. #define __INCif_seeqh
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /*
  14.  * Control block definitions for SEEQ 8005 (Ethernet) chip.
  15.  */
  16. #ifndef _ASMLANGUAGE
  17. /*
  18.  * Register layout.
  19.  */
  20. typedef struct /* SEEQ_DEVICE */
  21.     {
  22.     volatile USHORT * pCmd; /* command register */
  23.     volatile USHORT * pStat; /* status register */
  24.     volatile USHORT * pCfg1; /* config register #1 */
  25.     volatile USHORT * pCfg2; /* config register #2 */
  26.     volatile USHORT * pRxend; /* receive area end register */
  27.     volatile USHORT * pBwind; /* buffer window register */
  28.     volatile USHORT * pRxptr; /* receive pointer register */
  29.     volatile USHORT * pTxptr; /* receive pointer register */
  30.     volatile USHORT * pDma; /* DMA address register */
  31.     } SEEQ_DEVICE;
  32. #endif /* _ASMLANGUAGE */
  33. /* Definitions for fields and bits in the SEEQ_DEVICE */
  34. /* Command register */
  35. #define SEEQ_CMD_DMA_EN 0x0001 /* DMA interrupt enable */
  36. #define SEEQ_CMD_RX_EN 0x0002 /* Receive interrupt enable */
  37. #define SEEQ_CMD_TX_EN 0x0004 /* Transmit interrupt enable */
  38. #define SEEQ_CMD_BUF_EN 0x0008 /* Buffer window interrupt enable */
  39. #define SEEQ_CMD_DMA_ACK 0x0010 /* DMA interrupt acknowledge */
  40. #define SEEQ_CMD_RX_ACK 0x0020 /* Receive interrupt acknowledge */
  41. #define SEEQ_CMD_TX_ACK 0x0040 /* Transmit interrupt acknowledge */
  42. #define SEEQ_CMD_BUF_ACK 0x0080 /* Buffer window int acknowledge */
  43. #define SEEQ_CMD_DMA_ON 0x0100 /* set DMA on */
  44. #define SEEQ_CMD_RX_ON 0x0200 /* set Receive on */
  45. #define SEEQ_CMD_TX_ON 0x0400 /* set Transmit on */
  46. #define SEEQ_CMD_DMA_OFF 0x0800 /* set DMA off */
  47. #define SEEQ_CMD_RX_OFF 0x1000 /* set Receive off */
  48. #define SEEQ_CMD_TX_OFF 0x2000 /* set Transmit off */
  49. #define SEEQ_CMD_FIFO_READ 0x4000 /* fifo read */
  50. #define SEEQ_CMD_FIFO_WRITE 0x8000 /* fifo write */
  51. /* Command register shorthand */
  52. #define SEEQ_CMD_ALL_ACK 0x00F0 /* acknowledge all interrupts */
  53. #define SEEQ_CMD_ALL_OFF 0x3800 /* turn everything off */
  54. /* Status register */
  55. #define SEEQ_STAT_DMA_EN 0x0001 /* DMA interrupt enable */
  56. #define SEEQ_STAT_RX_EN 0x0002 /* Receive interrupt enable */
  57. #define SEEQ_STAT_TX_EN 0x0004 /* Transmit interrupt enable */
  58. #define SEEQ_STAT_BUF_EN 0x0008 /* Buffer window interrupt enable */
  59. #define SEEQ_STAT_DMA_INT 0x0010 /* DMA interrupt */
  60. #define SEEQ_STAT_RX_INT 0x0020 /* Receive interrupt */
  61. #define SEEQ_STAT_TX_INT 0x0040 /* Transmit interrupt */
  62. #define SEEQ_STAT_BUF_INT 0x0080 /* Buffer window int */
  63. #define SEEQ_STAT_DMA_ON 0x0100 /* set DMA on */
  64. #define SEEQ_STAT_RX_ON 0x0200 /* set Receive on */
  65. #define SEEQ_STAT_TX_ON 0x0400 /* set Transmit on */
  66. #define SEEQ_STAT_FIFO_FULL 0x2000 /* DMA fifo full */
  67. #define SEEQ_STAT_FIFO_EMPTY 0x4000 /* DMA fifo empty */
  68. #define SEEQ_STAT_FIFO_DIR 0x8000 /* DMA fifo direction 0->wr 1->rd */
  69. #define SEEQ_STAT_CMD_MASK 0x000f /* */
  70. /* config1 register */
  71. #define SEEQ_CONF1_ADDR0 0x0000 /* station address 0 */
  72. #define SEEQ_CONF1_ADDR1 0x0001 /* station address 1 */
  73. #define SEEQ_CONF1_ADDR2 0x0002 /* station address 2 */
  74. #define SEEQ_CONF1_ADDR3 0x0003 /* station address 3 */
  75. #define SEEQ_CONF1_ADDR4 0x0004 /* station address 4 */
  76. #define SEEQ_CONF1_ADDR5 0x0005 /* station address 5 */
  77. #define SEEQ_CONF1_PROM 0x0006 /* address PROM */
  78. #define SEEQ_CONF1_TXEND 0x0007 /* Tx end area */
  79. #define SEEQ_CONF1_LBUFFER 0x0008 /* Local buffer memory */
  80. #define SEEQ_CONF1_IVEC 0x0009 /* Interrupt vector */
  81. #define SEEQ_CONF1_DMA_BURST_LENGTH_1 0x0000 /* dma burst length 1 */
  82. #define SEEQ_CONF1_DMA_BURST_LENGTH_4 0x0040 /* dma burst length 4 */
  83. #define SEEQ_CONF1_DMA_BURST_LENGTH_8 0x0080 /* dma burst length 8 */
  84. #define SEEQ_CONF1_DMA_BURST_LENGTH_16 0x00c0 /* dma burst length 16 */
  85. #define SEEQ_CONF1_DMA_BURST_INTERVAL_0 0x0000 /* continuous */
  86. #define SEEQ_CONF1_ADDR0_EN 0x0100 /* station address 0 enable */
  87. #define SEEQ_CONF1_ADDR1_EN 0x0200 /* station address 1 enable */
  88. #define SEEQ_CONF1_ADDR2_EN 0x0400 /* station address 2 enable */
  89. #define SEEQ_CONF1_ADDR3_EN 0x0800 /* station address 3 enable */
  90. #define SEEQ_CONF1_ADDR4_EN 0x1000 /* station address 4 enable */
  91. #define SEEQ_CONF1_ADDR5_EN 0x2000 /* station address 5 enable */
  92. #define SEEQ_CONF1_RX_SPEC 0x0000 /* specific addr receive */
  93. #define SEEQ_CONF1_RX_SPEC_BROAD 0x4000 /* spec & broadcast */
  94. #define SEEQ_CONF1_RX_SPEC_MULTI 0x8000 /* spec, broad & multicast */
  95. #define SEEQ_CONF1_RX_PROMISCUOUS 0xc000 /* promiscuous mode */
  96. /* config2 register */
  97. #define SEEQ_CONF2_BYTE_SWAP 0x0001 /* byte swap */
  98. #define SEEQ_CONF2_RESET 0x8000 /* Reset chip */
  99. /* Rx header status */
  100. #define SEEQ_RX_HSTAT_CHAIN 0x40 /* chain continue */
  101. #define SEEQ_RX_HSTAT_RECEIVED 0x80 /* 0 -> receive packet header */
  102. /* Rx packet status */
  103. #define SEEQ_RX_PSTAT_OVERSIZE 0x01 /* oversize packet */
  104. #define SEEQ_RX_PSTAT_CRC 0x02 /* crc error */
  105. #define SEEQ_RX_PSTAT_DRIBBLE 0x04 /* dribble packet */
  106. #define SEEQ_RX_PSTAT_SHORT 0x08 /* short packet */
  107. #define SEEQ_RX_PSTAT_DONE 0x80 /* packet done */
  108. /* Tx command byte */
  109. #define SEEQ_TX_CMD_BABBLE_EN 0x01 /* enable babble int */
  110. #define SEEQ_TX_CMD_COLL_EN 0x02 /* enable collision int */
  111. #define SEEQ_TX_CMD_COLL16_EN 0x04 /* enable 16 collisions int */
  112. #define SEEQ_TX_CMD_SUCC_EN 0x08 /* enable success int */
  113. #define SEEQ_TX_CMD_DATA 0x20 /* data follows */
  114. #define SEEQ_TX_CMD_CHAIN 0x40 /* not last packet */
  115. #define SEEQ_TX_CMD_XMIT 0x80 /* TX packet type */
  116. /* Tx packet status */
  117. #define SEEQ_TX_PSTAT_BABBLE 0x01 /* */
  118. #define SEEQ_TX_PSTAT_COLL 0x02 /* */
  119. #define SEEQ_TX_PSTAT_COLL16 0x04 /* */
  120. #define SEEQ_TX_PSTAT_DONE 0x80 /* packet done */
  121. #ifdef __cplusplus
  122. }
  123. #endif
  124. #endif /* __INCif_seeqh */