if_exreg.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. /* $OpenBSD: if_exreg.h,v 1.4 2009/05/23 15:35:10 jsg Exp $ */
  2. /*
  3. * Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es)
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice unmodified, this list of conditions, and the following
  11. * disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  17. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  19. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  20. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  21. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  22. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  23. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  24. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  25. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  26. * SUCH DAMAGE.
  27. */
  28. /*
  29. * Intel EtherExpress Pro/10 Ethernet driver
  30. */
  31. /*
  32. * Several constants.
  33. */
  34. /* Default RAM size in board. */
  35. #define CARD_RAM_SIZE 0x8000
  36. /* Number of I/O ports used. */
  37. #define EX_IOSIZE 16
  38. /*
  39. * Intel EtherExpress Pro (i82595 based) registers
  40. */
  41. /* Common registers to all banks. */
  42. #define CMD_REG 0
  43. #define REG1 1
  44. #define REG2 2
  45. #define REG3 3
  46. #define REG4 4
  47. #define REG5 5
  48. #define REG6 6
  49. #define REG7 7
  50. #define REG8 8
  51. #define REG9 9
  52. #define REG10 10
  53. #define REG11 11
  54. #define REG12 12
  55. #define REG13 13
  56. #define REG14 14
  57. #define REG15 15
  58. /* Definitions for command register (CMD_REG). */
  59. #define Switch_Bank_CMD 0
  60. #define MC_Setup_CMD 3
  61. #define Transmit_CMD 4
  62. #define Diagnose_CMD 7
  63. #define Rcv_Enable_CMD 8
  64. #define Rcv_Stop 11
  65. #define Reset_CMD 14
  66. #define Resume_XMT_List_CMD 28
  67. #define Sel_Reset_CMD 30
  68. #define Abort 0x20
  69. #define Bank0_Sel 0x00
  70. #define Bank1_Sel 0x40
  71. #define Bank2_Sel 0x80
  72. /* Bank 0 specific registers. */
  73. #define STATUS_REG 1
  74. #define ID_REG 2
  75. #define Id_Mask 0x2c
  76. #define Id_Sig 0x24
  77. #define Counter_bits 0xc0
  78. #define MASK_REG 3
  79. #define Exec_Int 0x08
  80. #define Tx_Int 0x04
  81. #define Rx_Int 0x02
  82. #define Rx_Stp_Int 0x01
  83. #define All_Int 0x0f
  84. #define RCV_BAR 4
  85. #define RCV_BAR_Lo 4
  86. #define RCV_BAR_Hi 5
  87. #define RCV_STOP_REG 6
  88. #define XMT_BAR 10
  89. #define HOST_ADDR_REG 12 /* 16-bit register */
  90. #define IO_PORT_REG 14 /* 16-bit register */
  91. /* Bank 1 specific registers. */
  92. #define TriST_INT 0x80
  93. #define INT_NO_REG 2
  94. #define RCV_LOWER_LIMIT_REG 8
  95. #define RCV_UPPER_LIMIT_REG 9
  96. #define XMT_LOWER_LIMIT_REG 10
  97. #define XMT_UPPER_LIMIT_REG 11
  98. /* Bank 2 specific registers. */
  99. #define Disc_Bad_Fr 0x80
  100. #define Tx_Chn_ErStp 0x40
  101. #define Tx_Chn_Int_Md 0x20
  102. #define Multi_IA 0x20
  103. #define No_SA_Ins 0x10
  104. #define RX_CRC_InMem 0x04
  105. #define Promisc_Mode 0x01
  106. #define BNC_bit 0x20
  107. #define TPE_bit 0x04
  108. #define I_ADDR_REG0 4
  109. #define EEPROM_REG 10
  110. #define Trnoff_Enable 0x10
  111. /* EEPROM memory positions (16-bit wide). */
  112. #define EE_W0 0x00
  113. # define EE_W0_PNP 0x0001
  114. # define EE_W0_BUS16 0x0004
  115. # define EE_W0_FLASH_ADDR_MASK 0x0038
  116. # define EE_W0_FLASH_ADDR_SHIFT 3
  117. # define EE_W0_AUTO_IO 0x0040
  118. # define EE_W0_FLASH 0x0100
  119. # define EE_W0_AUTO_NEG 0x0200
  120. # define EE_W0_IO_MASK 0xFC00
  121. # define EE_W0_IO_SHIFT 10
  122. #define EE_IRQ_No 1
  123. #define IRQ_No_Mask 0x07
  124. #define EE_W1 0x01
  125. # define EE_W1_INT_SEL 0x0007
  126. # define EE_W1_NO_LINK_INT 0x0008 /* Link Integrity Off */
  127. # define EE_W1_NO_POLARITY 0x0010 /* Polarity Correction Off */
  128. # define EE_W1_TPE_AUI 0x0020 /* 1 = TPE, 0 = AUI */
  129. # define EE_W1_NO_JABBER_PREV 0x0040 /* Jabber prevention Off */
  130. # define EE_W1_NO_AUTO_SELECT 0x0080 /* Auto Port Selection Off */
  131. # define EE_W1_SMOUT 0x0100 /* SMout Pin Control 0= Input */
  132. # define EE_W1_PROM 0x0200 /* Flash = 0, PROM = 1 */
  133. # define EE_W1_ALT_READY 0x2000 /* Alternate Ready, 0=normal */
  134. # define EE_W1_FULL_DUPLEX 0x8000
  135. #define EE_W2 0x02
  136. #define EE_W3 0x03
  137. #define EE_W4 0x04
  138. #define EE_Eth_Addr_Lo 2
  139. #define EE_Eth_Addr_Mid 3
  140. #define EE_Eth_Addr_Hi 4
  141. #define EE_W5 0x05
  142. # define EE_W5_BNC_TPE 0x0001 /* 0 = TPE, 1 = BNC */
  143. # define EE_W5_BOOT_IPX 0x0002
  144. # define EE_W5_BOOT_ODI 0x0004
  145. # define EE_W5_BOOT_NDIS (EE_W5_BOOT_IPX|EE_W5_BOOT_ODI)
  146. # define EE_W5_NUM_CONN 0x0008 /* 0 = 2, 1 = 3 */
  147. # define EE_W5_NOFLASH 0x0010 /* No flash socket present */
  148. # define EE_W5_PORT_TPE 0x0020 /* TPE present */
  149. # define EE_W5_PORT_BNC 0x0040 /* BNC present */
  150. # define EE_W5_PORT_AUI 0x0080 /* AUI present */
  151. # define EE_W5_PWR_MGT 0x0100 /* Power Management */
  152. # define EE_W5_CP 0x0200 /* COncurrent Processing */
  153. #define EE_W6 0x05
  154. # define EE_W6_STEP_MASK 0x000F
  155. # define EE_W6_BOARD_MASK 0xF
  156. /* EEPROM serial interface. */
  157. #define EESK 0x01
  158. #define EECS 0x02
  159. #define EEDI 0x04
  160. #define EEDO 0x08
  161. #define EE_READ_CMD (6 << 6)
  162. /* Frame chain constants. */
  163. /* Transmit header length (in board's ring buffer). */
  164. #define XMT_HEADER_LEN 8
  165. #define XMT_Chain_Point 4
  166. #define XMT_Byte_Count 6
  167. #define Done_bit 0x0080
  168. #define Ch_bit 0x8000
  169. /* Transmit result bits. */
  170. #define No_Collisions_bits 0x000f
  171. #define TX_OK_bit 0x2000
  172. /* Receive result bits. */
  173. #define RCV_Done 8
  174. #define RCV_OK_bit 0x2000