source: Daodan/MinGW/include/ddk/ntddpcm.h@ 1098

Last change on this file since 1098 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 4.4 KB
Line 
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
31extern "C" {
32#endif
33
34#include "ntddk.h"
35
36#define IOCTL_PCMCIA_BASE FILE_DEVICE_CONTROLLER
37
38#define DD_PCMCIA_DEVICE_NAME "\\\\.\\Pcmcia"
39#define DD_PCMCIA_DEVICE_NAME_U L"\\\\.\\Pcmcia"
40
41#define IOCTL_GET_TUPLE_DATA \
42 CTL_CODE(IOCTL_PCMCIA_BASE, 3000, METHOD_BUFFERED, FILE_ANY_ACCESS)
43
44#define IOCTL_SOCKET_INFORMATION \
45 CTL_CODE(IOCTL_PCMCIA_BASE, 3004, METHOD_BUFFERED, FILE_ANY_ACCESS)
46
47#define DEVICE_IDENTIFIER_LENGTH 64
48#define DRIVER_NAME_LENGTH 32
49#define MANUFACTURER_NAME_LENGTH 64
50
51#define PcmciaInvalidControllerType 0xffffffff
52
53typedef struct _TUPLE_REQUEST {
54 USHORT Socket;
55} TUPLE_REQUEST, *PTUPLE_REQUEST;
56
57typedef enum _PCMCIA_CONTROLLER_CLASS {
58 PcmciaInvalidControllerClass = -1,
59 PcmciaIntelCompatible,
60 PcmciaCardBusCompatible,
61 PcmciaElcController,
62 PcmciaDatabook,
63 PcmciaPciPcmciaBridge,
64 PcmciaCirrusLogic,
65 PcmciaTI,
66 PcmciaTopic,
67 PcmciaRicoh,
68 PcmciaDatabookCB,
69 PcmciaOpti,
70 PcmciaTrid,
71 PcmciaO2Micro,
72 PcmciaNEC,
73 PcmciaNEC_98
74} PCMCIA_CONTROLLER_CLASS, *PPCMCIA_CONTROLLER_CLASS;
75
76typedef struct _PCMCIA_SOCKET_INFORMATION {
77 USHORT Socket;
78 USHORT TupleCrc;
79 UCHAR Manufacturer[MANUFACTURER_NAME_LENGTH];
80 UCHAR Identifier[DEVICE_IDENTIFIER_LENGTH];
81 UCHAR DriverName[DRIVER_NAME_LENGTH];
82 UCHAR DeviceFunctionId;
83 UCHAR Reserved;
84 UCHAR CardInSocket;
85 UCHAR CardEnabled;
86 ULONG ControllerType;
87} PCMCIA_SOCKET_INFORMATION, *PPCMCIA_SOCKET_INFORMATION;
88
89#define PcmciaClassFromControllerType(type) ((PCMCIA_CONTROLLER_CLASS)((type) & 0xff))
90#define PcmciaModelFromControllerType(type) (((type) >> 8) & 0x3ffff)
91#define PcmciaRevisionFromControllerType(type) ((type) >> 26)
92
93
94DEFINE_GUID(GUID_PCMCIA_INTERFACE_STANDARD, \
95 0xbed5dadfL, 0x38fb, 0x11d1, 0x94, 0x62, 0x00, 0xc0, 0x4f, 0xb9, 0x60, 0xee);
96
97typedef ULONG MEMORY_SPACE;
98
99typedef ULONG STDCALL
100(*PPCMCIA_READ_WRITE_CONFIG)(
101 /*IN*/ PVOID Context,
102 /*IN*/ ULONG WhichSpace,
103 /*IN*/ PUCHAR Buffer,
104 /*IN*/ ULONG Offset,
105 /*IN*/ ULONG Length);
106
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
112
113typedef struct _PCMCIA_BUS_INTERFACE_STANDARD {
114 USHORT Size;
115 USHORT Version;
116 PVOID Context;
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;
122
123#define PCMCIA_MEMORY_8BIT_ACCESS 0
124#define PCMCIA_MEMORY_16BIT_ACCESS 1
125
126typedef 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*/);
136
137#define PCMCIA_VPP_0V 0
138#define PCMCIA_VPP_12V 1
139#define PCMCIA_VPP_IS_VCC 2
140
141typedef BOOLEAN STDCALL
142(*PPCMCIA_SET_VPP)(
143 /*IN*/ PVOID Context,
144 /*IN*/ UCHAR VppLevel);
145
146typedef BOOLEAN STDCALL
147(*PPCMCIA_IS_WRITE_PROTECTED)(
148 /*IN*/ PVOID Context);
149
150typedef struct _PCMCIA_INTERFACE_STANDARD {
151 USHORT Size;
152 USHORT Version;
153 PINTERFACE_REFERENCE InterfaceReference;
154 PINTERFACE_DEREFERENCE InterfaceDereference;
155 PVOID Context;
156 PPCMCIA_MODIFY_MEMORY_WINDOW ModifyMemoryWindow;
157 PPCMCIA_SET_VPP SetVpp;
158 PPCMCIA_IS_WRITE_PROTECTED IsWriteProtected;
159} PCMCIA_INTERFACE_STANDARD, *PPCMCIA_INTERFACE_STANDARD;
160
161#ifdef __cplusplus
162}
163#endif
164
165#endif /* __NTDDPCM_H */
Note: See TracBrowser for help on using the repository browser.