Source code of Windows XP (NT5)
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.

183 lines
3.9 KiB

  1. /*++
  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 ULONG ADDRESS_PORT;
  16. extern ULONG COMMAND_PORT;
  17. extern PUCHAR PipReadDataPort;
  18. extern PUCHAR PipAddressPort;
  19. extern PUCHAR PipCommandPort;
  20. //
  21. // Definitions
  22. //
  23. #if defined(_X86_)
  24. #define ADDRESS_PORT_NEC 0x0259
  25. #define COMMAND_PORT_NEC 0x0a59
  26. #endif
  27. //
  28. // Plug and Play Card Control Registers
  29. //
  30. #define SET_READ_DATA_PORT 0x00
  31. #define SERIAL_ISOLATION_PORT 0x01
  32. #define CONFIG_CONTROL_PORT 0x02
  33. #define WAKE_CSN_PORT 0x03
  34. #define CONFIG_DATA_PORT 0x04
  35. #define CONFIG_DATA_STATUS_PORT 0x05
  36. #define SET_CSN_PORT 0x06
  37. #define LOGICAL_DEVICE_PORT 0x07
  38. //
  39. // Plug and Play Logical Device Control Registers
  40. //
  41. #define ACTIVATE_PORT 0x30
  42. #define IO_RANGE_CHECK_PORT 0x31
  43. //
  44. // Config Control command
  45. //
  46. #define CONTROL_RESET 0x01
  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)(ULONG_PTR)(data))
  122. #define PipWriteData(data) WRITE_PORT_UCHAR (PipCommandPort, (UCHAR)(ULONG_PTR)(data))
  123. #define PipReadData() READ_PORT_UCHAR (PipReadDataPort)
  124. VOID
  125. PipWaitForKey(
  126. VOID
  127. );
  128. VOID
  129. PipConfig(
  130. IN UCHAR Csn
  131. );
  132. VOID
  133. PipIsolation(
  134. VOID
  135. );
  136. VOID
  137. PipSleep(
  138. VOID
  139. );
  140. VOID
  141. PipSelectDevice(
  142. IN UCHAR Device
  143. );