Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

epic100.h 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. #ifndef _EPIC100_H_
  2. # define _EPIC100_H_
  3. #ifndef PCI_VENDOR_SMC
  4. # define PCI_VENDOR_SMC 0x10B8
  5. #endif
  6. #ifndef PCI_DEVICE_SMC_EPIC100
  7. # define PCI_DEVICE_SMC_EPIC100 0x0005
  8. #endif
  9. #define PCI_DEVICE_ID_NONE 0xFFFF
  10. /* Offsets to registers (using SMC names). */
  11. enum epic100_registers {
  12. COMMAND= 0, /* Control Register */
  13. INTSTAT= 4, /* Interrupt Status */
  14. INTMASK= 8, /* Interrupt Mask */
  15. GENCTL = 0x0C, /* General Control */
  16. NVCTL = 0x10, /* Non Volatile Control */
  17. EECTL = 0x14, /* EEPROM Control */
  18. TEST = 0x1C, /* Test register: marked as reserved (see in source code) */
  19. CRCCNT = 0x20, /* CRC Error Counter */
  20. ALICNT = 0x24, /* Frame Alignment Error Counter */
  21. MPCNT = 0x28, /* Missed Packet Counter */
  22. MMCTL = 0x30, /* MII Management Interface Control */
  23. MMDATA = 0x34, /* MII Management Interface Data */
  24. MIICFG = 0x38, /* MII Configuration */
  25. IPG = 0x3C, /* InterPacket Gap */
  26. LAN0 = 0x40, /* MAC address. (0x40-0x48) */
  27. IDCHK = 0x4C, /* BoardID/ Checksum */
  28. MC0 = 0x50, /* Multicast filter table. (0x50-0x5c) */
  29. RXCON = 0x60, /* Receive Control */
  30. TXCON = 0x70, /* Transmit Control */
  31. TXSTAT = 0x74, /* Transmit Status */
  32. PRCDAR = 0x84, /* PCI Receive Current Descriptor Address */
  33. PRSTAT = 0xA4, /* PCI Receive DMA Status */
  34. PRCPTHR= 0xB0, /* PCI Receive Copy Threshold */
  35. PTCDAR = 0xC4, /* PCI Transmit Current Descriptor Address */
  36. ETHTHR = 0xDC /* Early Transmit Threshold */
  37. };
  38. /* Command register (CR_) bits */
  39. #define CR_STOP_RX (0x00000001)
  40. #define CR_START_RX (0x00000002)
  41. #define CR_QUEUE_TX (0x00000004)
  42. #define CR_QUEUE_RX (0x00000008)
  43. #define CR_NEXTFRAME (0x00000010)
  44. #define CR_STOP_TX_DMA (0x00000020)
  45. #define CR_STOP_RX_DMA (0x00000040)
  46. #define CR_TX_UGO (0x00000080)
  47. /* Interrupt register bits. NI means No Interrupt generated */
  48. #define INTR_RX_THR_STA (0x00400000) /* rx copy threshold status NI */
  49. #define INTR_RX_BUFF_EMPTY (0x00200000) /* rx buffers empty. NI */
  50. #define INTR_TX_IN_PROG (0x00100000) /* tx copy in progess. NI */
  51. #define INTR_RX_IN_PROG (0x00080000) /* rx copy in progress. NI */
  52. #define INTR_TXIDLE (0x00040000) /* tx idle. NI */
  53. #define INTR_RXIDLE (0x00020000) /* rx idle. NI */
  54. #define INTR_INTR_ACTIVE (0x00010000) /* Interrupt active. NI */
  55. #define INTR_RX_STATUS_OK (0x00008000) /* rx status valid. NI */
  56. #define INTR_PCI_TGT_ABT (0x00004000) /* PCI Target abort */
  57. #define INTR_PCI_MASTER_ABT (0x00002000) /* PCI Master abort */
  58. #define INTR_PCI_PARITY_ERR (0x00001000) /* PCI adress parity error */
  59. #define INTR_PCI_DATA_ERR (0x00000800) /* PCI data parity error */
  60. #define INTR_RX_THR_CROSSED (0x00000400) /* rx copy threshold crossed */
  61. #define INTR_CNTFULL (0x00000200) /* Counter overflow */
  62. #define INTR_TXUNDERRUN (0x00000100) /* tx underrun. */
  63. #define INTR_TXEMPTY (0x00000080) /* tx queue empty */
  64. #define INTR_TX_CH_COMPLETE (0x00000040) /* tx chain complete */
  65. #define INTR_TXDONE (0x00000020) /* tx complete (w or w/o err) */
  66. #define INTR_RXERROR (0x00000010) /* rx error (CRC) */
  67. #define INTR_RXOVERFLOW (0x00000008) /* rx buffer overflow */
  68. #define INTR_RX_QUEUE_EMPTY (0x00000004) /* rx queue empty. */
  69. #define INTR_RXHEADER (0x00000002) /* header copy complete */
  70. #define INTR_RXDONE (0x00000001) /* Receive copy complete */
  71. #define INTR_CLEARINTR (0x00007FFF)
  72. #define INTR_VALIDBITS (0x007FFFFF)
  73. #define INTR_DISABLE (0x00000000)
  74. #define INTR_CLEARERRS (0x00007F18)
  75. #define INTR_ABNINTR (INTR_CNTFULL | INTR_TXUNDERRUN | INTR_RXOVERFLOW)
  76. /* General Control (GC_) bits */
  77. #define GC_SOFT_RESET (0x00000001)
  78. #define GC_INTR_ENABLE (0x00000002)
  79. #define GC_SOFT_INTR (0x00000004)
  80. #define GC_POWER_DOWN (0x00000008)
  81. #define GC_ONE_COPY (0x00000010)
  82. #define GC_BIG_ENDIAN (0x00000020)
  83. #define GC_RX_PREEMPT_TX (0x00000040)
  84. #define GC_TX_PREEMPT_RX (0x00000080)
  85. /*
  86. * Receive FIFO Threshold values
  87. * Control the level at which the PCI burst state machine
  88. * begins to empty the receive FIFO. Possible values: 0-3
  89. *
  90. * 0 => 32, 1 => 64, 2 => 96 3 => 128 bytes.
  91. */
  92. #define GC_RX_FIFO_THR_32 (0x00000000)
  93. #define GC_RX_FIFO_THR_64 (0x00000100)
  94. #define GC_RX_FIFO_THR_96 (0x00000200)
  95. #define GC_RX_FIFO_THR_128 (0x00000300)
  96. /* Memory Read Control (MRC_) values */
  97. #define GC_MRC_MEM_READ (0x00000000)
  98. #define GC_MRC_READ_MULT (0x00000400)
  99. #define GC_MRC_READ_LINE (0x00000800)
  100. #define GC_SOFTBIT0 (0x00001000)
  101. #define GC_SOFTBIT1 (0x00002000)
  102. #define GC_RESET_PHY (0x00004000)
  103. /* Definitions of the Receive Control (RC_) register bits */
  104. #define RC_SAVE_ERRORED_PKT (0x00000001)
  105. #define RC_SAVE_RUNT_FRAMES (0x00000002)
  106. #define RC_RCV_BROADCAST (0x00000004)
  107. #define RC_RCV_MULTICAST (0x00000008)
  108. #define RC_RCV_INVERSE_PKT (0x00000010)
  109. #define RC_PROMISCUOUS_MODE (0x00000020)
  110. #define RC_MONITOR_MODE (0x00000040)
  111. #define RC_EARLY_RCV_ENABLE (0x00000080)
  112. /* description of the rx descriptors control bits */
  113. #define RD_FRAGLIST (0x0001) /* Desc points to a fragment list */
  114. #define RD_LLFORM (0x0002) /* Frag list format */
  115. #define RD_HDR_CPY (0x0004) /* Desc used for header copy */
  116. /* Definition of the Transmit CONTROL (TC) register bits */
  117. #define TC_EARLY_TX_ENABLE (0x00000001)
  118. /* Loopback Mode (LM_) Select valuesbits */
  119. #define TC_LM_NORMAL (0x00000000)
  120. #define TC_LM_INTERNAL (0x00000002)
  121. #define TC_LM_EXTERNAL (0x00000004)
  122. #define TC_LM_FULL_DPX (0x00000006)
  123. #define TX_SLOT_TIME (0x00000078)
  124. /* Bytes transferred to chip before transmission starts. */
  125. #define TX_FIFO_THRESH 128 /* Rounded down to 4 byte units. */
  126. /* description of rx descriptors status bits */
  127. #define RRING_PKT_INTACT (0x0001)
  128. #define RRING_ALIGN_ERR (0x0002)
  129. #define RRING_CRC_ERR (0x0004)
  130. #define RRING_MISSED_PKT (0x0008)
  131. #define RRING_MULTICAST (0x0010)
  132. #define RRING_BROADCAST (0x0020)
  133. #define RRING_RECEIVER_DISABLE (0x0040)
  134. #define RRING_STATUS_VALID (0x1000)
  135. #define RRING_FRAGLIST_ERR (0x2000)
  136. #define RRING_HDR_COPIED (0x4000)
  137. #define RRING_OWN (0x8000)
  138. /* error summary */
  139. #define RRING_ERROR (RRING_ALIGN_ERR|RRING_CRC_ERR)
  140. /* description of tx descriptors status bits */
  141. #define TRING_PKT_INTACT (0x0001) /* pkt transmitted. */
  142. #define TRING_PKT_NONDEFER (0x0002) /* pkt xmitted w/o deferring */
  143. #define TRING_COLL (0x0004) /* pkt xmitted w collisions */
  144. #define TRING_CARR (0x0008) /* carrier sense lost */
  145. #define TRING_UNDERRUN (0x0010) /* DMA underrun */
  146. #define TRING_HB_COLL (0x0020) /* Collision detect Heartbeat */
  147. #define TRING_WIN_COLL (0x0040) /* out of window collision */
  148. #define TRING_DEFERRED (0x0080) /* Deferring */
  149. #define TRING_COLL_COUNT (0x0F00) /* collision counter (mask) */
  150. #define TRING_COLL_EXCESS (0x1000) /* tx aborted: excessive colls */
  151. #define TRING_OWN (0x8000) /* desc ownership bit */
  152. /* error summary */
  153. #define TRING_ABORT (TRING_COLL_EXCESS|TRING_WIN_COLL|TRING_UNDERRUN)
  154. #define TRING_ERROR (TRING_DEFERRED|TRING_WIN_COLL|TRING_UNDERRUN|TRING_CARR/*|TRING_COLL*/ )
  155. /* description of the tx descriptors control bits */
  156. #define TD_FRAGLIST (0x0001) /* Desc points to a fragment list */
  157. #define TD_LLFORM (0x0002) /* Frag list format */
  158. #define TD_IAF (0x0004) /* Generate Interrupt after tx */
  159. #define TD_NOCRC (0x0008) /* No CRC generated */
  160. #define TD_LASTDESC (0x0010) /* Last desc for this frame */
  161. #endif /* _EPIC100_H_ */