aboutsummaryrefslogtreecommitdiffstats
path: root/include/pcmcia
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/pcmcia
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/pcmcia')
-rw-r--r--include/pcmcia/bulkmem.h41
-rw-r--r--include/pcmcia/ciscode.h123
-rw-r--r--include/pcmcia/cisreg.h120
-rw-r--r--include/pcmcia/cistpl.h605
-rw-r--r--include/pcmcia/cs.h427
-rw-r--r--include/pcmcia/cs_types.h52
-rw-r--r--include/pcmcia/ds.h200
-rw-r--r--include/pcmcia/mem_op.h116
-rw-r--r--include/pcmcia/ss.h265
-rw-r--r--include/pcmcia/version.h4
10 files changed, 1953 insertions, 0 deletions
diff --git a/include/pcmcia/bulkmem.h b/include/pcmcia/bulkmem.h
new file mode 100644
index 000000000000..b53b78d497ba
--- /dev/null
+++ b/include/pcmcia/bulkmem.h
@@ -0,0 +1,41 @@
1/*
2 * bulkmem.h -- Definitions for bulk memory services
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds
9 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 *
12 * (C) 1999 David A. Hinds
13 */
14
15#ifndef _LINUX_BULKMEM_H
16#define _LINUX_BULKMEM_H
17
18/* For GetFirstRegion and GetNextRegion */
19typedef struct region_info_t {
20 u_int Attributes;
21 u_int CardOffset;
22 u_int RegionSize;
23 u_int AccessSpeed;
24 u_int BlockSize;
25 u_int PartMultiple;
26 u_char JedecMfr, JedecInfo;
27 memory_handle_t next;
28} region_info_t;
29
30#define REGION_TYPE 0x0001
31#define REGION_TYPE_CM 0x0000
32#define REGION_TYPE_AM 0x0001
33#define REGION_PREFETCH 0x0008
34#define REGION_CACHEABLE 0x0010
35#define REGION_BAR_MASK 0xe000
36#define REGION_BAR_SHIFT 13
37
38int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn);
39int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn);
40
41#endif /* _LINUX_BULKMEM_H */
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h
new file mode 100644
index 000000000000..2000b43ece91
--- /dev/null
+++ b/include/pcmcia/ciscode.h
@@ -0,0 +1,123 @@
1/*
2 * ciscode.h -- Definitions for bulk memory services
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds
9 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 *
12 * (C) 1999 David A. Hinds
13 */
14
15#ifndef _LINUX_CISCODE_H
16#define _LINUX_CISCODE_H
17
18/* Manufacturer and Product ID codes */
19
20#define MANFID_3COM 0x0101
21#define PRODID_3COM_3CXEM556 0x0035
22#define PRODID_3COM_3CCFEM556 0x0556
23#define PRODID_3COM_3C562 0x0562
24
25#define MANFID_ACCTON 0x01bf
26#define PRODID_ACCTON_EN2226 0x010a
27
28#define MANFID_ADAPTEC 0x012f
29#define PRODID_ADAPTEC_SCSI 0x0001
30
31#define MANFID_ATT 0xffff
32#define PRODID_ATT_KIT 0x0100
33
34#define MANFID_CONTEC 0xc001
35
36#define MANFID_FUJITSU 0x0004
37#define PRODID_FUJITSU_MBH10302 0x0004
38#define PRODID_FUJITSU_MBH10304 0x1003
39#define PRODID_FUJITSU_LA501 0x2000
40
41#define MANFID_IBM 0x00a4
42#define PRODID_IBM_HOME_AND_AWAY 0x002e
43
44#define MANFID_INTEL 0x0089
45#define PRODID_INTEL_DUAL_RS232 0x0301
46#define PRODID_INTEL_2PLUS 0x8422
47
48#define MANFID_KME 0x0032
49#define PRODID_KME_KXLC005_A 0x0704
50#define PRODID_KME_KXLC005_B 0x2904
51
52#define MANFID_LINKSYS 0x0143
53#define PRODID_LINKSYS_PCMLM28 0xc0ab
54#define PRODID_LINKSYS_3400 0x3341
55
56#define MANFID_MEGAHERTZ 0x0102
57#define PRODID_MEGAHERTZ_VARIOUS 0x0000
58#define PRODID_MEGAHERTZ_EM3288 0x0006
59
60#define MANFID_MACNICA 0xc00b
61
62#define MANFID_MOTOROLA 0x0109
63#define PRODID_MOTOROLA_MARINER 0x0501
64
65#define MANFID_NATINST 0x010b
66#define PRODID_NATINST_QUAD_RS232 0xd180
67
68#define MANFID_NEW_MEDIA 0x0057
69
70#define MANFID_NOKIA 0x0124
71#define PRODID_NOKIA_CARDPHONE 0x0900
72
73#define MANFID_OLICOM 0x0121
74#define PRODID_OLICOM_OC2231 0x3122
75#define PRODID_OLICOM_OC2232 0x3222
76
77#define MANFID_OMEGA 0x0137
78#define PRODID_OMEGA_QSP_100 0x0025
79
80#define MANFID_OSITECH 0x0140
81#define PRODID_OSITECH_JACK_144 0x0001
82#define PRODID_OSITECH_JACK_288 0x0002
83#define PRODID_OSITECH_JACK_336 0x0007
84#define PRODID_OSITECH_SEVEN 0x0008
85
86#define MANFID_OXSEMI 0x0279
87
88#define MANFID_PIONEER 0x000b
89
90#define MANFID_PSION 0x016c
91#define PRODID_PSION_NET100 0x0023
92
93#define MANFID_QUATECH 0x0137
94#define PRODID_QUATECH_SPP100 0x0003
95#define PRODID_QUATECH_DUAL_RS232 0x0012
96#define PRODID_QUATECH_DUAL_RS232_D1 0x0007
97#define PRODID_QUATECH_DUAL_RS232_D2 0x0052
98#define PRODID_QUATECH_QUAD_RS232 0x001b
99#define PRODID_QUATECH_DUAL_RS422 0x000e
100#define PRODID_QUATECH_QUAD_RS422 0x0045
101
102#define MANFID_SMC 0x0108
103#define PRODID_SMC_ETHER 0x0105
104
105#define MANFID_SOCKET 0x0104
106#define PRODID_SOCKET_DUAL_RS232 0x0006
107#define PRODID_SOCKET_EIO 0x000a
108#define PRODID_SOCKET_LPE 0x000d
109#define PRODID_SOCKET_LPE_CF 0x0075
110
111#define MANFID_SUNDISK 0x0045
112
113#define MANFID_TDK 0x0105
114#define PRODID_TDK_CF010 0x0900
115#define PRODID_TDK_GN3410 0x4815
116
117#define MANFID_TOSHIBA 0x0098
118
119#define MANFID_UNGERMANN 0x02c0
120
121#define MANFID_XIRCOM 0x0105
122
123#endif /* _LINUX_CISCODE_H */
diff --git a/include/pcmcia/cisreg.h b/include/pcmcia/cisreg.h
new file mode 100644
index 000000000000..ddaad465502e
--- /dev/null
+++ b/include/pcmcia/cisreg.h
@@ -0,0 +1,120 @@
1/*
2 * cisreg.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds
9 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 *
12 * (C) 1999 David A. Hinds
13 */
14
15#ifndef _LINUX_CISREG_H
16#define _LINUX_CISREG_H
17
18/*
19 * Offsets from ConfigBase for CIS registers
20 */
21#define CISREG_COR 0x00
22#define CISREG_CCSR 0x02
23#define CISREG_PRR 0x04
24#define CISREG_SCR 0x06
25#define CISREG_ESR 0x08
26#define CISREG_IOBASE_0 0x0a
27#define CISREG_IOBASE_1 0x0c
28#define CISREG_IOBASE_2 0x0e
29#define CISREG_IOBASE_3 0x10
30#define CISREG_IOSIZE 0x12
31
32/*
33 * Configuration Option Register
34 */
35#define COR_CONFIG_MASK 0x3f
36#define COR_MFC_CONFIG_MASK 0x38
37#define COR_FUNC_ENA 0x01
38#define COR_ADDR_DECODE 0x02
39#define COR_IREQ_ENA 0x04
40#define COR_LEVEL_REQ 0x40
41#define COR_SOFT_RESET 0x80
42
43/*
44 * Card Configuration and Status Register
45 */
46#define CCSR_INTR_ACK 0x01
47#define CCSR_INTR_PENDING 0x02
48#define CCSR_POWER_DOWN 0x04
49#define CCSR_AUDIO_ENA 0x08
50#define CCSR_IOIS8 0x20
51#define CCSR_SIGCHG_ENA 0x40
52#define CCSR_CHANGED 0x80
53
54/*
55 * Pin Replacement Register
56 */
57#define PRR_WP_STATUS 0x01
58#define PRR_READY_STATUS 0x02
59#define PRR_BVD2_STATUS 0x04
60#define PRR_BVD1_STATUS 0x08
61#define PRR_WP_EVENT 0x10
62#define PRR_READY_EVENT 0x20
63#define PRR_BVD2_EVENT 0x40
64#define PRR_BVD1_EVENT 0x80
65
66/*
67 * Socket and Copy Register
68 */
69#define SCR_SOCKET_NUM 0x0f
70#define SCR_COPY_NUM 0x70
71
72/*
73 * Extended Status Register
74 */
75#define ESR_REQ_ATTN_ENA 0x01
76#define ESR_REQ_ATTN 0x10
77
78/*
79 * CardBus Function Status Registers
80 */
81#define CBFN_EVENT 0x00
82#define CBFN_MASK 0x04
83#define CBFN_STATE 0x08
84#define CBFN_FORCE 0x0c
85
86/*
87 * These apply to all the CardBus function registers
88 */
89#define CBFN_WP 0x0001
90#define CBFN_READY 0x0002
91#define CBFN_BVD2 0x0004
92#define CBFN_BVD1 0x0008
93#define CBFN_GWAKE 0x0010
94#define CBFN_INTR 0x8000
95
96/*
97 * Extra bits in the Function Event Mask Register
98 */
99#define FEMR_BAM_ENA 0x0020
100#define FEMR_PWM_ENA 0x0040
101#define FEMR_WKUP_MASK 0x4000
102
103/*
104 * Indirect Addressing Registers for Zoomed Video: these are addresses
105 * in common memory space
106 */
107#define CISREG_ICTRL0 0x02 /* control registers */
108#define CISREG_ICTRL1 0x03
109#define CISREG_IADDR0 0x04 /* address registers */
110#define CISREG_IADDR1 0x05
111#define CISREG_IADDR2 0x06
112#define CISREG_IADDR3 0x07
113#define CISREG_IDATA0 0x08 /* data registers */
114#define CISREG_IDATA1 0x09
115
116#define ICTRL0_COMMON 0x01
117#define ICTRL0_AUTOINC 0x02
118#define ICTRL0_BYTEGRAN 0x04
119
120#endif /* _LINUX_CISREG_H */
diff --git a/include/pcmcia/cistpl.h b/include/pcmcia/cistpl.h
new file mode 100644
index 000000000000..c6a069554fd7
--- /dev/null
+++ b/include/pcmcia/cistpl.h
@@ -0,0 +1,605 @@
1/*
2 * cistpl.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds
9 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 *
12 * (C) 1999 David A. Hinds
13 */
14
15#ifndef _LINUX_CISTPL_H
16#define _LINUX_CISTPL_H
17
18#define CISTPL_NULL 0x00
19#define CISTPL_DEVICE 0x01
20#define CISTPL_LONGLINK_CB 0x02
21#define CISTPL_INDIRECT 0x03
22#define CISTPL_CONFIG_CB 0x04
23#define CISTPL_CFTABLE_ENTRY_CB 0x05
24#define CISTPL_LONGLINK_MFC 0x06
25#define CISTPL_BAR 0x07
26#define CISTPL_PWR_MGMNT 0x08
27#define CISTPL_EXTDEVICE 0x09
28#define CISTPL_CHECKSUM 0x10
29#define CISTPL_LONGLINK_A 0x11
30#define CISTPL_LONGLINK_C 0x12
31#define CISTPL_LINKTARGET 0x13
32#define CISTPL_NO_LINK 0x14
33#define CISTPL_VERS_1 0x15
34#define CISTPL_ALTSTR 0x16
35#define CISTPL_DEVICE_A 0x17
36#define CISTPL_JEDEC_C 0x18
37#define CISTPL_JEDEC_A 0x19
38#define CISTPL_CONFIG 0x1a
39#define CISTPL_CFTABLE_ENTRY 0x1b
40#define CISTPL_DEVICE_OC 0x1c
41#define CISTPL_DEVICE_OA 0x1d
42#define CISTPL_DEVICE_GEO 0x1e
43#define CISTPL_DEVICE_GEO_A 0x1f
44#define CISTPL_MANFID 0x20
45#define CISTPL_FUNCID 0x21
46#define CISTPL_FUNCE 0x22
47#define CISTPL_SWIL 0x23
48#define CISTPL_END 0xff
49/* Layer 2 tuples */
50#define CISTPL_VERS_2 0x40
51#define CISTPL_FORMAT 0x41
52#define CISTPL_GEOMETRY 0x42
53#define CISTPL_BYTEORDER 0x43
54#define CISTPL_DATE 0x44
55#define CISTPL_BATTERY 0x45
56#define CISTPL_FORMAT_A 0x47
57/* Layer 3 tuples */
58#define CISTPL_ORG 0x46
59#define CISTPL_SPCL 0x90
60
61typedef struct cistpl_longlink_t {
62 u_int addr;
63} cistpl_longlink_t;
64
65typedef struct cistpl_checksum_t {
66 u_short addr;
67 u_short len;
68 u_char sum;
69} cistpl_checksum_t;
70
71#define CISTPL_MAX_FUNCTIONS 8
72#define CISTPL_MFC_ATTR 0x00
73#define CISTPL_MFC_COMMON 0x01
74
75typedef struct cistpl_longlink_mfc_t {
76 u_char nfn;
77 struct {
78 u_char space;
79 u_int addr;
80 } fn[CISTPL_MAX_FUNCTIONS];
81} cistpl_longlink_mfc_t;
82
83#define CISTPL_MAX_ALTSTR_STRINGS 4
84
85typedef struct cistpl_altstr_t {
86 u_char ns;
87 u_char ofs[CISTPL_MAX_ALTSTR_STRINGS];
88 char str[254];
89} cistpl_altstr_t;
90
91#define CISTPL_DTYPE_NULL 0x00
92#define CISTPL_DTYPE_ROM 0x01
93#define CISTPL_DTYPE_OTPROM 0x02
94#define CISTPL_DTYPE_EPROM 0x03
95#define CISTPL_DTYPE_EEPROM 0x04
96#define CISTPL_DTYPE_FLASH 0x05
97#define CISTPL_DTYPE_SRAM 0x06
98#define CISTPL_DTYPE_DRAM 0x07
99#define CISTPL_DTYPE_FUNCSPEC 0x0d
100#define CISTPL_DTYPE_EXTEND 0x0e
101
102#define CISTPL_MAX_DEVICES 4
103
104typedef struct cistpl_device_t {
105 u_char ndev;
106 struct {
107 u_char type;
108 u_char wp;
109 u_int speed;
110 u_int size;
111 } dev[CISTPL_MAX_DEVICES];
112} cistpl_device_t;
113
114#define CISTPL_DEVICE_MWAIT 0x01
115#define CISTPL_DEVICE_3VCC 0x02
116
117typedef struct cistpl_device_o_t {
118 u_char flags;
119 cistpl_device_t device;
120} cistpl_device_o_t;
121
122#define CISTPL_VERS_1_MAX_PROD_STRINGS 4
123
124typedef struct cistpl_vers_1_t {
125 u_char major;
126 u_char minor;
127 u_char ns;
128 u_char ofs[CISTPL_VERS_1_MAX_PROD_STRINGS];
129 char str[254];
130} cistpl_vers_1_t;
131
132typedef struct cistpl_jedec_t {
133 u_char nid;
134 struct {
135 u_char mfr;
136 u_char info;
137 } id[CISTPL_MAX_DEVICES];
138} cistpl_jedec_t;
139
140typedef struct cistpl_manfid_t {
141 u_short manf;
142 u_short card;
143} cistpl_manfid_t;
144
145#define CISTPL_FUNCID_MULTI 0x00
146#define CISTPL_FUNCID_MEMORY 0x01
147#define CISTPL_FUNCID_SERIAL 0x02
148#define CISTPL_FUNCID_PARALLEL 0x03
149#define CISTPL_FUNCID_FIXED 0x04
150#define CISTPL_FUNCID_VIDEO 0x05
151#define CISTPL_FUNCID_NETWORK 0x06
152#define CISTPL_FUNCID_AIMS 0x07
153#define CISTPL_FUNCID_SCSI 0x08
154
155#define CISTPL_SYSINIT_POST 0x01
156#define CISTPL_SYSINIT_ROM 0x02
157
158typedef struct cistpl_funcid_t {
159 u_char func;
160 u_char sysinit;
161} cistpl_funcid_t;
162
163typedef struct cistpl_funce_t {
164 u_char type;
165 u_char data[0];
166} cistpl_funce_t;
167
168/*======================================================================
169
170 Modem Function Extension Tuples
171
172======================================================================*/
173
174#define CISTPL_FUNCE_SERIAL_IF 0x00
175#define CISTPL_FUNCE_SERIAL_CAP 0x01
176#define CISTPL_FUNCE_SERIAL_SERV_DATA 0x02
177#define CISTPL_FUNCE_SERIAL_SERV_FAX 0x03
178#define CISTPL_FUNCE_SERIAL_SERV_VOICE 0x04
179#define CISTPL_FUNCE_SERIAL_CAP_DATA 0x05
180#define CISTPL_FUNCE_SERIAL_CAP_FAX 0x06
181#define CISTPL_FUNCE_SERIAL_CAP_VOICE 0x07
182#define CISTPL_FUNCE_SERIAL_IF_DATA 0x08
183#define CISTPL_FUNCE_SERIAL_IF_FAX 0x09
184#define CISTPL_FUNCE_SERIAL_IF_VOICE 0x0a
185
186/* UART identification */
187#define CISTPL_SERIAL_UART_8250 0x00
188#define CISTPL_SERIAL_UART_16450 0x01
189#define CISTPL_SERIAL_UART_16550 0x02
190#define CISTPL_SERIAL_UART_8251 0x03
191#define CISTPL_SERIAL_UART_8530 0x04
192#define CISTPL_SERIAL_UART_85230 0x05
193
194/* UART capabilities */
195#define CISTPL_SERIAL_UART_SPACE 0x01
196#define CISTPL_SERIAL_UART_MARK 0x02
197#define CISTPL_SERIAL_UART_ODD 0x04
198#define CISTPL_SERIAL_UART_EVEN 0x08
199#define CISTPL_SERIAL_UART_5BIT 0x01
200#define CISTPL_SERIAL_UART_6BIT 0x02
201#define CISTPL_SERIAL_UART_7BIT 0x04
202#define CISTPL_SERIAL_UART_8BIT 0x08
203#define CISTPL_SERIAL_UART_1STOP 0x10
204#define CISTPL_SERIAL_UART_MSTOP 0x20
205#define CISTPL_SERIAL_UART_2STOP 0x40
206
207typedef struct cistpl_serial_t {
208 u_char uart_type;
209 u_char uart_cap_0;
210 u_char uart_cap_1;
211} cistpl_serial_t;
212
213typedef struct cistpl_modem_cap_t {
214 u_char flow;
215 u_char cmd_buf;
216 u_char rcv_buf_0, rcv_buf_1, rcv_buf_2;
217 u_char xmit_buf_0, xmit_buf_1, xmit_buf_2;
218} cistpl_modem_cap_t;
219
220#define CISTPL_SERIAL_MOD_103 0x01
221#define CISTPL_SERIAL_MOD_V21 0x02
222#define CISTPL_SERIAL_MOD_V23 0x04
223#define CISTPL_SERIAL_MOD_V22 0x08
224#define CISTPL_SERIAL_MOD_212A 0x10
225#define CISTPL_SERIAL_MOD_V22BIS 0x20
226#define CISTPL_SERIAL_MOD_V26 0x40
227#define CISTPL_SERIAL_MOD_V26BIS 0x80
228#define CISTPL_SERIAL_MOD_V27BIS 0x01
229#define CISTPL_SERIAL_MOD_V29 0x02
230#define CISTPL_SERIAL_MOD_V32 0x04
231#define CISTPL_SERIAL_MOD_V32BIS 0x08
232#define CISTPL_SERIAL_MOD_V34 0x10
233
234#define CISTPL_SERIAL_ERR_MNP2_4 0x01
235#define CISTPL_SERIAL_ERR_V42_LAPM 0x02
236
237#define CISTPL_SERIAL_CMPR_V42BIS 0x01
238#define CISTPL_SERIAL_CMPR_MNP5 0x02
239
240#define CISTPL_SERIAL_CMD_AT1 0x01
241#define CISTPL_SERIAL_CMD_AT2 0x02
242#define CISTPL_SERIAL_CMD_AT3 0x04
243#define CISTPL_SERIAL_CMD_MNP_AT 0x08
244#define CISTPL_SERIAL_CMD_V25BIS 0x10
245#define CISTPL_SERIAL_CMD_V25A 0x20
246#define CISTPL_SERIAL_CMD_DMCL 0x40
247
248typedef struct cistpl_data_serv_t {
249 u_char max_data_0;
250 u_char max_data_1;
251 u_char modulation_0;
252 u_char modulation_1;
253 u_char error_control;
254 u_char compression;
255 u_char cmd_protocol;
256 u_char escape;
257 u_char encrypt;
258 u_char misc_features;
259 u_char ccitt_code[0];
260} cistpl_data_serv_t;
261
262typedef struct cistpl_fax_serv_t {
263 u_char max_data_0;
264 u_char max_data_1;
265 u_char modulation;
266 u_char encrypt;
267 u_char features_0;
268 u_char features_1;
269 u_char ccitt_code[0];
270} cistpl_fax_serv_t;
271
272typedef struct cistpl_voice_serv_t {
273 u_char max_data_0;
274 u_char max_data_1;
275} cistpl_voice_serv_t;
276
277/*======================================================================
278
279 LAN Function Extension Tuples
280
281======================================================================*/
282
283#define CISTPL_FUNCE_LAN_TECH 0x01
284#define CISTPL_FUNCE_LAN_SPEED 0x02
285#define CISTPL_FUNCE_LAN_MEDIA 0x03
286#define CISTPL_FUNCE_LAN_NODE_ID 0x04
287#define CISTPL_FUNCE_LAN_CONNECTOR 0x05
288
289/* LAN technologies */
290#define CISTPL_LAN_TECH_ARCNET 0x01
291#define CISTPL_LAN_TECH_ETHERNET 0x02
292#define CISTPL_LAN_TECH_TOKENRING 0x03
293#define CISTPL_LAN_TECH_LOCALTALK 0x04
294#define CISTPL_LAN_TECH_FDDI 0x05
295#define CISTPL_LAN_TECH_ATM 0x06
296#define CISTPL_LAN_TECH_WIRELESS 0x07
297
298typedef struct cistpl_lan_tech_t {
299 u_char tech;
300} cistpl_lan_tech_t;
301
302typedef struct cistpl_lan_speed_t {
303 u_int speed;
304} cistpl_lan_speed_t;
305
306/* LAN media definitions */
307#define CISTPL_LAN_MEDIA_UTP 0x01
308#define CISTPL_LAN_MEDIA_STP 0x02
309#define CISTPL_LAN_MEDIA_THIN_COAX 0x03
310#define CISTPL_LAN_MEDIA_THICK_COAX 0x04
311#define CISTPL_LAN_MEDIA_FIBER 0x05
312#define CISTPL_LAN_MEDIA_900MHZ 0x06
313#define CISTPL_LAN_MEDIA_2GHZ 0x07
314#define CISTPL_LAN_MEDIA_5GHZ 0x08
315#define CISTPL_LAN_MEDIA_DIFF_IR 0x09
316#define CISTPL_LAN_MEDIA_PTP_IR 0x0a
317
318typedef struct cistpl_lan_media_t {
319 u_char media;
320} cistpl_lan_media_t;
321
322typedef struct cistpl_lan_node_id_t {
323 u_char nb;
324 u_char id[16];
325} cistpl_lan_node_id_t;
326
327typedef struct cistpl_lan_connector_t {
328 u_char code;
329} cistpl_lan_connector_t;
330
331/*======================================================================
332
333 IDE Function Extension Tuples
334
335======================================================================*/
336
337#define CISTPL_IDE_INTERFACE 0x01
338
339typedef struct cistpl_ide_interface_t {
340 u_char interface;
341} cistpl_ide_interface_t;
342
343/* First feature byte */
344#define CISTPL_IDE_SILICON 0x04
345#define CISTPL_IDE_UNIQUE 0x08
346#define CISTPL_IDE_DUAL 0x10
347
348/* Second feature byte */
349#define CISTPL_IDE_HAS_SLEEP 0x01
350#define CISTPL_IDE_HAS_STANDBY 0x02
351#define CISTPL_IDE_HAS_IDLE 0x04
352#define CISTPL_IDE_LOW_POWER 0x08
353#define CISTPL_IDE_REG_INHIBIT 0x10
354#define CISTPL_IDE_HAS_INDEX 0x20
355#define CISTPL_IDE_IOIS16 0x40
356
357typedef struct cistpl_ide_feature_t {
358 u_char feature1;
359 u_char feature2;
360} cistpl_ide_feature_t;
361
362#define CISTPL_FUNCE_IDE_IFACE 0x01
363#define CISTPL_FUNCE_IDE_MASTER 0x02
364#define CISTPL_FUNCE_IDE_SLAVE 0x03
365
366/*======================================================================
367
368 Configuration Table Entries
369
370======================================================================*/
371
372#define CISTPL_BAR_SPACE 0x07
373#define CISTPL_BAR_SPACE_IO 0x10
374#define CISTPL_BAR_PREFETCH 0x20
375#define CISTPL_BAR_CACHEABLE 0x40
376#define CISTPL_BAR_1MEG_MAP 0x80
377
378typedef struct cistpl_bar_t {
379 u_char attr;
380 u_int size;
381} cistpl_bar_t;
382
383typedef struct cistpl_config_t {
384 u_char last_idx;
385 u_int base;
386 u_int rmask[4];
387 u_char subtuples;
388} cistpl_config_t;
389
390/* These are bits in the 'present' field, and indices in 'param' */
391#define CISTPL_POWER_VNOM 0
392#define CISTPL_POWER_VMIN 1
393#define CISTPL_POWER_VMAX 2
394#define CISTPL_POWER_ISTATIC 3
395#define CISTPL_POWER_IAVG 4
396#define CISTPL_POWER_IPEAK 5
397#define CISTPL_POWER_IDOWN 6
398
399#define CISTPL_POWER_HIGHZ_OK 0x01
400#define CISTPL_POWER_HIGHZ_REQ 0x02
401
402typedef struct cistpl_power_t {
403 u_char present;
404 u_char flags;
405 u_int param[7];
406} cistpl_power_t;
407
408typedef struct cistpl_timing_t {
409 u_int wait, waitscale;
410 u_int ready, rdyscale;
411 u_int reserved, rsvscale;
412} cistpl_timing_t;
413
414#define CISTPL_IO_LINES_MASK 0x1f
415#define CISTPL_IO_8BIT 0x20
416#define CISTPL_IO_16BIT 0x40
417#define CISTPL_IO_RANGE 0x80
418
419#define CISTPL_IO_MAX_WIN 16
420
421typedef struct cistpl_io_t {
422 u_char flags;
423 u_char nwin;
424 struct {
425 u_int base;
426 u_int len;
427 } win[CISTPL_IO_MAX_WIN];
428} cistpl_io_t;
429
430typedef struct cistpl_irq_t {
431 u_int IRQInfo1;
432 u_int IRQInfo2;
433} cistpl_irq_t;
434
435#define CISTPL_MEM_MAX_WIN 8
436
437typedef struct cistpl_mem_t {
438 u_char flags;
439 u_char nwin;
440 struct {
441 u_int len;
442 u_int card_addr;
443 u_int host_addr;
444 } win[CISTPL_MEM_MAX_WIN];
445} cistpl_mem_t;
446
447#define CISTPL_CFTABLE_DEFAULT 0x0001
448#define CISTPL_CFTABLE_BVDS 0x0002
449#define CISTPL_CFTABLE_WP 0x0004
450#define CISTPL_CFTABLE_RDYBSY 0x0008
451#define CISTPL_CFTABLE_MWAIT 0x0010
452#define CISTPL_CFTABLE_AUDIO 0x0800
453#define CISTPL_CFTABLE_READONLY 0x1000
454#define CISTPL_CFTABLE_PWRDOWN 0x2000
455
456typedef struct cistpl_cftable_entry_t {
457 u_char index;
458 u_short flags;
459 u_char interface;
460 cistpl_power_t vcc, vpp1, vpp2;
461 cistpl_timing_t timing;
462 cistpl_io_t io;
463 cistpl_irq_t irq;
464 cistpl_mem_t mem;
465 u_char subtuples;
466} cistpl_cftable_entry_t;
467
468#define CISTPL_CFTABLE_MASTER 0x000100
469#define CISTPL_CFTABLE_INVALIDATE 0x000200
470#define CISTPL_CFTABLE_VGA_PALETTE 0x000400
471#define CISTPL_CFTABLE_PARITY 0x000800
472#define CISTPL_CFTABLE_WAIT 0x001000
473#define CISTPL_CFTABLE_SERR 0x002000
474#define CISTPL_CFTABLE_FAST_BACK 0x004000
475#define CISTPL_CFTABLE_BINARY_AUDIO 0x010000
476#define CISTPL_CFTABLE_PWM_AUDIO 0x020000
477
478typedef struct cistpl_cftable_entry_cb_t {
479 u_char index;
480 u_int flags;
481 cistpl_power_t vcc, vpp1, vpp2;
482 u_char io;
483 cistpl_irq_t irq;
484 u_char mem;
485 u_char subtuples;
486} cistpl_cftable_entry_cb_t;
487
488typedef struct cistpl_device_geo_t {
489 u_char ngeo;
490 struct {
491 u_char buswidth;
492 u_int erase_block;
493 u_int read_block;
494 u_int write_block;
495 u_int partition;
496 u_int interleave;
497 } geo[CISTPL_MAX_DEVICES];
498} cistpl_device_geo_t;
499
500typedef struct cistpl_vers_2_t {
501 u_char vers;
502 u_char comply;
503 u_short dindex;
504 u_char vspec8, vspec9;
505 u_char nhdr;
506 u_char vendor, info;
507 char str[244];
508} cistpl_vers_2_t;
509
510typedef struct cistpl_org_t {
511 u_char data_org;
512 char desc[30];
513} cistpl_org_t;
514
515#define CISTPL_ORG_FS 0x00
516#define CISTPL_ORG_APPSPEC 0x01
517#define CISTPL_ORG_XIP 0x02
518
519typedef struct cistpl_format_t {
520 u_char type;
521 u_char edc;
522 u_int offset;
523 u_int length;
524} cistpl_format_t;
525
526#define CISTPL_FORMAT_DISK 0x00
527#define CISTPL_FORMAT_MEM 0x01
528
529#define CISTPL_EDC_NONE 0x00
530#define CISTPL_EDC_CKSUM 0x01
531#define CISTPL_EDC_CRC 0x02
532#define CISTPL_EDC_PCC 0x03
533
534typedef union cisparse_t {
535 cistpl_device_t device;
536 cistpl_checksum_t checksum;
537 cistpl_longlink_t longlink;
538 cistpl_longlink_mfc_t longlink_mfc;
539 cistpl_vers_1_t version_1;
540 cistpl_altstr_t altstr;
541 cistpl_jedec_t jedec;
542 cistpl_manfid_t manfid;
543 cistpl_funcid_t funcid;
544 cistpl_funce_t funce;
545 cistpl_bar_t bar;
546 cistpl_config_t config;
547 cistpl_cftable_entry_t cftable_entry;
548 cistpl_cftable_entry_cb_t cftable_entry_cb;
549 cistpl_device_geo_t device_geo;
550 cistpl_vers_2_t vers_2;
551 cistpl_org_t org;
552 cistpl_format_t format;
553} cisparse_t;
554
555typedef struct tuple_t {
556 u_int Attributes;
557 cisdata_t DesiredTuple;
558 u_int Flags; /* internal use */
559 u_int LinkOffset; /* internal use */
560 u_int CISOffset; /* internal use */
561 cisdata_t TupleCode;
562 cisdata_t TupleLink;
563 cisdata_t TupleOffset;
564 cisdata_t TupleDataMax;
565 cisdata_t TupleDataLen;
566 cisdata_t *TupleData;
567} tuple_t;
568
569/* Special cisdata_t value */
570#define RETURN_FIRST_TUPLE 0xff
571
572/* Attributes for tuple calls */
573#define TUPLE_RETURN_LINK 0x01
574#define TUPLE_RETURN_COMMON 0x02
575
576/* For ValidateCIS */
577typedef struct cisinfo_t {
578 u_int Chains;
579} cisinfo_t;
580
581#define CISTPL_MAX_CIS_SIZE 0x200
582
583/* For ReplaceCIS */
584typedef struct cisdump_t {
585 u_int Length;
586 cisdata_t Data[CISTPL_MAX_CIS_SIZE];
587} cisdump_t;
588
589int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple);
590int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple);
591int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple);
592int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse);
593
594int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info);
595int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis);
596
597/* don't use outside of PCMCIA core yet */
598int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int func, tuple_t *tuple);
599int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple);
600int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple);
601int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse);
602
603int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info);
604
605#endif /* LINUX_CISTPL_H */
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
new file mode 100644
index 000000000000..8d8643adc786
--- /dev/null
+++ b/include/pcmcia/cs.h
@@ -0,0 +1,427 @@
1/*
2 * cs.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds
9 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 *
12 * (C) 1999 David A. Hinds
13 */
14
15#ifndef _LINUX_CS_H
16#define _LINUX_CS_H
17
18/* For AccessConfigurationRegister */
19typedef struct conf_reg_t {
20 u_char Function;
21 u_int Action;
22 off_t Offset;
23 u_int Value;
24} conf_reg_t;
25
26/* Actions */
27#define CS_READ 1
28#define CS_WRITE 2
29
30/* for AdjustResourceInfo */
31typedef struct adjust_t {
32 u_int Action;
33 u_int Resource;
34 u_int Attributes;
35 union {
36 struct memory {
37 u_long Base;
38 u_long Size;
39 } memory;
40 struct io {
41 ioaddr_t BasePort;
42 ioaddr_t NumPorts;
43 u_int IOAddrLines;
44 } io;
45 struct irq {
46 u_int IRQ;
47 } irq;
48 } resource;
49} adjust_t;
50
51/* Action field */
52#define REMOVE_MANAGED_RESOURCE 1
53#define ADD_MANAGED_RESOURCE 2
54#define GET_FIRST_MANAGED_RESOURCE 3
55#define GET_NEXT_MANAGED_RESOURCE 4
56/* Resource field */
57#define RES_MEMORY_RANGE 1
58#define RES_IO_RANGE 2
59#define RES_IRQ 3
60/* Attribute field */
61#define RES_IRQ_TYPE 0x03
62#define RES_IRQ_TYPE_EXCLUSIVE 0
63#define RES_IRQ_TYPE_TIME 1
64#define RES_IRQ_TYPE_DYNAMIC 2
65#define RES_IRQ_CSC 0x04
66#define RES_SHARED 0x08
67#define RES_RESERVED 0x10
68#define RES_ALLOCATED 0x20
69#define RES_REMOVED 0x40
70
71typedef struct servinfo_t {
72 char Signature[2];
73 u_int Count;
74 u_int Revision;
75 u_int CSLevel;
76 char *VendorString;
77} servinfo_t;
78
79typedef struct event_callback_args_t {
80 client_handle_t client_handle;
81 void *info;
82 void *mtdrequest;
83 void *buffer;
84 void *misc;
85 void *client_data;
86} event_callback_args_t;
87
88/* for GetConfigurationInfo */
89typedef struct config_info_t {
90 u_char Function;
91 u_int Attributes;
92 u_int Vcc, Vpp1, Vpp2;
93 u_int IntType;
94 u_int ConfigBase;
95 u_char Status, Pin, Copy, Option, ExtStatus;
96 u_int Present;
97 u_int CardValues;
98 u_int AssignedIRQ;
99 u_int IRQAttributes;
100 ioaddr_t BasePort1;
101 ioaddr_t NumPorts1;
102 u_int Attributes1;
103 ioaddr_t BasePort2;
104 ioaddr_t NumPorts2;
105 u_int Attributes2;
106 u_int IOAddrLines;
107} config_info_t;
108
109/* For CardValues field */
110#define CV_OPTION_VALUE 0x01
111#define CV_STATUS_VALUE 0x02
112#define CV_PIN_REPLACEMENT 0x04
113#define CV_COPY_VALUE 0x08
114#define CV_EXT_STATUS 0x10
115
116/* For GetFirst/NextClient */
117typedef struct client_req_t {
118 socket_t Socket;
119 u_int Attributes;
120} client_req_t;
121
122#define CLIENT_THIS_SOCKET 0x01
123
124/* For RegisterClient */
125typedef struct client_reg_t {
126 dev_info_t *dev_info;
127 u_int Attributes; /* UNUSED */
128 u_int EventMask;
129 int (*event_handler)(event_t event, int priority,
130 event_callback_args_t *);
131 event_callback_args_t event_callback_args;
132 u_int Version;
133} client_reg_t;
134
135/* ModifyConfiguration */
136typedef struct modconf_t {
137 u_int Attributes;
138 u_int Vcc, Vpp1, Vpp2;
139} modconf_t;
140
141/* Attributes for ModifyConfiguration */
142#define CONF_IRQ_CHANGE_VALID 0x100
143#define CONF_VCC_CHANGE_VALID 0x200
144#define CONF_VPP1_CHANGE_VALID 0x400
145#define CONF_VPP2_CHANGE_VALID 0x800
146
147/* For RequestConfiguration */
148typedef struct config_req_t {
149 u_int Attributes;
150 u_int Vcc, Vpp1, Vpp2;
151 u_int IntType;
152 u_int ConfigBase;
153 u_char Status, Pin, Copy, ExtStatus;
154 u_char ConfigIndex;
155 u_int Present;
156} config_req_t;
157
158/* Attributes for RequestConfiguration */
159#define CONF_ENABLE_IRQ 0x01
160#define CONF_ENABLE_DMA 0x02
161#define CONF_ENABLE_SPKR 0x04
162#define CONF_VALID_CLIENT 0x100
163
164/* IntType field */
165#define INT_MEMORY 0x01
166#define INT_MEMORY_AND_IO 0x02
167#define INT_CARDBUS 0x04
168#define INT_ZOOMED_VIDEO 0x08
169
170/* For RequestIO and ReleaseIO */
171typedef struct io_req_t {
172 ioaddr_t BasePort1;
173 ioaddr_t NumPorts1;
174 u_int Attributes1;
175 ioaddr_t BasePort2;
176 ioaddr_t NumPorts2;
177 u_int Attributes2;
178 u_int IOAddrLines;
179} io_req_t;
180
181/* Attributes for RequestIO and ReleaseIO */
182#define IO_SHARED 0x01
183#define IO_FIRST_SHARED 0x02
184#define IO_FORCE_ALIAS_ACCESS 0x04
185#define IO_DATA_PATH_WIDTH 0x18
186#define IO_DATA_PATH_WIDTH_8 0x00
187#define IO_DATA_PATH_WIDTH_16 0x08
188#define IO_DATA_PATH_WIDTH_AUTO 0x10
189
190/* For RequestIRQ and ReleaseIRQ */
191typedef struct irq_req_t {
192 u_int Attributes;
193 u_int AssignedIRQ;
194 u_int IRQInfo1, IRQInfo2; /* IRQInfo2 is ignored */
195 void *Handler;
196 void *Instance;
197} irq_req_t;
198
199/* Attributes for RequestIRQ and ReleaseIRQ */
200#define IRQ_TYPE 0x03
201#define IRQ_TYPE_EXCLUSIVE 0x00
202#define IRQ_TYPE_TIME 0x01
203#define IRQ_TYPE_DYNAMIC_SHARING 0x02
204#define IRQ_FORCED_PULSE 0x04
205#define IRQ_FIRST_SHARED 0x08
206#define IRQ_HANDLE_PRESENT 0x10
207#define IRQ_PULSE_ALLOCATED 0x100
208
209/* Bits in IRQInfo1 field */
210#define IRQ_MASK 0x0f
211#define IRQ_NMI_ID 0x01
212#define IRQ_IOCK_ID 0x02
213#define IRQ_BERR_ID 0x04
214#define IRQ_VEND_ID 0x08
215#define IRQ_INFO2_VALID 0x10
216#define IRQ_LEVEL_ID 0x20
217#define IRQ_PULSE_ID 0x40
218#define IRQ_SHARE_ID 0x80
219
220typedef struct eventmask_t {
221 u_int Attributes;
222 u_int EventMask;
223} eventmask_t;
224
225#define CONF_EVENT_MASK_VALID 0x01
226
227/* Configuration registers present */
228#define PRESENT_OPTION 0x001
229#define PRESENT_STATUS 0x002
230#define PRESENT_PIN_REPLACE 0x004
231#define PRESENT_COPY 0x008
232#define PRESENT_EXT_STATUS 0x010
233#define PRESENT_IOBASE_0 0x020
234#define PRESENT_IOBASE_1 0x040
235#define PRESENT_IOBASE_2 0x080
236#define PRESENT_IOBASE_3 0x100
237#define PRESENT_IOSIZE 0x200
238
239/* For GetMemPage, MapMemPage */
240typedef struct memreq_t {
241 u_int CardOffset;
242 page_t Page;
243} memreq_t;
244
245/* For ModifyWindow */
246typedef struct modwin_t {
247 u_int Attributes;
248 u_int AccessSpeed;
249} modwin_t;
250
251/* For RequestWindow */
252typedef struct win_req_t {
253 u_int Attributes;
254 u_long Base;
255 u_int Size;
256 u_int AccessSpeed;
257} win_req_t;
258
259/* Attributes for RequestWindow */
260#define WIN_ADDR_SPACE 0x0001
261#define WIN_ADDR_SPACE_MEM 0x0000
262#define WIN_ADDR_SPACE_IO 0x0001
263#define WIN_MEMORY_TYPE 0x0002
264#define WIN_MEMORY_TYPE_CM 0x0000
265#define WIN_MEMORY_TYPE_AM 0x0002
266#define WIN_ENABLE 0x0004
267#define WIN_DATA_WIDTH 0x0018
268#define WIN_DATA_WIDTH_8 0x0000
269#define WIN_DATA_WIDTH_16 0x0008
270#define WIN_DATA_WIDTH_32 0x0010
271#define WIN_PAGED 0x0020
272#define WIN_SHARED 0x0040
273#define WIN_FIRST_SHARED 0x0080
274#define WIN_USE_WAIT 0x0100
275#define WIN_STRICT_ALIGN 0x0200
276#define WIN_MAP_BELOW_1MB 0x0400
277#define WIN_PREFETCH 0x0800
278#define WIN_CACHEABLE 0x1000
279#define WIN_BAR_MASK 0xe000
280#define WIN_BAR_SHIFT 13
281
282/* Attributes for RegisterClient -- UNUSED -- */
283#define INFO_MASTER_CLIENT 0x01
284#define INFO_IO_CLIENT 0x02
285#define INFO_MTD_CLIENT 0x04
286#define INFO_MEM_CLIENT 0x08
287#define MAX_NUM_CLIENTS 3
288
289#define INFO_CARD_SHARE 0x10
290#define INFO_CARD_EXCL 0x20
291
292typedef struct cs_status_t {
293 u_char Function;
294 event_t CardState;
295 event_t SocketState;
296} cs_status_t;
297
298typedef struct error_info_t {
299 int func;
300 int retcode;
301} error_info_t;
302
303/* Flag to bind to all functions */
304#define BIND_FN_ALL 0xff
305
306/* Events */
307#define CS_EVENT_PRI_LOW 0
308#define CS_EVENT_PRI_HIGH 1
309
310#define CS_EVENT_WRITE_PROTECT 0x000001
311#define CS_EVENT_CARD_LOCK 0x000002
312#define CS_EVENT_CARD_INSERTION 0x000004
313#define CS_EVENT_CARD_REMOVAL 0x000008
314#define CS_EVENT_BATTERY_DEAD 0x000010
315#define CS_EVENT_BATTERY_LOW 0x000020
316#define CS_EVENT_READY_CHANGE 0x000040
317#define CS_EVENT_CARD_DETECT 0x000080
318#define CS_EVENT_RESET_REQUEST 0x000100
319#define CS_EVENT_RESET_PHYSICAL 0x000200
320#define CS_EVENT_CARD_RESET 0x000400
321#define CS_EVENT_REGISTRATION_COMPLETE 0x000800
322#define CS_EVENT_PM_SUSPEND 0x002000
323#define CS_EVENT_PM_RESUME 0x004000
324#define CS_EVENT_INSERTION_REQUEST 0x008000
325#define CS_EVENT_EJECTION_REQUEST 0x010000
326#define CS_EVENT_MTD_REQUEST 0x020000
327#define CS_EVENT_ERASE_COMPLETE 0x040000
328#define CS_EVENT_REQUEST_ATTENTION 0x080000
329#define CS_EVENT_CB_DETECT 0x100000
330#define CS_EVENT_3VCARD 0x200000
331#define CS_EVENT_XVCARD 0x400000
332
333/* Return codes */
334#define CS_SUCCESS 0x00
335#define CS_BAD_ADAPTER 0x01
336#define CS_BAD_ATTRIBUTE 0x02
337#define CS_BAD_BASE 0x03
338#define CS_BAD_EDC 0x04
339#define CS_BAD_IRQ 0x06
340#define CS_BAD_OFFSET 0x07
341#define CS_BAD_PAGE 0x08
342#define CS_READ_FAILURE 0x09
343#define CS_BAD_SIZE 0x0a
344#define CS_BAD_SOCKET 0x0b
345#define CS_BAD_TYPE 0x0d
346#define CS_BAD_VCC 0x0e
347#define CS_BAD_VPP 0x0f
348#define CS_BAD_WINDOW 0x11
349#define CS_WRITE_FAILURE 0x12
350#define CS_NO_CARD 0x14
351#define CS_UNSUPPORTED_FUNCTION 0x15
352#define CS_UNSUPPORTED_MODE 0x16
353#define CS_BAD_SPEED 0x17
354#define CS_BUSY 0x18
355#define CS_GENERAL_FAILURE 0x19
356#define CS_WRITE_PROTECTED 0x1a
357#define CS_BAD_ARG_LENGTH 0x1b
358#define CS_BAD_ARGS 0x1c
359#define CS_CONFIGURATION_LOCKED 0x1d
360#define CS_IN_USE 0x1e
361#define CS_NO_MORE_ITEMS 0x1f
362#define CS_OUT_OF_RESOURCE 0x20
363#define CS_BAD_HANDLE 0x21
364
365#define CS_BAD_TUPLE 0x40
366
367#ifdef __KERNEL__
368
369/*
370 * The main Card Services entry point
371 */
372
373enum service {
374 AccessConfigurationRegister, AddSocketServices,
375 AdjustResourceInfo, CheckEraseQueue, CloseMemory, CopyMemory,
376 DeregisterClient, DeregisterEraseQueue, GetCardServicesInfo,
377 GetClientInfo, GetConfigurationInfo, GetEventMask,
378 GetFirstClient, GetFirstPartion, GetFirstRegion, GetFirstTuple,
379 GetNextClient, GetNextPartition, GetNextRegion, GetNextTuple,
380 GetStatus, GetTupleData, MapLogSocket, MapLogWindow, MapMemPage,
381 MapPhySocket, MapPhyWindow, ModifyConfiguration, ModifyWindow,
382 OpenMemory, ParseTuple, ReadMemory, RegisterClient,
383 RegisterEraseQueue, RegisterMTD, RegisterTimer,
384 ReleaseConfiguration, ReleaseExclusive, ReleaseIO, ReleaseIRQ,
385 ReleaseSocketMask, ReleaseWindow, ReplaceSocketServices,
386 RequestConfiguration, RequestExclusive, RequestIO, RequestIRQ,
387 RequestSocketMask, RequestWindow, ResetCard, ReturnSSEntry,
388 SetEventMask, SetRegion, ValidateCIS, VendorSpecific,
389 WriteMemory, BindDevice, BindMTD, ReportError,
390 SuspendCard, ResumeCard, EjectCard, InsertCard, ReplaceCIS,
391 GetFirstWindow, GetNextWindow, GetMemPage
392};
393
394struct pcmcia_socket;
395
396int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg);
397int pcmcia_deregister_client(client_handle_t handle);
398int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config);
399int pcmcia_get_card_services_info(servinfo_t *info);
400int pcmcia_get_first_window(window_handle_t *win, win_req_t *req);
401int pcmcia_get_next_window(window_handle_t *win, win_req_t *req);
402int pcmcia_get_status(client_handle_t handle, cs_status_t *status);
403int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
404int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
405int pcmcia_modify_configuration(client_handle_t handle, modconf_t *mod);
406int pcmcia_register_client(client_handle_t *handle, client_reg_t *req);
407int pcmcia_release_configuration(client_handle_t handle);
408int pcmcia_release_io(client_handle_t handle, io_req_t *req);
409int pcmcia_release_irq(client_handle_t handle, irq_req_t *req);
410int pcmcia_release_window(window_handle_t win);
411int pcmcia_request_configuration(client_handle_t handle, config_req_t *req);
412int pcmcia_request_io(client_handle_t handle, io_req_t *req);
413int pcmcia_request_irq(client_handle_t handle, irq_req_t *req);
414int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle_t *wh);
415int pcmcia_reset_card(client_handle_t handle, client_req_t *req);
416int pcmcia_suspend_card(struct pcmcia_socket *skt);
417int pcmcia_resume_card(struct pcmcia_socket *skt);
418int pcmcia_eject_card(struct pcmcia_socket *skt);
419int pcmcia_insert_card(struct pcmcia_socket *skt);
420int pcmcia_report_error(client_handle_t handle, error_info_t *err);
421
422struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt);
423void pcmcia_put_socket(struct pcmcia_socket *skt);
424
425#endif /* __KERNEL__ */
426
427#endif /* _LINUX_CS_H */
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h
new file mode 100644
index 000000000000..7881d40aac8d
--- /dev/null
+++ b/include/pcmcia/cs_types.h
@@ -0,0 +1,52 @@
1/*
2 * cs_types.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds
9 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 *
12 * (C) 1999 David A. Hinds
13 */
14
15#ifndef _LINUX_CS_TYPES_H
16#define _LINUX_CS_TYPES_H
17
18#ifdef __KERNEL__
19#include <linux/types.h>
20#else
21#include <sys/types.h>
22#endif
23
24#if defined(__arm__) || defined(__mips__)
25/* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */
26typedef u_int ioaddr_t;
27#else
28typedef u_short ioaddr_t;
29#endif
30typedef unsigned long kio_addr_t;
31
32typedef u_short socket_t;
33typedef u_int event_t;
34typedef u_char cisdata_t;
35typedef u_short page_t;
36
37struct client_t;
38typedef struct client_t *client_handle_t;
39
40struct window_t;
41typedef struct window_t *window_handle_t;
42
43struct region_t;
44typedef struct region_t *memory_handle_t;
45
46#ifndef DEV_NAME_LEN
47#define DEV_NAME_LEN 32
48#endif
49
50typedef char dev_info_t[DEV_NAME_LEN];
51
52#endif /* _LINUX_CS_TYPES_H */
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
new file mode 100644
index 000000000000..312fd958c901
--- /dev/null
+++ b/include/pcmcia/ds.h
@@ -0,0 +1,200 @@
1/*
2 * ds.h -- 16-bit PCMCIA core support
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds
9 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 *
12 * (C) 1999 David A. Hinds
13 * (C) 2003 - 2004 Dominik Brodowski
14 */
15
16#ifndef _LINUX_DS_H
17#define _LINUX_DS_H
18
19#include <pcmcia/bulkmem.h>
20#include <pcmcia/cs_types.h>
21
22typedef struct tuple_parse_t {
23 tuple_t tuple;
24 cisdata_t data[255];
25 cisparse_t parse;
26} tuple_parse_t;
27
28typedef struct win_info_t {
29 window_handle_t handle;
30 win_req_t window;
31 memreq_t map;
32} win_info_t;
33
34typedef struct bind_info_t {
35 dev_info_t dev_info;
36 u_char function;
37 struct dev_link_t *instance;
38 char name[DEV_NAME_LEN];
39 u_short major, minor;
40 void *next;
41} bind_info_t;
42
43typedef struct mtd_info_t {
44 dev_info_t dev_info;
45 u_int Attributes;
46 u_int CardOffset;
47} mtd_info_t;
48
49typedef union ds_ioctl_arg_t {
50 servinfo_t servinfo;
51 adjust_t adjust;
52 config_info_t config;
53 tuple_t tuple;
54 tuple_parse_t tuple_parse;
55 client_req_t client_req;
56 cs_status_t status;
57 conf_reg_t conf_reg;
58 cisinfo_t cisinfo;
59 region_info_t region;
60 bind_info_t bind_info;
61 mtd_info_t mtd_info;
62 win_info_t win_info;
63 cisdump_t cisdump;
64} ds_ioctl_arg_t;
65
66#define DS_GET_CARD_SERVICES_INFO _IOR ('d', 1, servinfo_t)
67#define DS_ADJUST_RESOURCE_INFO _IOWR('d', 2, adjust_t)
68#define DS_GET_CONFIGURATION_INFO _IOWR('d', 3, config_info_t)
69#define DS_GET_FIRST_TUPLE _IOWR('d', 4, tuple_t)
70#define DS_GET_NEXT_TUPLE _IOWR('d', 5, tuple_t)
71#define DS_GET_TUPLE_DATA _IOWR('d', 6, tuple_parse_t)
72#define DS_PARSE_TUPLE _IOWR('d', 7, tuple_parse_t)
73#define DS_RESET_CARD _IO ('d', 8)
74#define DS_GET_STATUS _IOWR('d', 9, cs_status_t)
75#define DS_ACCESS_CONFIGURATION_REGISTER _IOWR('d', 10, conf_reg_t)
76#define DS_VALIDATE_CIS _IOR ('d', 11, cisinfo_t)
77#define DS_SUSPEND_CARD _IO ('d', 12)
78#define DS_RESUME_CARD _IO ('d', 13)
79#define DS_EJECT_CARD _IO ('d', 14)
80#define DS_INSERT_CARD _IO ('d', 15)
81#define DS_GET_FIRST_REGION _IOWR('d', 16, region_info_t)
82#define DS_GET_NEXT_REGION _IOWR('d', 17, region_info_t)
83#define DS_REPLACE_CIS _IOWR('d', 18, cisdump_t)
84#define DS_GET_FIRST_WINDOW _IOR ('d', 19, win_info_t)
85#define DS_GET_NEXT_WINDOW _IOWR('d', 20, win_info_t)
86#define DS_GET_MEM_PAGE _IOWR('d', 21, win_info_t)
87
88#define DS_BIND_REQUEST _IOWR('d', 60, bind_info_t)
89#define DS_GET_DEVICE_INFO _IOWR('d', 61, bind_info_t)
90#define DS_GET_NEXT_DEVICE _IOWR('d', 62, bind_info_t)
91#define DS_UNBIND_REQUEST _IOW ('d', 63, bind_info_t)
92#define DS_BIND_MTD _IOWR('d', 64, mtd_info_t)
93
94#ifdef __KERNEL__
95#include <linux/device.h>
96
97typedef struct dev_node_t {
98 char dev_name[DEV_NAME_LEN];
99 u_short major, minor;
100 struct dev_node_t *next;
101} dev_node_t;
102
103typedef struct dev_link_t {
104 dev_node_t *dev;
105 u_int state, open;
106 wait_queue_head_t pending;
107 client_handle_t handle;
108 io_req_t io;
109 irq_req_t irq;
110 config_req_t conf;
111 window_handle_t win;
112 void *priv;
113 struct dev_link_t *next;
114} dev_link_t;
115
116/* Flags for device state */
117#define DEV_PRESENT 0x01
118#define DEV_CONFIG 0x02
119#define DEV_STALE_CONFIG 0x04 /* release on close */
120#define DEV_STALE_LINK 0x08 /* detach on release */
121#define DEV_CONFIG_PENDING 0x10
122#define DEV_RELEASE_PENDING 0x20
123#define DEV_SUSPEND 0x40
124#define DEV_BUSY 0x80
125
126#define DEV_OK(l) \
127 ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT)))
128
129
130struct pcmcia_socket;
131
132extern struct bus_type pcmcia_bus_type;
133
134struct pcmcia_driver {
135 dev_link_t *(*attach)(void);
136 void (*detach)(dev_link_t *);
137 struct module *owner;
138 struct device_driver drv;
139};
140
141/* driver registration */
142int pcmcia_register_driver(struct pcmcia_driver *driver);
143void pcmcia_unregister_driver(struct pcmcia_driver *driver);
144
145struct pcmcia_device {
146 /* the socket and the device_no [for multifunction devices]
147 uniquely define a pcmcia_device */
148 struct pcmcia_socket *socket;
149
150 u8 device_no;
151
152 /* the hardware "function" device; certain subdevices can
153 * share one hardware "function" device. */
154 u8 func;
155
156 struct list_head socket_device_list;
157
158 /* deprecated, a cleaned up version will be moved into this
159 struct soon */
160 dev_link_t *instance;
161 struct client_t {
162 u_short client_magic;
163 struct pcmcia_socket *Socket;
164 u_char Function;
165 u_int state;
166 event_t EventMask;
167 int (*event_handler) (event_t event, int priority,
168 event_callback_args_t *);
169 event_callback_args_t event_callback_args;
170 } client;
171
172 /* information about this device */
173 u8 has_manf_id:1;
174 u8 has_card_id:1;
175 u8 has_func_id:1;
176 u8 reserved:5;
177
178 u8 func_id;
179 u16 manf_id;
180 u16 card_id;
181
182 char * prod_id[4];
183
184 /* device driver wanted by cardmgr */
185 struct pcmcia_driver * cardmgr;
186
187 struct device dev;
188};
189
190#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
191#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
192
193#define handle_to_pdev(handle) container_of(handle, struct pcmcia_device, client);
194#define handle_to_dev(handle) ((container_of(handle, struct pcmcia_device, client))->dev)
195
196/* error reporting */
197void cs_error(client_handle_t handle, int func, int ret);
198
199#endif /* __KERNEL__ */
200#endif /* _LINUX_DS_H */
diff --git a/include/pcmcia/mem_op.h b/include/pcmcia/mem_op.h
new file mode 100644
index 000000000000..8d19b9401a5b
--- /dev/null
+++ b/include/pcmcia/mem_op.h
@@ -0,0 +1,116 @@
1/*
2 * mem_op.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds
9 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 *
12 * (C) 1999 David A. Hinds
13 */
14
15#ifndef _LINUX_MEM_OP_H
16#define _LINUX_MEM_OP_H
17
18#include <asm/uaccess.h>
19#include <asm/io.h>
20
21/*
22 If UNSAFE_MEMCPY is defined, we use the (optimized) system routines
23 to copy between a card and kernel memory. These routines do 32-bit
24 operations which may not work with all PCMCIA controllers. The
25 safe versions defined here will do only 8-bit and 16-bit accesses.
26*/
27
28#ifdef UNSAFE_MEMCPY
29
30#define copy_from_pc memcpy_fromio
31#define copy_to_pc memcpy_toio
32
33static inline void copy_pc_to_user(void *to, const void *from, size_t n)
34{
35 size_t odd = (n & 3);
36 n -= odd;
37 while (n) {
38 put_user(__raw_readl(from), (int *)to);
39 (char *)from += 4; (char *)to += 4; n -= 4;
40 }
41 while (odd--)
42 put_user(readb((char *)from++), (char *)to++);
43}
44
45static inline void copy_user_to_pc(void *to, const void *from, size_t n)
46{
47 int l;
48 char c;
49 size_t odd = (n & 3);
50 n -= odd;
51 while (n) {
52 get_user(l, (int *)from);
53 __raw_writel(l, to);
54 (char *)to += 4; (char *)from += 4; n -= 4;
55 }
56 while (odd--) {
57 get_user(c, (char *)from++);
58 writeb(c, (char *)to++);
59 }
60}
61
62#else /* UNSAFE_MEMCPY */
63
64static inline void copy_from_pc(void *to, void __iomem *from, size_t n)
65{
66 __u16 *t = to;
67 __u16 __iomem *f = from;
68 size_t odd = (n & 1);
69 for (n >>= 1; n; n--)
70 *t++ = __raw_readw(f++);
71 if (odd)
72 *(__u8 *)t = readb(f);
73}
74
75static inline void copy_to_pc(void __iomem *to, const void *from, size_t n)
76{
77 __u16 __iomem *t = to;
78 const __u16 *f = from;
79 size_t odd = (n & 1);
80 for (n >>= 1; n ; n--)
81 __raw_writew(*f++, t++);
82 if (odd)
83 writeb(*(__u8 *)f, t);
84}
85
86static inline void copy_pc_to_user(void __user *to, void __iomem *from, size_t n)
87{
88 __u16 __user *t = to;
89 __u16 __iomem *f = from;
90 size_t odd = (n & 1);
91 for (n >>= 1; n ; n--)
92 put_user(__raw_readw(f++), t++);
93 if (odd)
94 put_user(readb(f), (char __user *)t);
95}
96
97static inline void copy_user_to_pc(void __iomem *to, void __user *from, size_t n)
98{
99 __u16 __user *f = from;
100 __u16 __iomem *t = to;
101 short s;
102 char c;
103 size_t odd = (n & 1);
104 for (n >>= 1; n; n--) {
105 get_user(s, f++);
106 __raw_writew(s, t++);
107 }
108 if (odd) {
109 get_user(c, (char __user *)f);
110 writeb(c, t);
111 }
112}
113
114#endif /* UNSAFE_MEMCPY */
115
116#endif /* _LINUX_MEM_OP_H */
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
new file mode 100644
index 000000000000..6d3413a56708
--- /dev/null
+++ b/include/pcmcia/ss.h
@@ -0,0 +1,265 @@
1/*
2 * ss.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds
9 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 *
12 * (C) 1999 David A. Hinds
13 */
14
15#ifndef _LINUX_SS_H
16#define _LINUX_SS_H
17
18#include <pcmcia/cs_types.h>
19#include <pcmcia/cs.h>
20#include <pcmcia/bulkmem.h>
21#include <linux/device.h>
22
23/* Definitions for card status flags for GetStatus */
24#define SS_WRPROT 0x0001
25#define SS_CARDLOCK 0x0002
26#define SS_EJECTION 0x0004
27#define SS_INSERTION 0x0008
28#define SS_BATDEAD 0x0010
29#define SS_BATWARN 0x0020
30#define SS_READY 0x0040
31#define SS_DETECT 0x0080
32#define SS_POWERON 0x0100
33#define SS_GPI 0x0200
34#define SS_STSCHG 0x0400
35#define SS_CARDBUS 0x0800
36#define SS_3VCARD 0x1000
37#define SS_XVCARD 0x2000
38#define SS_PENDING 0x4000
39#define SS_ZVCARD 0x8000
40
41/* InquireSocket capabilities */
42#define SS_CAP_PAGE_REGS 0x0001
43#define SS_CAP_VIRTUAL_BUS 0x0002
44#define SS_CAP_MEM_ALIGN 0x0004
45#define SS_CAP_STATIC_MAP 0x0008
46#define SS_CAP_PCCARD 0x4000
47#define SS_CAP_CARDBUS 0x8000
48
49/* for GetSocket, SetSocket */
50typedef struct socket_state_t {
51 u_int flags;
52 u_int csc_mask;
53 u_char Vcc, Vpp;
54 u_char io_irq;
55} socket_state_t;
56
57extern socket_state_t dead_socket;
58
59/* Socket configuration flags */
60#define SS_PWR_AUTO 0x0010
61#define SS_IOCARD 0x0020
62#define SS_RESET 0x0040
63#define SS_DMA_MODE 0x0080
64#define SS_SPKR_ENA 0x0100
65#define SS_OUTPUT_ENA 0x0200
66
67/* Flags for I/O port and memory windows */
68#define MAP_ACTIVE 0x01
69#define MAP_16BIT 0x02
70#define MAP_AUTOSZ 0x04
71#define MAP_0WS 0x08
72#define MAP_WRPROT 0x10
73#define MAP_ATTRIB 0x20
74#define MAP_USE_WAIT 0x40
75#define MAP_PREFETCH 0x80
76
77/* Use this just for bridge windows */
78#define MAP_IOSPACE 0x20
79
80typedef struct pccard_io_map {
81 u_char map;
82 u_char flags;
83 u_short speed;
84 kio_addr_t start, stop;
85} pccard_io_map;
86
87typedef struct pccard_mem_map {
88 u_char map;
89 u_char flags;
90 u_short speed;
91 u_long static_start;
92 u_int card_start;
93 struct resource *res;
94} pccard_mem_map;
95
96typedef struct cb_bridge_map {
97 u_char map;
98 u_char flags;
99 u_int start, stop;
100} cb_bridge_map;
101
102/*
103 * Socket operations.
104 */
105struct pcmcia_socket;
106
107struct pccard_operations {
108 int (*init)(struct pcmcia_socket *sock);
109 int (*suspend)(struct pcmcia_socket *sock);
110 int (*register_callback)(struct pcmcia_socket *sock, void (*handler)(void *, unsigned int), void * info);
111 int (*get_status)(struct pcmcia_socket *sock, u_int *value);
112 int (*get_socket)(struct pcmcia_socket *sock, socket_state_t *state);
113 int (*set_socket)(struct pcmcia_socket *sock, socket_state_t *state);
114 int (*set_io_map)(struct pcmcia_socket *sock, struct pccard_io_map *io);
115 int (*set_mem_map)(struct pcmcia_socket *sock, struct pccard_mem_map *mem);
116};
117
118struct pccard_resource_ops {
119 void (*validate_mem) (struct pcmcia_socket *s);
120 int (*adjust_io_region) (struct resource *res,
121 unsigned long r_start,
122 unsigned long r_end,
123 struct pcmcia_socket *s);
124 struct resource* (*find_io) (unsigned long base, int num,
125 unsigned long align,
126 struct pcmcia_socket *s);
127 struct resource* (*find_mem) (unsigned long base, unsigned long num,
128 unsigned long align, int low,
129 struct pcmcia_socket *s);
130 int (*adjust_resource) (struct pcmcia_socket *s,
131 adjust_t *adj);
132 int (*init) (struct pcmcia_socket *s);
133 void (*exit) (struct pcmcia_socket *s);
134};
135/* SS_CAP_STATIC_MAP */
136extern struct pccard_resource_ops pccard_static_ops;
137/* !SS_CAP_STATIC_MAP */
138extern struct pccard_resource_ops pccard_nonstatic_ops;
139
140/*
141 * Calls to set up low-level "Socket Services" drivers
142 */
143struct pcmcia_socket;
144
145typedef struct io_window_t {
146 u_int Attributes;
147 kio_addr_t BasePort, NumPorts;
148 kio_addr_t InUse, Config;
149 struct resource *res;
150} io_window_t;
151
152#define WINDOW_MAGIC 0xB35C
153typedef struct window_t {
154 u_short magic;
155 u_short index;
156 client_handle_t handle;
157 struct pcmcia_socket *sock;
158 pccard_mem_map ctl;
159} window_t;
160
161/* Maximum number of IO windows per socket */
162#define MAX_IO_WIN 2
163
164/* Maximum number of memory windows per socket */
165#define MAX_WIN 4
166
167struct config_t;
168struct pcmcia_callback;
169
170
171struct pcmcia_socket {
172 struct module *owner;
173 spinlock_t lock;
174 socket_state_t socket;
175 u_int state;
176 u_short functions;
177 u_short lock_count;
178 pccard_mem_map cis_mem;
179 void __iomem *cis_virt;
180 struct config_t *config;
181 struct {
182 u_int AssignedIRQ;
183 u_int Config;
184 } irq;
185 io_window_t io[MAX_IO_WIN];
186 window_t win[MAX_WIN];
187 struct list_head cis_cache;
188 u_int fake_cis_len;
189 char *fake_cis;
190
191 struct list_head socket_list;
192 struct completion socket_released;
193
194 /* deprecated */
195 unsigned int sock; /* socket number */
196
197
198 /* socket capabilities */
199 u_int features;
200 u_int irq_mask;
201 u_int map_size;
202 kio_addr_t io_offset;
203 u_char pci_irq;
204 struct pci_dev * cb_dev;
205
206
207 /* socket setup is done so resources should be able to be allocated. Only
208 * if set to 1, calls to find_{io,mem}_region are handled, and insertion
209 * events are actually managed by the PCMCIA layer.*/
210 u8 resource_setup_done:1;
211
212 /* is set to one if resource setup is done using adjust_resource_info() */
213 u8 resource_setup_old:1;
214
215 u8 reserved:6;
216
217 /* socket operations */
218 struct pccard_operations * ops;
219 struct pccard_resource_ops * resource_ops;
220 void * resource_data;
221
222 /* Zoom video behaviour is so chip specific its not worth adding
223 this to _ops */
224 void (*zoom_video)(struct pcmcia_socket *, int);
225
226 /* state thread */
227 struct semaphore skt_sem; /* protects socket h/w state */
228
229 struct task_struct *thread;
230 struct completion thread_done;
231 wait_queue_head_t thread_wait;
232 spinlock_t thread_lock; /* protects thread_events */
233 unsigned int thread_events;
234
235 /* pcmcia (16-bit) */
236 struct pcmcia_bus_socket *pcmcia;
237 struct pcmcia_callback *callback;
238
239 /* cardbus (32-bit) */
240#ifdef CONFIG_CARDBUS
241 struct resource * cb_cis_res;
242 void __iomem *cb_cis_virt;
243#endif
244
245 /* socket device */
246 struct class_device dev;
247 void *driver_data; /* data internal to the socket driver */
248
249};
250
251struct pcmcia_socket * pcmcia_get_socket_by_nr(unsigned int nr);
252
253
254
255extern void pcmcia_parse_events(struct pcmcia_socket *socket, unsigned int events);
256extern int pcmcia_register_socket(struct pcmcia_socket *socket);
257extern void pcmcia_unregister_socket(struct pcmcia_socket *socket);
258
259extern struct class pcmcia_socket_class;
260
261/* socket drivers are expected to use these callbacks in their .drv struct */
262extern int pcmcia_socket_dev_suspend(struct device *dev, pm_message_t state);
263extern int pcmcia_socket_dev_resume(struct device *dev);
264
265#endif /* _LINUX_SS_H */
diff --git a/include/pcmcia/version.h b/include/pcmcia/version.h
new file mode 100644
index 000000000000..eb88263fc8d5
--- /dev/null
+++ b/include/pcmcia/version.h
@@ -0,0 +1,4 @@
1/* version.h 1.94 2000/10/03 17:55:48 (David Hinds) */
2
3#define CS_RELEASE "3.1.22"
4#define CS_RELEASE_CODE 0x3116