home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 186 / DPCS0803.ISO / Café / Dev-C++ / devcpp4980.exe / $INSTDIR / include / ddk / ntddpcm.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-05-15  |  4.4 KB  |  171 lines

  1. /*
  2.  * ntddpcm.h
  3.  *
  4.  * PCMCIA IOCTL interface
  5.  *
  6.  * This file is part of the w32api package.
  7.  *
  8.  * Contributors:
  9.  *   Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
  10.  *
  11.  * THIS SOFTWARE IS NOT COPYRIGHTED
  12.  *
  13.  * This source code is offered for use in the public domain. You may
  14.  * use, modify or distribute it freely.
  15.  *
  16.  * This code is distributed in the hope that it will be useful but
  17.  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  18.  * DISCLAIMED. This includes but is not limited to warranties of
  19.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20.  *
  21.  */
  22.  
  23. #ifndef __NTDDPCM_H
  24. #define __NTDDPCM_H
  25.  
  26. #if __GNUC__ >=3
  27. #pragma GCC system_header
  28. #endif
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. #pragma pack(push,4)
  35.  
  36. #include "ntddk.h"
  37.  
  38.  
  39. #define IOCTL_PCMCIA_BASE                 FILE_DEVICE_CONTROLLER
  40.  
  41. #define DD_PCMCIA_DEVICE_NAME             "\\\\.\\Pcmcia"
  42. #define DD_PCMCIA_DEVICE_NAME_U           L"\\\\.\\Pcmcia"
  43.  
  44. #define IOCTL_GET_TUPLE_DATA \
  45.   CTL_CODE(IOCTL_PCMCIA_BASE, 3000, METHOD_BUFFERED, FILE_ANY_ACCESS)
  46.  
  47. #define IOCTL_SOCKET_INFORMATION \
  48.   CTL_CODE(IOCTL_PCMCIA_BASE, 3004, METHOD_BUFFERED, FILE_ANY_ACCESS)
  49.  
  50. #define DEVICE_IDENTIFIER_LENGTH          64
  51. #define DRIVER_NAME_LENGTH                32
  52. #define MANUFACTURER_NAME_LENGTH          64
  53.  
  54. #define PcmciaInvalidControllerType       0xffffffff
  55.  
  56. typedef struct _TUPLE_REQUEST {
  57.  USHORT  Socket;
  58. } TUPLE_REQUEST, *PTUPLE_REQUEST;
  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.  
  79. typedef struct _PCMCIA_SOCKET_INFORMATION {
  80.     USHORT  Socket;
  81.     USHORT  TupleCrc;
  82.     UCHAR  Manufacturer[MANUFACTURER_NAME_LENGTH];
  83.     UCHAR  Identifier[DEVICE_IDENTIFIER_LENGTH];
  84.     UCHAR  DriverName[DRIVER_NAME_LENGTH];
  85.     UCHAR  DeviceFunctionId;
  86.     UCHAR  Reserved;
  87.     UCHAR  CardInSocket;
  88.     UCHAR  CardEnabled;
  89.     ULONG  ControllerType;
  90. } PCMCIA_SOCKET_INFORMATION, *PPCMCIA_SOCKET_INFORMATION;
  91.  
  92. #define PcmciaClassFromControllerType(type)     ((PCMCIA_CONTROLLER_CLASS)((type) & 0xff))
  93. #define PcmciaModelFromControllerType(type)     (((type) >> 8) & 0x3ffff)
  94. #define PcmciaRevisionFromControllerType(type)  ((type) >> 26)
  95.  
  96.  
  97. DEFINE_GUID(GUID_PCMCIA_INTERFACE_STANDARD, \
  98.   0xbed5dadfL, 0x38fb, 0x11d1, 0x94, 0x62, 0x00, 0xc0, 0x4f, 0xb9, 0x60, 0xee);
  99.  
  100. typedef ULONG MEMORY_SPACE;
  101.  
  102. typedef ULONG STDCALL
  103. (*PPCMCIA_READ_WRITE_CONFIG)(
  104.   IN PVOID  Context,
  105.   IN ULONG  WhichSpace,
  106.   IN PUCHAR  Buffer,
  107.   IN ULONG  Offset,
  108.   IN ULONG  Length);
  109.  
  110. #define PCCARD_PCI_CONFIGURATION_SPACE    0
  111. #define PCCARD_ATTRIBUTE_MEMORY           1
  112. #define PCCARD_COMMON_MEMORY              2
  113. #define PCCARD_ATTRIBUTE_MEMORY_INDIRECT  3
  114. #define PCCARD_COMMON_MEMORY_INDIRECT     4
  115.  
  116. typedef struct _PCMCIA_BUS_INTERFACE_STANDARD {
  117.     USHORT  Size;
  118.     USHORT  Version;
  119.     PVOID  Context;
  120.     PINTERFACE_REFERENCE  InterfaceReference;
  121.     PINTERFACE_DEREFERENCE  InterfaceDereference;
  122.     PPCMCIA_READ_WRITE_CONFIG ReadConfig; 
  123.     PPCMCIA_READ_WRITE_CONFIG  WriteConfig;
  124. } PCMCIA_BUS_INTERFACE_STANDARD, *PPCMCIA_BUS_INTERFACE_STANDARD;
  125.  
  126. #define PCMCIA_MEMORY_8BIT_ACCESS         0
  127. #define PCMCIA_MEMORY_16BIT_ACCESS        1
  128.  
  129. typedef BOOLEAN STDCALL
  130. (*PPCMCIA_MODIFY_MEMORY_WINDOW)(
  131.   IN PVOID  Context,
  132.   IN ULONGLONG  HostBase,
  133.   IN ULONGLONG  CardBase,
  134.   IN BOOLEAN  Enable,
  135.   IN ULONG  WindowSize  OPTIONAL,
  136.   IN UCHAR  AccessSpeed  OPTIONAL,
  137.   IN UCHAR  BusWidth  OPTIONAL,
  138.   IN BOOLEAN  IsAttributeMemory  OPTIONAL);
  139.  
  140. #define PCMCIA_VPP_0V                     0
  141. #define PCMCIA_VPP_12V                    1
  142. #define PCMCIA_VPP_IS_VCC                 2
  143.  
  144. typedef BOOLEAN STDCALL
  145. (*PPCMCIA_SET_VPP)(
  146.   IN PVOID  Context,
  147.   IN UCHAR  VppLevel);
  148.  
  149. typedef BOOLEAN STDCALL
  150. (*PPCMCIA_IS_WRITE_PROTECTED)(
  151.   IN PVOID  Context);
  152.  
  153. typedef struct _PCMCIA_INTERFACE_STANDARD {
  154.     USHORT  Size;
  155.     USHORT  Version;
  156.     PINTERFACE_REFERENCE  InterfaceReference;
  157.     PINTERFACE_DEREFERENCE  InterfaceDereference;
  158.     PVOID  Context;
  159.     PPCMCIA_MODIFY_MEMORY_WINDOW  ModifyMemoryWindow;
  160.     PPCMCIA_SET_VPP  SetVpp;
  161.     PPCMCIA_IS_WRITE_PROTECTED  IsWriteProtected;
  162. } PCMCIA_INTERFACE_STANDARD, *PPCMCIA_INTERFACE_STANDARD;
  163.  
  164. #pragma pack(pop)
  165.  
  166. #ifdef __cplusplus
  167. }
  168. #endif
  169.  
  170. #endif /* __NTDDPCM_H */
  171.