4 * PCMCIA IOCTL interface
6 * This file is part of the w32api package.
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
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.
27 #pragma GCC system_header
36 #define IOCTL_PCMCIA_BASE FILE_DEVICE_CONTROLLER
38 #define DD_PCMCIA_DEVICE_NAME "\\\\.\\Pcmcia"
39 #define DD_PCMCIA_DEVICE_NAME_U L"\\\\.\\Pcmcia"
41 #define IOCTL_GET_TUPLE_DATA \
42 CTL_CODE(IOCTL_PCMCIA_BASE, 3000, METHOD_BUFFERED, FILE_ANY_ACCESS)
44 #define IOCTL_SOCKET_INFORMATION \
45 CTL_CODE(IOCTL_PCMCIA_BASE, 3004, METHOD_BUFFERED, FILE_ANY_ACCESS)
47 #define DEVICE_IDENTIFIER_LENGTH 64
48 #define DRIVER_NAME_LENGTH 32
49 #define MANUFACTURER_NAME_LENGTH 64
51 #define PcmciaInvalidControllerType 0xffffffff
53 typedef struct _TUPLE_REQUEST
{
55 } TUPLE_REQUEST
, *PTUPLE_REQUEST
;
57 typedef enum _PCMCIA_CONTROLLER_CLASS
{
58 PcmciaInvalidControllerClass
= -1,
59 PcmciaIntelCompatible
,
60 PcmciaCardBusCompatible
,
63 PcmciaPciPcmciaBridge
,
74 } PCMCIA_CONTROLLER_CLASS
, *PPCMCIA_CONTROLLER_CLASS
;
76 typedef struct _PCMCIA_SOCKET_INFORMATION
{
79 UCHAR Manufacturer
[MANUFACTURER_NAME_LENGTH
];
80 UCHAR Identifier
[DEVICE_IDENTIFIER_LENGTH
];
81 UCHAR DriverName
[DRIVER_NAME_LENGTH
];
82 UCHAR DeviceFunctionId
;
87 } PCMCIA_SOCKET_INFORMATION
, *PPCMCIA_SOCKET_INFORMATION
;
89 #define PcmciaClassFromControllerType(type) ((PCMCIA_CONTROLLER_CLASS)((type) & 0xff))
90 #define PcmciaModelFromControllerType(type) (((type) >> 8) & 0x3ffff)
91 #define PcmciaRevisionFromControllerType(type) ((type) >> 26)
94 DEFINE_GUID(GUID_PCMCIA_INTERFACE_STANDARD
, \
95 0xbed5dadfL
, 0x38fb, 0x11d1, 0x94, 0x62, 0x00, 0xc0, 0x4f, 0xb9, 0x60, 0xee);
97 typedef ULONG MEMORY_SPACE
;
100 (*PPCMCIA_READ_WRITE_CONFIG
)(
101 /*IN*/ PVOID Context
,
102 /*IN*/ ULONG WhichSpace
,
103 /*IN*/ PUCHAR Buffer
,
105 /*IN*/ ULONG Length
);
107 #define PCCARD_PCI_CONFIGURATION_SPACE 0
108 #define PCCARD_ATTRIBUTE_MEMORY 1
109 #define PCCARD_COMMON_MEMORY 2
110 #define PCCARD_ATTRIBUTE_MEMORY_INDIRECT 3
111 #define PCCARD_COMMON_MEMORY_INDIRECT 4
113 typedef struct _PCMCIA_BUS_INTERFACE_STANDARD
{
117 PINTERFACE_REFERENCE InterfaceReference
;
118 PINTERFACE_DEREFERENCE InterfaceDereference
;
119 PPCMCIA_READ_WRITE_CONFIG ReadConfig
;
120 PPCMCIA_READ_WRITE_CONFIG WriteConfig
;
121 } PCMCIA_BUS_INTERFACE_STANDARD
, *PPCMCIA_BUS_INTERFACE_STANDARD
;
123 #define PCMCIA_MEMORY_8BIT_ACCESS 0
124 #define PCMCIA_MEMORY_16BIT_ACCESS 1
126 typedef BOOLEAN STDCALL
127 (*PPCMCIA_MODIFY_MEMORY_WINDOW
)(
128 /*IN*/ PVOID Context
,
129 /*IN*/ ULONGLONG HostBase
,
130 /*IN*/ ULONGLONG CardBase
,
131 /*IN*/ BOOLEAN Enable
,
132 /*IN*/ ULONG WindowSize
/*OPTIONAL*/,
133 /*IN*/ UCHAR AccessSpeed
/*OPTIONAL*/,
134 /*IN*/ UCHAR BusWidth
/*OPTIONAL*/,
135 /*IN*/ BOOLEAN IsAttributeMemory
/*OPTIONAL*/);
137 #define PCMCIA_VPP_0V 0
138 #define PCMCIA_VPP_12V 1
139 #define PCMCIA_VPP_IS_VCC 2
141 typedef BOOLEAN STDCALL
143 /*IN*/ PVOID Context
,
144 /*IN*/ UCHAR VppLevel
);
146 typedef BOOLEAN STDCALL
147 (*PPCMCIA_IS_WRITE_PROTECTED
)(
148 /*IN*/ PVOID Context
);
150 typedef struct _PCMCIA_INTERFACE_STANDARD
{
153 PINTERFACE_REFERENCE InterfaceReference
;
154 PINTERFACE_DEREFERENCE InterfaceDereference
;
156 PPCMCIA_MODIFY_MEMORY_WINDOW ModifyMemoryWindow
;
157 PPCMCIA_SET_VPP SetVpp
;
158 PPCMCIA_IS_WRITE_PROTECTED IsWriteProtected
;
159 } PCMCIA_INTERFACE_STANDARD
, *PPCMCIA_INTERFACE_STANDARD
;
165 #endif /* __NTDDPCM_H */