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.

137 lines
6.9 KiB

4 years ago
  1. /***********************************************************************/
  2. /***********************************************************************/
  3. /* */
  4. /* File Name: ADAPTER.H */
  5. /* */
  6. /* Program Name: NetFlex NDIS 3.0 Driver */
  7. /* */
  8. /* Companion Files: None */
  9. /* */
  10. /* Function: This module contains all the adapter specific data */
  11. /* structure definitions that are specific to the */
  12. /* CPQTOK board. */
  13. /* */
  14. /* (c) Compaq Computer Corporation, 1992,1993 */
  15. /* */
  16. /* This file is licensed by Compaq Computer Corporation to Microsoft */
  17. /* Corporation pursuant to the letter of August 20, 1992 from */
  18. /* Gary Stimac to Mark Baber. */
  19. /* */
  20. /* History: */
  21. /* */
  22. /* 02/24/92 Carol Fuss - Reworked from NDIS driver */
  23. /* 06/14/93 Cat Abueg - Modified for MAPLE */
  24. /* 08/09/93 Cat Abueg - Modified for BONSAI */
  25. /* */
  26. /***********************************************************************/
  27. /***********************************************************************/
  28. /*
  29. * COMPAQ Token Ring Configuration Register definitions -
  30. * These equates define the bit settings in the CPQTOK
  31. * adapter's configuration registers.
  32. */
  33. #define CFG_INTS 0xe000 /* Interrupt Level 5, 9 10, 11, 15 */
  34. #define CFG_INTRIG 0x1000 /* Interrupt Level Trigger */
  35. #define CFG_MEDIA 0x0800 /* Type 3 Media (else type 1) */
  36. #define CFG_16MBS 0x0400 /* 16Mbs select (else 4Mbs) */
  37. #define CFG_RSVD1 0x0300 /* Reserved */
  38. #define CFG_RSVD2 0x00f8 /* Reserved */
  39. #define CFG_ZERO 0x0006 /* Always zero */
  40. #define CFG_ENABLE 0x0001 /* Adapter Enable */
  41. /*
  42. * The following configuration registers are read as long words during
  43. * init time - i.e. 0xc84 and 0xc85, and 0x01b and 0x01c
  44. */
  45. //define CFG_REGISTER 0xc84 /* Configuration register */
  46. #define CFG_REGISTER 0x4 /* Configuration register */
  47. /* Actual value = 0xc85 */
  48. #define CFG_REGRODAN 0x01b /* Cfg reg for 2nd port of Rodan */
  49. /* Actual value = 0x01c */
  50. #define CFG_REG2_OFF 0x01c /* ext cfg reg for 2nd port of Rodan */
  51. /* Actual value = 0x01c */
  52. #define COMPAQ_ID 0x110e /* Product Register ID */
  53. #define CPQTOK_ID 0x0060 /* Cpqtok's board ID */
  54. #define DURANGO_ID 0x0260 /* Durango's board ID */
  55. #define NETFLEX_ID 0x0061 /* NETFLEX's board ID */
  56. #define MAPLE_ID 0x0161 /* Manitu's board ID */
  57. #define BONSAI_ID 0x0062 /* Bonsai board ID */
  58. #define RODAN_ID 0x0063 /* Rodan board ID */
  59. #define NETFLEX_REVMASK 0xf0ff /* Board ID revision mask - MAJ */
  60. #define NETFLEX_MINMASK 0xff00 /* Board ID revision mask - MIN */
  61. #define PAGE3_MASK 0xc0000000 /* PCI mask - for < TRIC 5 */
  62. #define CFG_DUALPT_ADP1 0x0800 /* Type of connection for adp 1 */
  63. #define CFG_DUALPT_ADP2 0x0400 /* Type of connection for adp 2 */
  64. #define CFG_FULL_DUPLEX 0x04 /* Mask For Full Duplex */
  65. #define CFG_FULL_DUPLEX_HEAD2 0x08 /* Mask For Full Duplex Bonsai H2 */
  66. #define DUALHEAD_CFG_PORT_OFFSET 0x20 /* base port range for dual head z020 - z02e */
  67. #define CFG_PORT_OFFSET 0xc80 /* adapter configuration ports */
  68. #define EXTCFG_PORT_OFFSET 0xc63 /* extra adapter configuration ports */
  69. #define NUM_BASE_PORTS 0x20 /* z0000 - z001f */
  70. #define NUM_CFG_PORTS 0x8 /* z0c80 - z0c87 */
  71. #define NUM_EXTCFG_PORTS 0x5 /* z0c63 - z0c67 */
  72. #define NUM_DUALHEAD_CFG_PORTS 0x30 /* z000 - z02F */
  73. #define COLL_DETECT_ENABLED 0x8 /* bit 7 = 1 if collision enabled */
  74. #define LOOP_BACK_ENABLE_OFF 0x2 /* added to 0zc63 = 0Zc65 */
  75. #define LOOP_BACK_STATUS_OFF 0x1 /* added to 0zc63 = 0Zc64 */
  76. #define LOOP_BACK_ENABLE_HEAD1_OFF 0x3 /* added to 0zc63 = 0Zc66 */
  77. #define LOOP_BACK_STATUS_HEAD1_OFF 0x3 /* added to 0zc63 = 0Zc66 */
  78. #define LOOP_BACK_ENABLE_HEAD2_OFF 0x4 /* added to 0zc63 = 0Zc67 */
  79. #define LOOP_BACK_STATUS_HEAD2_OFF 0x4 /* added to 0zc63 = 0Zc67 */
  80. #define SWAPL(x) (((ULONG)(x) << 24) | \
  81. (((ULONG)(x) >> 24) & 0x000000ff) | \
  82. (((ULONG)(x) << 8) & 0x00ff0000) | \
  83. (((ULONG)(x) >> 8) & 0x0000ff00))
  84. #define SWAPS(x) (((USHORT)(x) << 8) | (((USHORT)(x) >> 8) & 0x00ff))
  85. #define CTRL_ADDR(x) ((x) | 0x80000000)
  86. #define MAKE_ODD(x) (x |= 0x1000000)
  87. #define MAKE_EVEN(x) (x &= ~0x1000000)
  88. #define TOKENMTU 4096 /* Token-Ring maximum packet size */
  89. #define MIN_TPKT 14 /* Minimunm packet size */
  90. #define CMD_ASYNCH 0
  91. #define CMD_SYNCH 1
  92. #define HARD_RESET 0
  93. #define SOFT_RESET 1
  94. #define DBM_NOT_SET 0
  95. #define DBM_RECV_ONLY 1
  96. #define DBM_XMIT_ONLY 2
  97. #define DBM_RECV_XMIT 3
  98. #define NETFLEX_INIT_ERROR_CODE ((ULONG) 0x1111)
  99. #define NETFLEX_RESET_FAILURE_ERROR_CODE ((ULONG) 0x2222)
  100. #define NETFLEX_ADAPTERCHECK_ERROR_CODE ((ULONG) 0x3333)
  101. #define NETFLEX_RINGSTATUS_ERROR_CODE ((ULONG) 0x4444)
  102. //
  103. // Structure Name: Download Structure Definition
  104. //
  105. // Description: The Download Structure Definition defines the structure
  106. // of the code/data to download to the TMS380 chipset.
  107. //
  108. typedef struct dl_struct
  109. {
  110. USHORT dl_chap; /* Section hi address */
  111. USHORT dl_addr; /* Section lo address */
  112. USHORT dl_bytes; /* Section length in bytes */
  113. } DL_STRUCT, *PDL_STRUCT;