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.

164 lines
3.7 KiB

4 years ago
  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. pnpisa.h
  5. Abstract:
  6. This module contins definitions/declarations for PNP ISA related
  7. definitions.
  8. Author:
  9. Shie-Lin Tzong (shielint) July-12-1995
  10. Revision History:
  11. --*/
  12. //
  13. // External references
  14. //
  15. extern PUCHAR PipReadDataPort;
  16. extern PUCHAR PipAddressPort;
  17. extern PUCHAR PipCommandPort;
  18. //
  19. // Definitions
  20. //
  21. #ifndef NEC_98
  22. #define ADDRESS_PORT 0x0279
  23. #define COMMAND_PORT 0x0a79
  24. #else
  25. #define ADDRESS_PORT 0x0259
  26. #define COMMAND_PORT 0x0a59
  27. #endif // NEC_98
  28. //
  29. // Plug and Play Card Control Registers
  30. //
  31. #define SET_READ_DATA_PORT 0x00
  32. #define SERIAL_ISOLATION_PORT 0x01
  33. #define CONFIG_CONTROL_PORT 0x02
  34. #define WAKE_CSN_PORT 0x03
  35. #define CONFIG_DATA_PORT 0x04
  36. #define CONFIG_DATA_STATUS_PORT 0x05
  37. #define SET_CSN_PORT 0x06
  38. #define LOGICAL_DEVICE_PORT 0x07
  39. //
  40. // Plug and Play Logical Device Control Registers
  41. //
  42. #define ACTIVATE_PORT 0x30
  43. #define IO_RANGE_CHECK_PORT 0x31
  44. //
  45. // Config Control command
  46. //
  47. #define CONTROL_WAIT_FOR_KEY 0x02
  48. #define CONTROL_RESET_CSN 0x04
  49. //
  50. // Memory Space Configuration
  51. //
  52. #define NUMBER_MEMORY_DESCRIPTORS 4
  53. #define ADDRESS_MEMORY_BASE 0x40
  54. #define ADDRESS_MEMORY_INCR 0x08
  55. #define ADDRESS_MEMORY_HI 0x00
  56. #define ADDRESS_MEMORY_LO 0x01
  57. #define ADDRESS_MEMORY_CTL 0x02
  58. #define ADDRESS_MEMORY_CTL_LIMIT 0x01
  59. #define ADDRESS_MEMORY_UPPER_HI 0x03
  60. #define ADDRESS_MEMORY_UPPER_LO 0x04
  61. //
  62. // 32 Bit Memory Space Configuration
  63. //
  64. #define NUMBER_32_MEMORY_DESCRIPTORS 4
  65. #define ADDRESS_32_MEMORY_BASE(x) ((PUCHAR)(0x70+((x)*0x10)+((x==0) ? 6 : 0)))
  66. #define ADDRESS_32_MEMORY_B3 0x0
  67. #define ADDRESS_32_MEMORY_B2 0x1
  68. #define ADDRESS_32_MEMORY_B1 0x2
  69. #define ADDRESS_32_MEMORY_B0 0x3
  70. #define ADDRESS_32_MEMORY_CTL 0x4
  71. #define ADDRESS_32_MEMORY_E3 0x5
  72. #define ADDRESS_32_MEMORY_E2 0x6
  73. #define ADDRESS_32_MEMORY_E1 0x7
  74. #define ADDRESS_32_MEMORY_E0 0x8
  75. //
  76. // Io Space Configuration
  77. //
  78. #define NUMBER_IO_DESCRIPTORS 8
  79. #define ADDRESS_IO_BASE 0x60
  80. #define ADDRESS_IO_INCR 0x02
  81. #define ADDRESS_IO_BASE_HI 0x00
  82. #define ADDRESS_IO_BASE_LO 0x01
  83. //
  84. // Interrupt Configuration
  85. //
  86. #define NUMBER_IRQ_DESCRIPTORS 2
  87. #define ADDRESS_IRQ_BASE 0x70
  88. #define ADDRESS_IRQ_INCR 0x02
  89. #define ADDRESS_IRQ_VALUE 0x00
  90. #define ADDRESS_IRQ_TYPE 0x01
  91. //
  92. // DMA Configuration
  93. //
  94. #define NUMBER_DMA_DESCRIPTORS 2
  95. #define ADDRESS_DMA_BASE 0x74
  96. #define ADDRESS_DMA_INCR 0x01
  97. #define ADDRESS_DMA_VALUE 0x00
  98. #define NO_DMA 0x04
  99. //
  100. // 9 byte serial identifier of a PNP ISA Card
  101. //
  102. #include "pshpack1.h"
  103. typedef struct _SERIAL_IDENTIFIER_ {
  104. ULONG VenderId;
  105. ULONG SerialNumber;
  106. UCHAR Checksum;
  107. } SERIAL_IDENTIFIER, *PSERIAL_IDENTIFIER;
  108. #include "poppack.h"
  109. //
  110. // Misc. definitions
  111. //
  112. #define MIN_READ_DATA_PORT 0x200
  113. #define MAX_READ_DATA_PORT 0x3ff
  114. #define MAX_CHARACTER_LENGTH 255
  115. #define NUMBER_CARD_ID_BYTES 9
  116. #define NUMBER_CARD_ID_BITS (NUMBER_CARD_ID_BYTES * 8)
  117. #define CHECKSUMED_BITS 64
  118. #define LFSR_SEED 0x6A
  119. #define ISOLATION_TEST_BYTE_1 0x55
  120. #define ISOLATION_TEST_BYTE_2 0xAA
  121. #define PipWriteAddress(data) WRITE_PORT_UCHAR (PipAddressPort, (UCHAR)(data))
  122. #define PipWriteData(data) WRITE_PORT_UCHAR (PipCommandPort, (UCHAR)(data))
  123. #define PipReadData() READ_PORT_UCHAR (PipReadDataPort)