1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
/*++
Copyright (c) 1994 Digital Equipment Corporation
Module Name:
ntddpcm.h
Abstract:
This is the include file that defines all constants and types for
accessing the PCMCIA Adapters.
Author:
Jeff McLeman
Revision History:
--*/
#ifndef _NTDDPCMH_
#define _NTDDPCMH_
//
// Device Name - this string is the name of the device. It is the name
// that should be passed to NtOpenFile when accessing the device.
//
// Note: For devices that support multiple units, it should be suffixed
// with the Ascii representation of the unit number.
//
#define IOCTL_PCMCIA_BASE FILE_DEVICE_CONTROLLER
#define DD_PCMCIA_DEVICE_NAME "\\\\.\\Pcmcia"
//
// IoControlCode values for this device.
//
// Warning: Remember that the low two bits of the code specify how the
// buffers are passed to the driver!
//
#define IOCTL_GET_TUPLE_DATA CTL_CODE(FILE_DEVICE_CONTROLLER, 3000, \
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_CONFIGURE_CARD CTL_CODE(FILE_DEVICE_CONTROLLER, 3001, \
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_CARD_EVENT CTL_CODE(FILE_DEVICE_CONTROLLER, 3002, \
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_CARD_REGISTERS CTL_CODE(FILE_DEVICE_CONTROLLER, 3003, \
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SOCKET_INFORMATION CTL_CODE(FILE_DEVICE_CONTROLLER, 3004, \
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PCMCIA_CONFIGURATION CTL_CODE(FILE_DEVICE_CONTROLLER, 3005, \
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_OPEN_ATTRIBUTE_WINDOW CTL_CODE(FILE_DEVICE_CONTROLLER, 3006, \
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_CLOSE_ATTRIBUTE_WINDOW CTL_CODE(FILE_DEVICE_CONTROLLER, 3007, \
METHOD_BUFFERED, FILE_ANY_ACCESS)
//
// Tuple request parameters.
//
#define PCMCIA_MAX_IO_PORT_WINDOWS 2
#define PCMCIA_MAX_MEMORY_WINDOWS 4
typedef struct _TUPLE_REQUEST {
USHORT Socket;
} TUPLE_REQUEST, *PTUPLE_REQUEST;
typedef struct _PCMCIA_CONFIG_REQUEST {
USHORT Socket;
UCHAR ConfigureIo;
UCHAR ConfigurationIndex;
//
// Query just returns the current socket configuration.
//
UCHAR Query;
//
// Power - zero means power off the socket (i.e. remove configuration)
//
UCHAR Power;
//
// IRQ support.
//
UCHAR DeviceIrq;
UCHAR CardReadyIrq;
//
// I/O port support.
//
ULONG NumberOfIoPortRanges;
USHORT IoPorts[PCMCIA_MAX_IO_PORT_WINDOWS];
USHORT IoPortLength[PCMCIA_MAX_IO_PORT_WINDOWS];
USHORT IoPort16[PCMCIA_MAX_IO_PORT_WINDOWS];
//
// Memory window support.
//
ULONG NumberOfMemoryRanges;
ULONG HostMemoryWindow[PCMCIA_MAX_MEMORY_WINDOWS];
ULONG PCCARDMemoryWindow[PCMCIA_MAX_MEMORY_WINDOWS];
ULONG MemoryWindowLength[PCMCIA_MAX_MEMORY_WINDOWS];
BOOLEAN AttributeMemory[PCMCIA_MAX_MEMORY_WINDOWS];
} PCMCIA_CONFIG_REQUEST, *PPCMCIA_CONFIG_REQUEST;
#define MANUFACTURER_NAME_LENGTH 64
#define DEVICE_IDENTIFIER_LENGTH 64
#define DRIVER_NAME_LENGTH 32
//
// Controller types returned in socket information structure.
//
#define PcmciaIntelCompatible 0
#define PcmciaElcController 1
#define PcmciaCirrusLogic 2
#define PcmciaDatabook 3
typedef struct _PCMCIA_SOCKET_INFORMATION {
USHORT Socket;
USHORT TupleCrc;
UCHAR Manufacturer[MANUFACTURER_NAME_LENGTH];
UCHAR Identifier[DEVICE_IDENTIFIER_LENGTH];
UCHAR DriverName[DRIVER_NAME_LENGTH];
UCHAR DeviceFunctionId;
UCHAR ControllerType;
UCHAR CardInSocket;
UCHAR CardEnabled;
} PCMCIA_SOCKET_INFORMATION, *PPCMCIA_SOCKET_INFORMATION;
//
// Structure returned to provide current configuration information
// for pcmcia driver.
//
typedef struct _PCMCIA_CONFIGURATION {
USHORT Sockets;
UCHAR Reserved;
UCHAR ControllerType;
USHORT IoPortBase;
USHORT IoPortSize;
ULONG MemoryWindowPhysicalAddress;
} PCMCIA_CONFIGURATION, *PPCMCIA_CONFIGURATION;
#endif
|