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.

233 lines
6.6 KiB

  1. /*++
  2. Copyright (c) 1994-1999 Microsoft Corporation
  3. Module Name:
  4. ntddpcm.h
  5. Abstract:
  6. This is the include file that defines all constants and types for
  7. accessing the PCMCIA Adapters.
  8. // @@BEGIN_DDKSPLIT
  9. Author:
  10. Jeff McLeman
  11. Revision History:
  12. Ravisankar Pudipeddi (ravisp) 1-Jan-1997
  13. // @@END_DDKSPLIT
  14. --*/
  15. #ifndef _NTDDPCMH_
  16. #define _NTDDPCMH_
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. //
  24. // Device Name - this string is the name of the device. It is the name
  25. // that should be passed to NtOpenFile when accessing the device.
  26. //
  27. // Note: For devices that support multiple units, it should be suffixed
  28. // with the Ascii representation of the unit number.
  29. //
  30. // Note: The IOCTL interface to pcmcia host controllers is turned off by
  31. // default. These IOCTLs are provided for testing purposes only. To
  32. // turn on this interface, add the following registry value:
  33. // HKLM\SYSTEM\CurrentControlSet\Services\Pcmcia\Parameters\IoctlInterface : REG_DWORD : 1
  34. //
  35. #define IOCTL_PCMCIA_BASE FILE_DEVICE_CONTROLLER
  36. #define DD_PCMCIA_DEVICE_NAME "\\\\.\\Pcmcia"
  37. //
  38. // IoControlCode values for this device.
  39. //
  40. #define IOCTL_GET_TUPLE_DATA CTL_CODE(IOCTL_PCMCIA_BASE, 3000, METHOD_BUFFERED, FILE_ANY_ACCESS)
  41. #define IOCTL_SOCKET_INFORMATION CTL_CODE(IOCTL_PCMCIA_BASE, 3004, METHOD_BUFFERED, FILE_ANY_ACCESS)
  42. #define IOCTL_PCMCIA_HIDE_DEVICE CTL_CODE(IOCTL_PCMCIA_BASE, 3010, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  43. #define IOCTL_PCMCIA_REVEAL_DEVICE CTL_CODE(IOCTL_PCMCIA_BASE, 3011, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  44. //
  45. // Tuple request parameters.
  46. //
  47. typedef struct _PCMCIA_SOCKET_REQUEST {
  48. USHORT Socket;
  49. } PCMCIA_SOCKET_REQUEST, *PPCMCIA_SOCKET_REQUEST;
  50. typedef struct _TUPLE_REQUEST {
  51. USHORT Socket;
  52. } TUPLE_REQUEST, *PTUPLE_REQUEST;
  53. #define MANUFACTURER_NAME_LENGTH 64
  54. #define DEVICE_IDENTIFIER_LENGTH 64
  55. #define DRIVER_NAME_LENGTH 32
  56. #define PcmciaInvalidControllerType 0xffffffff
  57. //
  58. // Controller classes returned in socket information structure.
  59. //
  60. typedef enum _PCMCIA_CONTROLLER_CLASS {
  61. PcmciaInvalidControllerClass = -1,
  62. PcmciaIntelCompatible,
  63. PcmciaCardBusCompatible,
  64. PcmciaElcController,
  65. PcmciaDatabook,
  66. PcmciaPciPcmciaBridge,
  67. PcmciaCirrusLogic,
  68. PcmciaTI,
  69. PcmciaTopic,
  70. PcmciaRicoh,
  71. PcmciaDatabookCB,
  72. PcmciaOpti,
  73. PcmciaTrid,
  74. PcmciaO2Micro,
  75. PcmciaNEC,
  76. PcmciaNEC_98
  77. } PCMCIA_CONTROLLER_CLASS, *PPCMCIA_CONTROLLER_CLASS;
  78. typedef struct _PCMCIA_SOCKET_INFORMATION {
  79. USHORT Socket;
  80. USHORT TupleCrc;
  81. UCHAR Manufacturer[MANUFACTURER_NAME_LENGTH];
  82. UCHAR Identifier[DEVICE_IDENTIFIER_LENGTH];
  83. UCHAR DriverName[DRIVER_NAME_LENGTH];
  84. UCHAR DeviceFunctionId;
  85. UCHAR Reserved;
  86. UCHAR CardInSocket;
  87. UCHAR CardEnabled;
  88. ULONG ControllerType;
  89. } PCMCIA_SOCKET_INFORMATION, *PPCMCIA_SOCKET_INFORMATION;
  90. //
  91. // macros to crack the ControllerId field of the socket info structure
  92. //
  93. #define PcmciaClassFromControllerType(type) ((PCMCIA_CONTROLLER_CLASS)((type) & 0xff))
  94. #define PcmciaModelFromControllerType(type) (((type) >> 8) & 0x3ffff)
  95. #define PcmciaRevisionFromControllerType(type) ((type) >> 26)
  96. //
  97. // Begin pcmcia exported interfaces to other drivers
  98. //
  99. #ifdef _NTDDK_
  100. DEFINE_GUID( GUID_PCMCIA_INTERFACE_STANDARD, 0xbed5dadfL, 0x38fb, 0x11d1, 0x94, 0x62, 0x00, 0xc0, 0x4f, 0xb9, 0x60, 0xee);
  101. #define PCMCIA_MEMORY_8BIT_ACCESS 0
  102. #define PCMCIA_MEMORY_16BIT_ACCESS 1
  103. typedef
  104. BOOLEAN
  105. (*PPCMCIA_MODIFY_MEMORY_WINDOW)(
  106. IN PVOID Context,
  107. IN ULONGLONG HostBase,
  108. IN ULONGLONG CardBase,
  109. IN BOOLEAN Enable,
  110. IN ULONG WindowSize OPTIONAL,
  111. IN UCHAR AccessSpeed OPTIONAL,
  112. IN UCHAR BusWidth OPTIONAL,
  113. IN BOOLEAN IsAttributeMemory OPTIONAL
  114. );
  115. #define PCMCIA_VPP_0V 0
  116. #define PCMCIA_VPP_12V 1
  117. #define PCMCIA_VPP_IS_VCC 2
  118. typedef
  119. BOOLEAN
  120. (*PPCMCIA_SET_VPP)(
  121. IN PVOID Context,
  122. IN UCHAR VppLevel
  123. );
  124. typedef
  125. BOOLEAN
  126. (*PPCMCIA_IS_WRITE_PROTECTED)(
  127. IN PVOID Context
  128. );
  129. //
  130. // These are interfaces for manipulating memory windows, setting Vpp etc.,
  131. // primarily used by flash memory card drivers
  132. //
  133. typedef struct _PCMCIA_INTERFACE_STANDARD {
  134. USHORT Size;
  135. USHORT Version;
  136. PINTERFACE_REFERENCE InterfaceReference;
  137. PINTERFACE_DEREFERENCE InterfaceDereference;
  138. PVOID Context;
  139. PPCMCIA_MODIFY_MEMORY_WINDOW ModifyMemoryWindow;
  140. PPCMCIA_SET_VPP SetVpp;
  141. PPCMCIA_IS_WRITE_PROTECTED IsWriteProtected;
  142. } PCMCIA_INTERFACE_STANDARD, *PPCMCIA_INTERFACE_STANDARD;
  143. //
  144. // Definitions for PCMCIA_BUS_INTERFACE_STANDARD.
  145. // This interface is obtained using GUID_PCMCIA_BUS_INTERFACE_STANDARD
  146. // and is used for reading/writing to PCMCIA config. space
  147. //
  148. typedef
  149. ULONG
  150. (*PPCMCIA_READ_WRITE_CONFIG) (
  151. IN PVOID Context,
  152. IN ULONG WhichSpace,
  153. IN PUCHAR Buffer,
  154. IN ULONG Offset,
  155. IN ULONG Length
  156. );
  157. //
  158. // WhichSpace for IRP_MN_READ_CONFIG/WRITE_CONFIG
  159. // and PCMCIA_BUS_INTERFACE_STANDARD
  160. //
  161. typedef ULONG MEMORY_SPACE;
  162. #define PCCARD_PCI_CONFIGURATION_SPACE 0 // for cardbus cards
  163. #define PCCARD_ATTRIBUTE_MEMORY 1
  164. #define PCCARD_COMMON_MEMORY 2
  165. #define PCCARD_ATTRIBUTE_MEMORY_INDIRECT 3
  166. #define PCCARD_COMMON_MEMORY_INDIRECT 4
  167. // Legacy support
  168. //
  169. #define PCMCIA_CONFIG_SPACE PCCARD_ATTRIBUTE_MEMORY
  170. typedef struct _PCMCIA_BUS_INTERFACE_STANDARD {
  171. //
  172. // generic interface header
  173. //
  174. USHORT Size;
  175. USHORT Version;
  176. PVOID Context;
  177. PINTERFACE_REFERENCE InterfaceReference;
  178. PINTERFACE_DEREFERENCE InterfaceDereference;
  179. //
  180. // standard PCMCIA bus interfaces
  181. //
  182. PPCMCIA_READ_WRITE_CONFIG ReadConfig;
  183. PPCMCIA_READ_WRITE_CONFIG WriteConfig;
  184. } PCMCIA_BUS_INTERFACE_STANDARD, *PPCMCIA_BUS_INTERFACE_STANDARD;
  185. #endif
  186. #ifdef __cplusplus
  187. }
  188. #endif
  189. #endif