Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

218 lines
6.9 KiB

4 years ago
  1. #ifndef _I82595TX_
  2. #define _I82595TX_
  3. //////////////////////////////////////////////////////////////
  4. // General Parameters
  5. //////////////////////////////////////////////////////////////
  6. // There are 3 switchable banks of 16 IO ports
  7. // Bank switching is done via register 0
  8. #define I82595_PORTS_WIDTH 0x10
  9. #define I82595_NUM_BANKS 0x3
  10. // Number of usec to spin in various places before we give up...
  11. #define I82595_SPIN_TIMEOUT 10000
  12. //////////////////////////////////////////////////////////////
  13. // Exec States
  14. //////////////////////////////////////////////////////////////
  15. #define I82595_EXEC_STATE_ACTIVE (2 << 4)
  16. #define I82595_EXEC_STATE_IDLE 0
  17. #define I82595_EXEC_STATE_ABORTING (3 << 4)
  18. //////////////////////////////////////////////////////////////
  19. // Receive States
  20. //////////////////////////////////////////////////////////////
  21. #define I82595_RCV_STATE_DISABLED 0
  22. #define I82595_RCV_STATE_READY (1<<6)
  23. #define I82595_RCV_STATE_ACTIVE (2<<6)
  24. #define I82595_RCV_STATE_STOPPING (3<<6)
  25. //////////////////////////////////////////////////////////////
  26. // Command Constants
  27. //////////////////////////////////////////////////////////////
  28. // Bank switches...
  29. #define I82595_CMD_BANK0 0x0
  30. #define I82595_CMD_BANK1 0x40
  31. #define I82595_CMD_BANK2 0x80
  32. // Other command constants...
  33. #define I82595_CMD_MC_SETUP 0x03
  34. #define I82595_XMT 0x04
  35. #define I82595_XMT_SHORT 0x0004
  36. #define I82595_CMD_DIAGNOSE 0x07
  37. #define I82595_FULL_RESET 0x0e
  38. #define I82595_SEL_RESET 0x1e
  39. #define I82595_PWR_DOWN 0x18
  40. #define I82595_STOP_RCV 0x0b
  41. #define I82595_RCV_ENABLE 0x08
  42. #define I82595_XMT_RESUME 0x1c
  43. //////////////////////////////////////////////////////////////
  44. // Return Values (valid after 0,1,3 goes high)
  45. //////////////////////////////////////////////////////////////
  46. #define I82595_DIAGNOSE_PASS 0x07
  47. #define I82595_DIAGNOSE_FAIL 0x0f
  48. #define I82595_INIT_DONE 0x0e
  49. #define I82595_POWERUP_DONE 0x19
  50. //////////////////////////////////////////////////////////////
  51. // Register Defines
  52. //////////////////////////////////////////////////////////////
  53. #define I82595_CMD_REG 0x0
  54. // These are in bank 0
  55. #define I82595_STATUS_REG 0x1
  56. #define I82595_ID_REG 0x2
  57. #define I82595_INTMASK_REG 0x3
  58. #define I82595_32IOSEL_REG 0x3
  59. #define I82595_RX_BAR_REG 0x4
  60. #define I82595_RX_STOP_REG 0x6
  61. #define I82595_TX_BAR_REG 0xa
  62. #define I82595_HOST_ADDR_REG 0xc // LOW
  63. #define I82595_32MEM_IO_REG 0xc
  64. #define I82595_HOST_ADDR_HIGH_REG 0xd // HIGH
  65. #define I82595_MEM_IO_REG 0xe // LOW
  66. #define I82595_MEM_IO_HIGH_REG 0xf // HIGH
  67. // Bank 1
  68. #define I82595_ALT_RDY_REG 0x1
  69. #define I82595_INTENABLE_REG 0x1
  70. #define I82595_INT_SELECT_REG 0x2
  71. #define I82595_IOMAP_REG 0x3
  72. #define I82595_RX_LOWER_LIMIT_REG 0x8
  73. #define I82595_RX_UPPER_LIMIT_REG 0x9
  74. #define I82595_TX_LOWER_LIMIT_REG 0xa
  75. #define I82595_TX_UPPER_LIMIT_REG 0xb
  76. #define I82595_IOCHRDY_TEST_REG 0xd
  77. // Bank 2
  78. #define I82595_CONFIG1_REG 0x1
  79. #define I82595_CONFIG2_REG 0x2
  80. #define I82595_CONFIG3_REG 0x3
  81. #define I82595_IA_REG_0 0x4
  82. #define I82595_IA_REG_1 0x5
  83. #define I82595_IA_REG_2 0x6
  84. #define I82595_IA_REG_3 0x7
  85. #define I82595_IA_REG_4 0x8
  86. #define I82595_IA_REG_5 0x9
  87. #define I82595_EEPROM_REG 0xa // eeprom access reg
  88. #define I82595_STEPPING_REG 0xa
  89. //////////////////////////////////////////////////////////////
  90. // Register Masks...
  91. //////////////////////////////////////////////////////////////
  92. //////////////////////////////////////////////////////////////
  93. // Command Register (ALL,0)
  94. //////////////////////////////////////////////////////////////
  95. #define I82595_CUR_BANK_MASK 0xC0
  96. //////////////////////////////////////////////////////////////
  97. // Status Register (0,1) bitmasks
  98. //////////////////////////////////////////////////////////////
  99. #define I82595_RX_STP_INT_RCVD 0x1 // bit 0
  100. // Did we get a RX Interrupt
  101. #define I82595_RX_INT_RCVD 0x2 // bit 1
  102. // Mask the TX interupt?
  103. #define I82595_TX_INT_RCVD 0x4 // bit 2
  104. // This goes high when a command execution is complete.
  105. #define I82595_EXEC_INT_RCVD 0x8 // bit 3
  106. // status codes
  107. #define I82595_EXEC_STATE 0x30 // bit 4,5
  108. #define I82595_RCV_STATE 0xC0 // bit 6,7
  109. #define I82595_STATES_OFFSET 0x4
  110. //////////////////////////////////////////////////////////////
  111. // Reg 0,3
  112. //////////////////////////////////////////////////////////////
  113. #define I82595_RX_STP_INT_MASK 0x1 // bit 0
  114. // Mask the RX interrupt?
  115. #define I82595_RX_INT_MASK 0x2 // bit 1
  116. // Mask the TX interupt?
  117. #define I82595_TX_INT_MASK 0x4 // bit 2
  118. // This goes high when a command execution is complete.
  119. #define I82595_EXEC_INT_MASK 0x8 // bit 3
  120. #define I82595_32IOSEL 0x10 // bit 4
  121. //////////////////////////////////////////////////////////////
  122. // Reg 0,4
  123. //////////////////////////////////////////////////////////////
  124. #define I82595_IOBASE_SELECT 0x3f // bits 0-5
  125. #define I82595_IOBASE_TO_SELECTION(a) (a>>4)
  126. //////////////////////////////////////////////////////////////
  127. // Register 1,1
  128. //////////////////////////////////////////////////////////////
  129. #define I82595_USE_8_BIT_FLAG 0x2
  130. #define I82595_ALT_IOCHRDY 0x40
  131. #define I82595_ENABLE_INTS_FLAG 0x80
  132. //////////////////////////////////////////////////////////////
  133. // Register 1,2
  134. //////////////////////////////////////////////////////////////
  135. #define I82595_INTERRUPT_SELECT_MASK 0x3 // bits 0,1
  136. #define I82595_ALT_RDY_FLAG 0x40 // bit 6
  137. //////////////////////////////////////////////////////////////
  138. // Register 1,13
  139. //////////////////////////////////////////////////////////////
  140. #define I82595_IOCHRDY_PASS_FLAG 0x1
  141. #define I82595_IOCHRDY_TEST_FLAG 0x2
  142. //////////////////////////////////////////////////////////////
  143. // Register 2.2 - configuration
  144. //////////////////////////////////////////////////////////////
  145. #define I82595_PROMISCUOUS_FLAG 0x01
  146. #define I82595_NO_BROADCAST_FLAG 0x02
  147. //////////////////////////////////////////////////////////////
  148. // Register 2.10 -- eeprom access
  149. //////////////////////////////////////////////////////////////
  150. #define I82595_EESK_MASK 0x1
  151. #define I82595_EECS_MASK 0x2
  152. #define I82595_EEDI_MASK 0x4
  153. #define I82595_EEDO_MASK 0x8
  154. #define I82595_TURNOFF_ENABLE 0x10
  155. #define I82595_EEDI_OFFSET 0x2
  156. #define I82595_EEDO_OFFSET 0x3
  157. #define I82595_EEPROM_READ 0x6 // 110:b
  158. #define I82595_EEPROM_WRITE 0x5
  159. #define I82595_EEPROM_ERASE 0x7
  160. #define I82595_EEPROM_EWEN 19
  161. #define I82595_EEPROM_EWDS 16
  162. #define I82595_EEPROM_IOADDR_REG 0
  163. #define I82595_EEPROM_IOMASK ((0x3f) << 10)
  164. #define I82595_STEPPING_OFFSET 0x5 // bits 5-7 are 82595 stepping
  165. //////////////////////////////////////////////////////////////////////
  166. // TX constants
  167. //////////////////////////////////////////////////////////////////////
  168. #define I82595_TX_FRM_HDR_SIZE 0x8
  169. #define I82595_TX_DN_BYTE_MASK 0x80
  170. #define I82595_CH_SHORT_MASK 0x8000
  171. #define I82595_TX_OK_SHORT_MASK 0x2000
  172. #define I82595_NO_COLLISIONS_MASK 0x0f
  173. //////////////////////////////////////////////////////////////////////
  174. // RX Constants
  175. //////////////////////////////////////////////////////////////////////
  176. #define I82595_RX_EOF 0x08
  177. #define I82595_RX_OK 0x20
  178. #endif // ifndef _i82595TX_