Leaked source code of windows server 2003
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.

196 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1997-2000 Microsoft Corporation
  3. Module Name:
  4. card.h
  5. Abstract:
  6. These are the structures used for various card related requests.
  7. Author:
  8. Bob Rinne (BobRi) 3-Aug-1994
  9. Jeff McLeman (mcleman@zso.dec.com)
  10. Neil Sandlin (neilsa) June 1 1999
  11. Revision History:
  12. --*/
  13. #ifndef _PCMCIA_CARD_H_
  14. #define _PCMCIA_CARD_H_
  15. //
  16. // Define request types
  17. //
  18. #define IO_REQUEST 0x1
  19. #define IRQ_REQUEST 0x2
  20. #define CONFIGURE_REQUEST 0x3
  21. #define MEM_REQUEST 0x4
  22. #define DECONFIGURE_REQUEST 0x6
  23. //
  24. // Define an I/O range request structure
  25. //
  26. typedef struct _CARD_REQUEST_IO {
  27. struct _CARD_IO_ENTRY {
  28. ULONG BasePort;
  29. ULONG NumPorts;
  30. UCHAR Attributes;
  31. } IoEntry[MAX_NUMBER_OF_IO_RANGES];
  32. USHORT NumberOfRanges;
  33. }CARD_REQUEST_IO, *PCARD_REQUEST_IO;
  34. //
  35. // Define I/O attributes
  36. //
  37. #define IO_WAIT_STATE_16 0x1
  38. #define IO_SOURCE_16 0x2
  39. #define IO_ZERO_WAIT_8 0x4
  40. #define IO_DATA_PATH_WIDTH 0x8
  41. //
  42. // Define an IRQ Request structure
  43. //
  44. typedef struct _CARD_REQUEST_IRQ {
  45. USHORT Attributes;
  46. UCHAR AssignedIRQ;
  47. UCHAR ReadyIRQ;
  48. UCHAR IRQInfo1;
  49. UCHAR IRQInfo2;
  50. }CARD_REQUEST_IRQ, *PCARD_REQUEST_IRQ;
  51. //
  52. // define the IRQ request attributes
  53. //
  54. #define IRQ_EXCLUSIVE 0x00
  55. #define IRQ_TIME_SHARED 0x01
  56. #define IRQ_DYN_SHARED 0x02
  57. #define IRQ_RESERVED 0x03
  58. #define IRQ_FORCE_PULSED 0x04
  59. #define IRQ_FIRST_SHARED 0x08
  60. #define IRQ_PULSE_ALLOC 0x10
  61. //
  62. // define a configuration request
  63. //
  64. typedef struct _CARD_REQUEST_CONFIG {
  65. ULONG ConfigBase;
  66. USHORT Attributes;
  67. UCHAR RegisterWriteMask;
  68. UCHAR InterfaceType;
  69. UCHAR ConfigIndex;
  70. UCHAR CardConfiguration;
  71. UCHAR PinPlacement;
  72. UCHAR SocketCopyRegister;
  73. UCHAR ExtendedStatusRegister;
  74. ULONG IoBaseRegister;
  75. UCHAR IoLimitRegister;
  76. } CARD_REQUEST_CONFIG, *PCARD_REQUEST_CONFIG;
  77. //
  78. // Define associated bits for above
  79. //
  80. //
  81. // InterfaceType
  82. //
  83. #define CONFIG_INTERFACE_MEM 0x0
  84. #define CONFIG_INTERFACE_IO_MEM 0x1
  85. //
  86. // RegisterWriteMask is a bit mask that controls what configuration registers are
  87. // modified in the CONFIGURE_REQUEST call.
  88. //
  89. #define REGISTER_WRITE_CONFIGURATION_INDEX 0x01 /* Configuration Option Register */
  90. #define REGISTER_WRITE_CARD_CONFIGURATION 0x02 /* Card Configuration and Status Register */
  91. #define REGISTER_WRITE_PIN_PLACEMENT 0x04 /* Pin Placement Register */
  92. #define REGISTER_WRITE_COPY_REGISTER 0x08 /* Socket and Copy Register */
  93. #define REGISTER_WRITE_EXTENDED_STATUS 0x10 /* Extended Status Register */
  94. #define REGISTER_WRITE_IO_BASE 0x20 /* I/O Base Register */
  95. #define REGISTER_WRITE_IO_LIMIT 0x40 /* I/O Limit Register */
  96. //
  97. // define a request memory window structure
  98. //
  99. typedef struct _CARD_REQUEST_MEM {
  100. struct _CARD_MEMORY_ENTRY {
  101. ULONG BaseAddress;
  102. ULONG HostAddress;
  103. ULONG WindowSize;
  104. UCHAR AttributeMemory;
  105. BOOLEAN WindowDataSize16;
  106. UCHAR WaitStates;
  107. } MemoryEntry[MAX_NUMBER_OF_MEMORY_RANGES];
  108. USHORT NumberOfRanges;
  109. USHORT Attributes;
  110. UCHAR AccessSpeed;
  111. }CARD_REQUEST_MEM, *PCARD_REQUEST_MEM;
  112. //
  113. // Defined attribute bits for request_mem
  114. //
  115. #define MEM_ATTRIBUTE 0x02
  116. #define MEM_ENABLED 0x04
  117. #define MEM_DATA_PATH_WIDTH_16 0x08
  118. #define MEM_PAGED 0x10
  119. #define MEM_SHARED 0x20
  120. #define MEM_FIRST_SHARED 0x40
  121. #define MEM_BIND_SPECIFIC 0x80
  122. #define MEM_CRD_OFFSET_SIZED 0x100
  123. #define MEM_SPEED_CODE 0x07
  124. #define MEM_SPEED_EXP 0x07
  125. #define MEM_SPEED_MANTISSA 0x78
  126. #define MEM_WAIT 0x80
  127. #define MEM_SPEED_250 0x02
  128. #define MEM_SPEED_200 0x04
  129. #define MEM_SPEED_150 0x08
  130. #define MEM_SPEED_100 0x10
  131. typedef struct _CARD_TUPLE_REQUEST {
  132. PVOID SocketPointer;
  133. PUCHAR Buffer;
  134. USHORT BufferSize;
  135. USHORT Socket;
  136. } CARD_TUPLE_REQUEST, *PCARD_TUPLE_REQUEST;
  137. //
  138. // Card configuration request packet.
  139. //
  140. typedef struct _CARD_REQUEST {
  141. USHORT RequestType;
  142. union {
  143. CARD_REQUEST_IRQ Irq;
  144. CARD_REQUEST_CONFIG Config;
  145. CARD_REQUEST_MEM Memory;
  146. CARD_REQUEST_IO Io;
  147. } u;
  148. } CARD_REQUEST, *PCARD_REQUEST;
  149. #endif //_PCMCIA_CARD_H_