xref: /haiku/headers/os/drivers/pcmcia/cistpl.h (revision d7cd6603b45de62cd419064391d55befe495e3b5)
1*d7cd6603SJérôme Duval /*
2*d7cd6603SJérôme Duval  * cistpl.h 1.35 2001/08/24 12:16:12
3*d7cd6603SJérôme Duval  *
4*d7cd6603SJérôme Duval  * The contents of this file are subject to the Mozilla Public License
5*d7cd6603SJérôme Duval  * Version 1.1 (the "License"); you may not use this file except in
6*d7cd6603SJérôme Duval  * compliance with the License. You may obtain a copy of the License
7*d7cd6603SJérôme Duval  * at http://www.mozilla.org/MPL/
8*d7cd6603SJérôme Duval  *
9*d7cd6603SJérôme Duval  * Software distributed under the License is distributed on an "AS IS"
10*d7cd6603SJérôme Duval  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11*d7cd6603SJérôme Duval  * the License for the specific language governing rights and
12*d7cd6603SJérôme Duval  * limitations under the License.
13*d7cd6603SJérôme Duval  *
14*d7cd6603SJérôme Duval  * The initial developer of the original code is David A. Hinds
15*d7cd6603SJérôme Duval  * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
16*d7cd6603SJérôme Duval  * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
17*d7cd6603SJérôme Duval  *
18*d7cd6603SJérôme Duval  * Alternatively, the contents of this file may be used under the
19*d7cd6603SJérôme Duval  * terms of the GNU General Public License version 2 (the "GPL"), in
20*d7cd6603SJérôme Duval  * which case the provisions of the GPL are applicable instead of the
21*d7cd6603SJérôme Duval  * above.  If you wish to allow the use of your version of this file
22*d7cd6603SJérôme Duval  * only under the terms of the GPL and not to allow others to use
23*d7cd6603SJérôme Duval  * your version of this file under the MPL, indicate your decision by
24*d7cd6603SJérôme Duval  * deleting the provisions above and replace them with the notice and
25*d7cd6603SJérôme Duval  * other provisions required by the GPL.  If you do not delete the
26*d7cd6603SJérôme Duval  * provisions above, a recipient may use your version of this file
27*d7cd6603SJérôme Duval  * under either the MPL or the GPL.
28*d7cd6603SJérôme Duval  */
29*d7cd6603SJérôme Duval 
30*d7cd6603SJérôme Duval #ifndef _LINUX_CISTPL_H
31*d7cd6603SJérôme Duval #define _LINUX_CISTPL_H
32*d7cd6603SJérôme Duval 
33*d7cd6603SJérôme Duval #define CISTPL_NULL		0x00
34*d7cd6603SJérôme Duval #define CISTPL_DEVICE		0x01
35*d7cd6603SJérôme Duval #define CISTPL_LONGLINK_CB	0x02
36*d7cd6603SJérôme Duval #define CISTPL_INDIRECT		0x03
37*d7cd6603SJérôme Duval #define CISTPL_CONFIG_CB	0x04
38*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_ENTRY_CB	0x05
39*d7cd6603SJérôme Duval #define CISTPL_LONGLINK_MFC	0x06
40*d7cd6603SJérôme Duval #define CISTPL_BAR		0x07
41*d7cd6603SJérôme Duval #define CISTPL_PWR_MGMNT	0x08
42*d7cd6603SJérôme Duval #define CISTPL_EXTDEVICE	0x09
43*d7cd6603SJérôme Duval #define CISTPL_CHECKSUM		0x10
44*d7cd6603SJérôme Duval #define CISTPL_LONGLINK_A	0x11
45*d7cd6603SJérôme Duval #define CISTPL_LONGLINK_C	0x12
46*d7cd6603SJérôme Duval #define CISTPL_LINKTARGET	0x13
47*d7cd6603SJérôme Duval #define CISTPL_NO_LINK		0x14
48*d7cd6603SJérôme Duval #define CISTPL_VERS_1		0x15
49*d7cd6603SJérôme Duval #define CISTPL_ALTSTR		0x16
50*d7cd6603SJérôme Duval #define CISTPL_DEVICE_A		0x17
51*d7cd6603SJérôme Duval #define CISTPL_JEDEC_C		0x18
52*d7cd6603SJérôme Duval #define CISTPL_JEDEC_A		0x19
53*d7cd6603SJérôme Duval #define CISTPL_CONFIG		0x1a
54*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_ENTRY	0x1b
55*d7cd6603SJérôme Duval #define CISTPL_DEVICE_OC	0x1c
56*d7cd6603SJérôme Duval #define CISTPL_DEVICE_OA	0x1d
57*d7cd6603SJérôme Duval #define CISTPL_DEVICE_GEO	0x1e
58*d7cd6603SJérôme Duval #define CISTPL_DEVICE_GEO_A	0x1f
59*d7cd6603SJérôme Duval #define CISTPL_MANFID		0x20
60*d7cd6603SJérôme Duval #define CISTPL_FUNCID		0x21
61*d7cd6603SJérôme Duval #define CISTPL_FUNCE		0x22
62*d7cd6603SJérôme Duval #define CISTPL_SWIL		0x23
63*d7cd6603SJérôme Duval #define CISTPL_END		0xff
64*d7cd6603SJérôme Duval /* Layer 2 tuples */
65*d7cd6603SJérôme Duval #define CISTPL_VERS_2		0x40
66*d7cd6603SJérôme Duval #define CISTPL_FORMAT		0x41
67*d7cd6603SJérôme Duval #define CISTPL_GEOMETRY		0x42
68*d7cd6603SJérôme Duval #define CISTPL_BYTEORDER	0x43
69*d7cd6603SJérôme Duval #define CISTPL_DATE		0x44
70*d7cd6603SJérôme Duval #define CISTPL_BATTERY		0x45
71*d7cd6603SJérôme Duval #define CISTPL_FORMAT_A		0x47
72*d7cd6603SJérôme Duval /* Layer 3 tuples */
73*d7cd6603SJérôme Duval #define CISTPL_ORG		0x46
74*d7cd6603SJérôme Duval #define CISTPL_SPCL		0x90
75*d7cd6603SJérôme Duval 
76*d7cd6603SJérôme Duval typedef struct cistpl_longlink_t {
77*d7cd6603SJérôme Duval     u_int	addr;
78*d7cd6603SJérôme Duval } cistpl_longlink_t;
79*d7cd6603SJérôme Duval 
80*d7cd6603SJérôme Duval typedef struct cistpl_checksum_t {
81*d7cd6603SJérôme Duval     u_short	addr;
82*d7cd6603SJérôme Duval     u_short	len;
83*d7cd6603SJérôme Duval     u_char	sum;
84*d7cd6603SJérôme Duval } cistpl_checksum_t;
85*d7cd6603SJérôme Duval 
86*d7cd6603SJérôme Duval #define CISTPL_MAX_FUNCTIONS	8
87*d7cd6603SJérôme Duval #define CISTPL_MFC_ATTR		0x00
88*d7cd6603SJérôme Duval #define CISTPL_MFC_COMMON	0x01
89*d7cd6603SJérôme Duval 
90*d7cd6603SJérôme Duval typedef struct cistpl_longlink_mfc_t {
91*d7cd6603SJérôme Duval     u_char	nfn;
92*d7cd6603SJérôme Duval     struct {
93*d7cd6603SJérôme Duval 	u_char	space;
94*d7cd6603SJérôme Duval 	u_int	addr;
95*d7cd6603SJérôme Duval     } fn[CISTPL_MAX_FUNCTIONS];
96*d7cd6603SJérôme Duval } cistpl_longlink_mfc_t;
97*d7cd6603SJérôme Duval 
98*d7cd6603SJérôme Duval #define CISTPL_MAX_ALTSTR_STRINGS	4
99*d7cd6603SJérôme Duval 
100*d7cd6603SJérôme Duval typedef struct cistpl_altstr_t {
101*d7cd6603SJérôme Duval     u_char	ns;
102*d7cd6603SJérôme Duval     u_char	ofs[CISTPL_MAX_ALTSTR_STRINGS];
103*d7cd6603SJérôme Duval     char	str[254];
104*d7cd6603SJérôme Duval } cistpl_altstr_t;
105*d7cd6603SJérôme Duval 
106*d7cd6603SJérôme Duval #define CISTPL_DTYPE_NULL	0x00
107*d7cd6603SJérôme Duval #define CISTPL_DTYPE_ROM	0x01
108*d7cd6603SJérôme Duval #define CISTPL_DTYPE_OTPROM	0x02
109*d7cd6603SJérôme Duval #define CISTPL_DTYPE_EPROM	0x03
110*d7cd6603SJérôme Duval #define CISTPL_DTYPE_EEPROM	0x04
111*d7cd6603SJérôme Duval #define CISTPL_DTYPE_FLASH	0x05
112*d7cd6603SJérôme Duval #define CISTPL_DTYPE_SRAM	0x06
113*d7cd6603SJérôme Duval #define CISTPL_DTYPE_DRAM	0x07
114*d7cd6603SJérôme Duval #define CISTPL_DTYPE_FUNCSPEC	0x0d
115*d7cd6603SJérôme Duval #define CISTPL_DTYPE_EXTEND	0x0e
116*d7cd6603SJérôme Duval 
117*d7cd6603SJérôme Duval #define CISTPL_MAX_DEVICES	4
118*d7cd6603SJérôme Duval 
119*d7cd6603SJérôme Duval typedef struct cistpl_device_t {
120*d7cd6603SJérôme Duval     u_char	ndev;
121*d7cd6603SJérôme Duval     struct {
122*d7cd6603SJérôme Duval 	u_char 	type;
123*d7cd6603SJérôme Duval 	u_char	wp;
124*d7cd6603SJérôme Duval 	u_int	speed;
125*d7cd6603SJérôme Duval 	u_int	size;
126*d7cd6603SJérôme Duval     } dev[CISTPL_MAX_DEVICES];
127*d7cd6603SJérôme Duval } cistpl_device_t;
128*d7cd6603SJérôme Duval 
129*d7cd6603SJérôme Duval #define CISTPL_DEVICE_MWAIT	0x01
130*d7cd6603SJérôme Duval #define CISTPL_DEVICE_3VCC	0x02
131*d7cd6603SJérôme Duval 
132*d7cd6603SJérôme Duval typedef struct cistpl_device_o_t {
133*d7cd6603SJérôme Duval     u_char		flags;
134*d7cd6603SJérôme Duval     cistpl_device_t	device;
135*d7cd6603SJérôme Duval } cistpl_device_o_t;
136*d7cd6603SJérôme Duval 
137*d7cd6603SJérôme Duval #define CISTPL_VERS_1_MAX_PROD_STRINGS	4
138*d7cd6603SJérôme Duval 
139*d7cd6603SJérôme Duval typedef struct cistpl_vers_1_t {
140*d7cd6603SJérôme Duval     u_char	major;
141*d7cd6603SJérôme Duval     u_char	minor;
142*d7cd6603SJérôme Duval     u_char	ns;
143*d7cd6603SJérôme Duval     u_char	ofs[CISTPL_VERS_1_MAX_PROD_STRINGS];
144*d7cd6603SJérôme Duval     char	str[254];
145*d7cd6603SJérôme Duval } cistpl_vers_1_t;
146*d7cd6603SJérôme Duval 
147*d7cd6603SJérôme Duval typedef struct cistpl_jedec_t {
148*d7cd6603SJérôme Duval     u_char	nid;
149*d7cd6603SJérôme Duval     struct {
150*d7cd6603SJérôme Duval 	u_char	mfr;
151*d7cd6603SJérôme Duval 	u_char	info;
152*d7cd6603SJérôme Duval     } id[CISTPL_MAX_DEVICES];
153*d7cd6603SJérôme Duval } cistpl_jedec_t;
154*d7cd6603SJérôme Duval 
155*d7cd6603SJérôme Duval typedef struct cistpl_manfid_t {
156*d7cd6603SJérôme Duval     u_short	manf;
157*d7cd6603SJérôme Duval     u_short	card;
158*d7cd6603SJérôme Duval } cistpl_manfid_t;
159*d7cd6603SJérôme Duval 
160*d7cd6603SJérôme Duval #define CISTPL_FUNCID_MULTI	0x00
161*d7cd6603SJérôme Duval #define CISTPL_FUNCID_MEMORY	0x01
162*d7cd6603SJérôme Duval #define CISTPL_FUNCID_SERIAL	0x02
163*d7cd6603SJérôme Duval #define CISTPL_FUNCID_PARALLEL	0x03
164*d7cd6603SJérôme Duval #define CISTPL_FUNCID_FIXED	0x04
165*d7cd6603SJérôme Duval #define CISTPL_FUNCID_VIDEO	0x05
166*d7cd6603SJérôme Duval #define CISTPL_FUNCID_NETWORK	0x06
167*d7cd6603SJérôme Duval #define CISTPL_FUNCID_AIMS	0x07
168*d7cd6603SJérôme Duval #define CISTPL_FUNCID_SCSI	0x08
169*d7cd6603SJérôme Duval 
170*d7cd6603SJérôme Duval #define CISTPL_SYSINIT_POST	0x01
171*d7cd6603SJérôme Duval #define CISTPL_SYSINIT_ROM	0x02
172*d7cd6603SJérôme Duval 
173*d7cd6603SJérôme Duval typedef struct cistpl_funcid_t {
174*d7cd6603SJérôme Duval     u_char	func;
175*d7cd6603SJérôme Duval     u_char	sysinit;
176*d7cd6603SJérôme Duval } cistpl_funcid_t;
177*d7cd6603SJérôme Duval 
178*d7cd6603SJérôme Duval typedef struct cistpl_funce_t {
179*d7cd6603SJérôme Duval     u_char	type;
180*d7cd6603SJérôme Duval     u_char	data[0];
181*d7cd6603SJérôme Duval } cistpl_funce_t;
182*d7cd6603SJérôme Duval 
183*d7cd6603SJérôme Duval /*======================================================================
184*d7cd6603SJérôme Duval 
185*d7cd6603SJérôme Duval     Modem Function Extension Tuples
186*d7cd6603SJérôme Duval 
187*d7cd6603SJérôme Duval ======================================================================*/
188*d7cd6603SJérôme Duval 
189*d7cd6603SJérôme Duval #define CISTPL_FUNCE_SERIAL_IF		0x00
190*d7cd6603SJérôme Duval #define CISTPL_FUNCE_SERIAL_CAP		0x01
191*d7cd6603SJérôme Duval #define CISTPL_FUNCE_SERIAL_SERV_DATA	0x02
192*d7cd6603SJérôme Duval #define CISTPL_FUNCE_SERIAL_SERV_FAX	0x03
193*d7cd6603SJérôme Duval #define CISTPL_FUNCE_SERIAL_SERV_VOICE	0x04
194*d7cd6603SJérôme Duval #define CISTPL_FUNCE_SERIAL_CAP_DATA	0x05
195*d7cd6603SJérôme Duval #define CISTPL_FUNCE_SERIAL_CAP_FAX	0x06
196*d7cd6603SJérôme Duval #define CISTPL_FUNCE_SERIAL_CAP_VOICE	0x07
197*d7cd6603SJérôme Duval #define CISTPL_FUNCE_SERIAL_IF_DATA	0x08
198*d7cd6603SJérôme Duval #define CISTPL_FUNCE_SERIAL_IF_FAX	0x09
199*d7cd6603SJérôme Duval #define CISTPL_FUNCE_SERIAL_IF_VOICE	0x0a
200*d7cd6603SJérôme Duval 
201*d7cd6603SJérôme Duval /* UART identification */
202*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_8250		0x00
203*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_16450	0x01
204*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_16550	0x02
205*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_8251		0x03
206*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_8530		0x04
207*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_85230	0x05
208*d7cd6603SJérôme Duval 
209*d7cd6603SJérôme Duval /* UART capabilities */
210*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_SPACE	0x01
211*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_MARK		0x02
212*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_ODD		0x04
213*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_EVEN		0x08
214*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_5BIT		0x01
215*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_6BIT		0x02
216*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_7BIT		0x04
217*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_8BIT		0x08
218*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_1STOP	0x10
219*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_MSTOP	0x20
220*d7cd6603SJérôme Duval #define CISTPL_SERIAL_UART_2STOP	0x40
221*d7cd6603SJérôme Duval 
222*d7cd6603SJérôme Duval typedef struct cistpl_serial_t {
223*d7cd6603SJérôme Duval     u_char	uart_type;
224*d7cd6603SJérôme Duval     u_char	uart_cap_0;
225*d7cd6603SJérôme Duval     u_char	uart_cap_1;
226*d7cd6603SJérôme Duval } cistpl_serial_t;
227*d7cd6603SJérôme Duval 
228*d7cd6603SJérôme Duval typedef struct cistpl_modem_cap_t {
229*d7cd6603SJérôme Duval     u_char	flow;
230*d7cd6603SJérôme Duval     u_char	cmd_buf;
231*d7cd6603SJérôme Duval     u_char	rcv_buf_0, rcv_buf_1, rcv_buf_2;
232*d7cd6603SJérôme Duval     u_char	xmit_buf_0, xmit_buf_1, xmit_buf_2;
233*d7cd6603SJérôme Duval } cistpl_modem_cap_t;
234*d7cd6603SJérôme Duval 
235*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_103		0x01
236*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_V21		0x02
237*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_V23		0x04
238*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_V22		0x08
239*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_212A		0x10
240*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_V22BIS	0x20
241*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_V26		0x40
242*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_V26BIS	0x80
243*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_V27BIS	0x01
244*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_V29		0x02
245*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_V32		0x04
246*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_V32BIS	0x08
247*d7cd6603SJérôme Duval #define CISTPL_SERIAL_MOD_V34		0x10
248*d7cd6603SJérôme Duval 
249*d7cd6603SJérôme Duval #define CISTPL_SERIAL_ERR_MNP2_4	0x01
250*d7cd6603SJérôme Duval #define CISTPL_SERIAL_ERR_V42_LAPM	0x02
251*d7cd6603SJérôme Duval 
252*d7cd6603SJérôme Duval #define CISTPL_SERIAL_CMPR_V42BIS	0x01
253*d7cd6603SJérôme Duval #define CISTPL_SERIAL_CMPR_MNP5		0x02
254*d7cd6603SJérôme Duval 
255*d7cd6603SJérôme Duval #define CISTPL_SERIAL_CMD_AT1		0x01
256*d7cd6603SJérôme Duval #define CISTPL_SERIAL_CMD_AT2		0x02
257*d7cd6603SJérôme Duval #define CISTPL_SERIAL_CMD_AT3		0x04
258*d7cd6603SJérôme Duval #define CISTPL_SERIAL_CMD_MNP_AT	0x08
259*d7cd6603SJérôme Duval #define CISTPL_SERIAL_CMD_V25BIS	0x10
260*d7cd6603SJérôme Duval #define CISTPL_SERIAL_CMD_V25A		0x20
261*d7cd6603SJérôme Duval #define CISTPL_SERIAL_CMD_DMCL		0x40
262*d7cd6603SJérôme Duval 
263*d7cd6603SJérôme Duval typedef struct cistpl_data_serv_t {
264*d7cd6603SJérôme Duval     u_char	max_data_0;
265*d7cd6603SJérôme Duval     u_char	max_data_1;
266*d7cd6603SJérôme Duval     u_char	modulation_0;
267*d7cd6603SJérôme Duval     u_char	modulation_1;
268*d7cd6603SJérôme Duval     u_char	error_control;
269*d7cd6603SJérôme Duval     u_char	compression;
270*d7cd6603SJérôme Duval     u_char	cmd_protocol;
271*d7cd6603SJérôme Duval     u_char	escape;
272*d7cd6603SJérôme Duval     u_char	encrypt;
273*d7cd6603SJérôme Duval     u_char	misc_features;
274*d7cd6603SJérôme Duval     u_char	ccitt_code[0];
275*d7cd6603SJérôme Duval } cistpl_data_serv_t;
276*d7cd6603SJérôme Duval 
277*d7cd6603SJérôme Duval typedef struct cistpl_fax_serv_t {
278*d7cd6603SJérôme Duval     u_char	max_data_0;
279*d7cd6603SJérôme Duval     u_char	max_data_1;
280*d7cd6603SJérôme Duval     u_char	modulation;
281*d7cd6603SJérôme Duval     u_char	encrypt;
282*d7cd6603SJérôme Duval     u_char	features_0;
283*d7cd6603SJérôme Duval     u_char	features_1;
284*d7cd6603SJérôme Duval     u_char	ccitt_code[0];
285*d7cd6603SJérôme Duval } cistpl_fax_serv_t;
286*d7cd6603SJérôme Duval 
287*d7cd6603SJérôme Duval typedef struct cistpl_voice_serv_t {
288*d7cd6603SJérôme Duval     u_char	max_data_0;
289*d7cd6603SJérôme Duval     u_char	max_data_1;
290*d7cd6603SJérôme Duval } cistpl_voice_serv_t;
291*d7cd6603SJérôme Duval 
292*d7cd6603SJérôme Duval /*======================================================================
293*d7cd6603SJérôme Duval 
294*d7cd6603SJérôme Duval     LAN Function Extension Tuples
295*d7cd6603SJérôme Duval 
296*d7cd6603SJérôme Duval ======================================================================*/
297*d7cd6603SJérôme Duval 
298*d7cd6603SJérôme Duval #define CISTPL_FUNCE_LAN_TECH		0x01
299*d7cd6603SJérôme Duval #define CISTPL_FUNCE_LAN_SPEED		0x02
300*d7cd6603SJérôme Duval #define CISTPL_FUNCE_LAN_MEDIA		0x03
301*d7cd6603SJérôme Duval #define CISTPL_FUNCE_LAN_NODE_ID	0x04
302*d7cd6603SJérôme Duval #define CISTPL_FUNCE_LAN_CONNECTOR	0x05
303*d7cd6603SJérôme Duval 
304*d7cd6603SJérôme Duval /* LAN technologies */
305*d7cd6603SJérôme Duval #define CISTPL_LAN_TECH_ARCNET		0x01
306*d7cd6603SJérôme Duval #define CISTPL_LAN_TECH_ETHERNET	0x02
307*d7cd6603SJérôme Duval #define CISTPL_LAN_TECH_TOKENRING	0x03
308*d7cd6603SJérôme Duval #define CISTPL_LAN_TECH_LOCALTALK	0x04
309*d7cd6603SJérôme Duval #define CISTPL_LAN_TECH_FDDI		0x05
310*d7cd6603SJérôme Duval #define CISTPL_LAN_TECH_ATM		0x06
311*d7cd6603SJérôme Duval #define CISTPL_LAN_TECH_WIRELESS	0x07
312*d7cd6603SJérôme Duval 
313*d7cd6603SJérôme Duval typedef struct cistpl_lan_tech_t {
314*d7cd6603SJérôme Duval     u_char	tech;
315*d7cd6603SJérôme Duval } cistpl_lan_tech_t;
316*d7cd6603SJérôme Duval 
317*d7cd6603SJérôme Duval typedef struct cistpl_lan_speed_t {
318*d7cd6603SJérôme Duval     u_int	speed;
319*d7cd6603SJérôme Duval } cistpl_lan_speed_t;
320*d7cd6603SJérôme Duval 
321*d7cd6603SJérôme Duval /* LAN media definitions */
322*d7cd6603SJérôme Duval #define CISTPL_LAN_MEDIA_UTP		0x01
323*d7cd6603SJérôme Duval #define CISTPL_LAN_MEDIA_STP		0x02
324*d7cd6603SJérôme Duval #define CISTPL_LAN_MEDIA_THIN_COAX	0x03
325*d7cd6603SJérôme Duval #define CISTPL_LAN_MEDIA_THICK_COAX	0x04
326*d7cd6603SJérôme Duval #define CISTPL_LAN_MEDIA_FIBER		0x05
327*d7cd6603SJérôme Duval #define CISTPL_LAN_MEDIA_900MHZ		0x06
328*d7cd6603SJérôme Duval #define CISTPL_LAN_MEDIA_2GHZ		0x07
329*d7cd6603SJérôme Duval #define CISTPL_LAN_MEDIA_5GHZ		0x08
330*d7cd6603SJérôme Duval #define CISTPL_LAN_MEDIA_DIFF_IR	0x09
331*d7cd6603SJérôme Duval #define CISTPL_LAN_MEDIA_PTP_IR		0x0a
332*d7cd6603SJérôme Duval 
333*d7cd6603SJérôme Duval typedef struct cistpl_lan_media_t {
334*d7cd6603SJérôme Duval     u_char	media;
335*d7cd6603SJérôme Duval } cistpl_lan_media_t;
336*d7cd6603SJérôme Duval 
337*d7cd6603SJérôme Duval typedef struct cistpl_lan_node_id_t {
338*d7cd6603SJérôme Duval     u_char	nb;
339*d7cd6603SJérôme Duval     u_char	id[16];
340*d7cd6603SJérôme Duval } cistpl_lan_node_id_t;
341*d7cd6603SJérôme Duval 
342*d7cd6603SJérôme Duval typedef struct cistpl_lan_connector_t {
343*d7cd6603SJérôme Duval     u_char	code;
344*d7cd6603SJérôme Duval } cistpl_lan_connector_t;
345*d7cd6603SJérôme Duval 
346*d7cd6603SJérôme Duval /*======================================================================
347*d7cd6603SJérôme Duval 
348*d7cd6603SJérôme Duval     IDE Function Extension Tuples
349*d7cd6603SJérôme Duval 
350*d7cd6603SJérôme Duval ======================================================================*/
351*d7cd6603SJérôme Duval 
352*d7cd6603SJérôme Duval #define CISTPL_IDE_INTERFACE		0x01
353*d7cd6603SJérôme Duval 
354*d7cd6603SJérôme Duval typedef struct cistpl_ide_interface_t {
355*d7cd6603SJérôme Duval     u_char	interface;
356*d7cd6603SJérôme Duval } cistpl_ide_interface_t;
357*d7cd6603SJérôme Duval 
358*d7cd6603SJérôme Duval /* First feature byte */
359*d7cd6603SJérôme Duval #define CISTPL_IDE_SILICON		0x04
360*d7cd6603SJérôme Duval #define CISTPL_IDE_UNIQUE		0x08
361*d7cd6603SJérôme Duval #define CISTPL_IDE_DUAL			0x10
362*d7cd6603SJérôme Duval 
363*d7cd6603SJérôme Duval /* Second feature byte */
364*d7cd6603SJérôme Duval #define CISTPL_IDE_HAS_SLEEP		0x01
365*d7cd6603SJérôme Duval #define CISTPL_IDE_HAS_STANDBY		0x02
366*d7cd6603SJérôme Duval #define CISTPL_IDE_HAS_IDLE		0x04
367*d7cd6603SJérôme Duval #define CISTPL_IDE_LOW_POWER		0x08
368*d7cd6603SJérôme Duval #define CISTPL_IDE_REG_INHIBIT		0x10
369*d7cd6603SJérôme Duval #define CISTPL_IDE_HAS_INDEX		0x20
370*d7cd6603SJérôme Duval #define CISTPL_IDE_IOIS16		0x40
371*d7cd6603SJérôme Duval 
372*d7cd6603SJérôme Duval typedef struct cistpl_ide_feature_t {
373*d7cd6603SJérôme Duval     u_char	feature1;
374*d7cd6603SJérôme Duval     u_char	feature2;
375*d7cd6603SJérôme Duval } cistpl_ide_feature_t;
376*d7cd6603SJérôme Duval 
377*d7cd6603SJérôme Duval #define CISTPL_FUNCE_IDE_IFACE		0x01
378*d7cd6603SJérôme Duval #define CISTPL_FUNCE_IDE_MASTER		0x02
379*d7cd6603SJérôme Duval #define CISTPL_FUNCE_IDE_SLAVE		0x03
380*d7cd6603SJérôme Duval 
381*d7cd6603SJérôme Duval /*======================================================================
382*d7cd6603SJérôme Duval 
383*d7cd6603SJérôme Duval     Configuration Table Entries
384*d7cd6603SJérôme Duval 
385*d7cd6603SJérôme Duval ======================================================================*/
386*d7cd6603SJérôme Duval 
387*d7cd6603SJérôme Duval #define CISTPL_BAR_SPACE	0x07
388*d7cd6603SJérôme Duval #define CISTPL_BAR_SPACE_IO	0x10
389*d7cd6603SJérôme Duval #define CISTPL_BAR_PREFETCH	0x20
390*d7cd6603SJérôme Duval #define CISTPL_BAR_CACHEABLE	0x40
391*d7cd6603SJérôme Duval #define CISTPL_BAR_1MEG_MAP	0x80
392*d7cd6603SJérôme Duval 
393*d7cd6603SJérôme Duval typedef struct cistpl_bar_t {
394*d7cd6603SJérôme Duval     u_char	attr;
395*d7cd6603SJérôme Duval     u_int	size;
396*d7cd6603SJérôme Duval } cistpl_bar_t;
397*d7cd6603SJérôme Duval 
398*d7cd6603SJérôme Duval typedef struct cistpl_config_t {
399*d7cd6603SJérôme Duval     u_char	last_idx;
400*d7cd6603SJérôme Duval     u_int	base;
401*d7cd6603SJérôme Duval     u_int	rmask[4];
402*d7cd6603SJérôme Duval     u_char	subtuples;
403*d7cd6603SJérôme Duval } cistpl_config_t;
404*d7cd6603SJérôme Duval 
405*d7cd6603SJérôme Duval /* These are bits in the 'present' field, and indices in 'param' */
406*d7cd6603SJérôme Duval #define CISTPL_POWER_VNOM	0
407*d7cd6603SJérôme Duval #define CISTPL_POWER_VMIN	1
408*d7cd6603SJérôme Duval #define CISTPL_POWER_VMAX	2
409*d7cd6603SJérôme Duval #define CISTPL_POWER_ISTATIC	3
410*d7cd6603SJérôme Duval #define CISTPL_POWER_IAVG	4
411*d7cd6603SJérôme Duval #define CISTPL_POWER_IPEAK	5
412*d7cd6603SJérôme Duval #define CISTPL_POWER_IDOWN	6
413*d7cd6603SJérôme Duval 
414*d7cd6603SJérôme Duval #define CISTPL_POWER_HIGHZ_OK	0x01
415*d7cd6603SJérôme Duval #define CISTPL_POWER_HIGHZ_REQ	0x02
416*d7cd6603SJérôme Duval 
417*d7cd6603SJérôme Duval typedef struct cistpl_power_t {
418*d7cd6603SJérôme Duval     u_char	present;
419*d7cd6603SJérôme Duval     u_char	flags;
420*d7cd6603SJérôme Duval     u_int	param[7];
421*d7cd6603SJérôme Duval } cistpl_power_t;
422*d7cd6603SJérôme Duval 
423*d7cd6603SJérôme Duval typedef struct cistpl_timing_t {
424*d7cd6603SJérôme Duval     u_int	wait, waitscale;
425*d7cd6603SJérôme Duval     u_int	ready, rdyscale;
426*d7cd6603SJérôme Duval     u_int	reserved, rsvscale;
427*d7cd6603SJérôme Duval } cistpl_timing_t;
428*d7cd6603SJérôme Duval 
429*d7cd6603SJérôme Duval #define CISTPL_IO_LINES_MASK	0x1f
430*d7cd6603SJérôme Duval #define CISTPL_IO_8BIT		0x20
431*d7cd6603SJérôme Duval #define CISTPL_IO_16BIT		0x40
432*d7cd6603SJérôme Duval #define CISTPL_IO_RANGE		0x80
433*d7cd6603SJérôme Duval 
434*d7cd6603SJérôme Duval #define CISTPL_IO_MAX_WIN	16
435*d7cd6603SJérôme Duval 
436*d7cd6603SJérôme Duval typedef struct cistpl_io_t {
437*d7cd6603SJérôme Duval     u_char	flags;
438*d7cd6603SJérôme Duval     u_char	nwin;
439*d7cd6603SJérôme Duval     struct {
440*d7cd6603SJérôme Duval 	u_int	base;
441*d7cd6603SJérôme Duval 	u_int	len;
442*d7cd6603SJérôme Duval     } win[CISTPL_IO_MAX_WIN];
443*d7cd6603SJérôme Duval } cistpl_io_t;
444*d7cd6603SJérôme Duval 
445*d7cd6603SJérôme Duval typedef struct cistpl_irq_t {
446*d7cd6603SJérôme Duval     u_int	IRQInfo1;
447*d7cd6603SJérôme Duval     u_int	IRQInfo2;
448*d7cd6603SJérôme Duval } cistpl_irq_t;
449*d7cd6603SJérôme Duval 
450*d7cd6603SJérôme Duval #define CISTPL_MEM_MAX_WIN	8
451*d7cd6603SJérôme Duval 
452*d7cd6603SJérôme Duval typedef struct cistpl_mem_t {
453*d7cd6603SJérôme Duval     u_char	flags;
454*d7cd6603SJérôme Duval     u_char	nwin;
455*d7cd6603SJérôme Duval     struct {
456*d7cd6603SJérôme Duval 	u_int	len;
457*d7cd6603SJérôme Duval 	u_int	card_addr;
458*d7cd6603SJérôme Duval 	u_int	host_addr;
459*d7cd6603SJérôme Duval     } win[CISTPL_MEM_MAX_WIN];
460*d7cd6603SJérôme Duval } cistpl_mem_t;
461*d7cd6603SJérôme Duval 
462*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_DEFAULT		0x0001
463*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_BVDS		0x0002
464*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_WP		0x0004
465*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_RDYBSY		0x0008
466*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_MWAIT		0x0010
467*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_AUDIO		0x0800
468*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_READONLY		0x1000
469*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_PWRDOWN		0x2000
470*d7cd6603SJérôme Duval 
471*d7cd6603SJérôme Duval typedef struct cistpl_cftable_entry_t {
472*d7cd6603SJérôme Duval     u_char		index;
473*d7cd6603SJérôme Duval     u_short		flags;
474*d7cd6603SJérôme Duval     u_char		interface;
475*d7cd6603SJérôme Duval     cistpl_power_t	vcc, vpp1, vpp2;
476*d7cd6603SJérôme Duval     cistpl_timing_t	timing;
477*d7cd6603SJérôme Duval     cistpl_io_t		io;
478*d7cd6603SJérôme Duval     cistpl_irq_t	irq;
479*d7cd6603SJérôme Duval     cistpl_mem_t	mem;
480*d7cd6603SJérôme Duval     u_char		subtuples;
481*d7cd6603SJérôme Duval } cistpl_cftable_entry_t;
482*d7cd6603SJérôme Duval 
483*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_MASTER		0x000100
484*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_INVALIDATE	0x000200
485*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_VGA_PALETTE	0x000400
486*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_PARITY		0x000800
487*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_WAIT		0x001000
488*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_SERR		0x002000
489*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_FAST_BACK	0x004000
490*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_BINARY_AUDIO	0x010000
491*d7cd6603SJérôme Duval #define CISTPL_CFTABLE_PWM_AUDIO	0x020000
492*d7cd6603SJérôme Duval 
493*d7cd6603SJérôme Duval typedef struct cistpl_cftable_entry_cb_t {
494*d7cd6603SJérôme Duval     u_char		index;
495*d7cd6603SJérôme Duval     u_int		flags;
496*d7cd6603SJérôme Duval     cistpl_power_t	vcc, vpp1, vpp2;
497*d7cd6603SJérôme Duval     u_char		io;
498*d7cd6603SJérôme Duval     cistpl_irq_t	irq;
499*d7cd6603SJérôme Duval     u_char		mem;
500*d7cd6603SJérôme Duval     u_char		subtuples;
501*d7cd6603SJérôme Duval } cistpl_cftable_entry_cb_t;
502*d7cd6603SJérôme Duval 
503*d7cd6603SJérôme Duval typedef struct cistpl_device_geo_t {
504*d7cd6603SJérôme Duval     u_char		ngeo;
505*d7cd6603SJérôme Duval     struct {
506*d7cd6603SJérôme Duval 	u_char		buswidth;
507*d7cd6603SJérôme Duval 	u_int		erase_block;
508*d7cd6603SJérôme Duval 	u_int		read_block;
509*d7cd6603SJérôme Duval 	u_int		write_block;
510*d7cd6603SJérôme Duval 	u_int		partition;
511*d7cd6603SJérôme Duval 	u_int		interleave;
512*d7cd6603SJérôme Duval     } geo[CISTPL_MAX_DEVICES];
513*d7cd6603SJérôme Duval } cistpl_device_geo_t;
514*d7cd6603SJérôme Duval 
515*d7cd6603SJérôme Duval typedef struct cistpl_vers_2_t {
516*d7cd6603SJérôme Duval     u_char	vers;
517*d7cd6603SJérôme Duval     u_char	comply;
518*d7cd6603SJérôme Duval     u_short	dindex;
519*d7cd6603SJérôme Duval     u_char	vspec8, vspec9;
520*d7cd6603SJérôme Duval     u_char	nhdr;
521*d7cd6603SJérôme Duval     u_char	vendor, info;
522*d7cd6603SJérôme Duval     char	str[244];
523*d7cd6603SJérôme Duval } cistpl_vers_2_t;
524*d7cd6603SJérôme Duval 
525*d7cd6603SJérôme Duval typedef struct cistpl_org_t {
526*d7cd6603SJérôme Duval     u_char	data_org;
527*d7cd6603SJérôme Duval     char	desc[30];
528*d7cd6603SJérôme Duval } cistpl_org_t;
529*d7cd6603SJérôme Duval 
530*d7cd6603SJérôme Duval #define CISTPL_ORG_FS		0x00
531*d7cd6603SJérôme Duval #define CISTPL_ORG_APPSPEC	0x01
532*d7cd6603SJérôme Duval #define CISTPL_ORG_XIP		0x02
533*d7cd6603SJérôme Duval 
534*d7cd6603SJérôme Duval typedef struct cistpl_format_t {
535*d7cd6603SJérôme Duval     u_char	type;
536*d7cd6603SJérôme Duval     u_char	edc;
537*d7cd6603SJérôme Duval     u_int	offset;
538*d7cd6603SJérôme Duval     u_int	length;
539*d7cd6603SJérôme Duval } cistpl_format_t;
540*d7cd6603SJérôme Duval 
541*d7cd6603SJérôme Duval #define CISTPL_FORMAT_DISK	0x00
542*d7cd6603SJérôme Duval #define CISTPL_FORMAT_MEM	0x01
543*d7cd6603SJérôme Duval 
544*d7cd6603SJérôme Duval #define CISTPL_EDC_NONE		0x00
545*d7cd6603SJérôme Duval #define CISTPL_EDC_CKSUM	0x01
546*d7cd6603SJérôme Duval #define CISTPL_EDC_CRC		0x02
547*d7cd6603SJérôme Duval #define CISTPL_EDC_PCC		0x03
548*d7cd6603SJérôme Duval 
549*d7cd6603SJérôme Duval typedef union cisparse_t {
550*d7cd6603SJérôme Duval     cistpl_device_t		device;
551*d7cd6603SJérôme Duval     cistpl_checksum_t		checksum;
552*d7cd6603SJérôme Duval     cistpl_longlink_t		longlink;
553*d7cd6603SJérôme Duval     cistpl_longlink_mfc_t	longlink_mfc;
554*d7cd6603SJérôme Duval     cistpl_vers_1_t		version_1;
555*d7cd6603SJérôme Duval     cistpl_altstr_t		altstr;
556*d7cd6603SJérôme Duval     cistpl_jedec_t		jedec;
557*d7cd6603SJérôme Duval     cistpl_manfid_t		manfid;
558*d7cd6603SJérôme Duval     cistpl_funcid_t		funcid;
559*d7cd6603SJérôme Duval     cistpl_funce_t		funce;
560*d7cd6603SJérôme Duval     cistpl_bar_t		bar;
561*d7cd6603SJérôme Duval     cistpl_config_t		config;
562*d7cd6603SJérôme Duval     cistpl_cftable_entry_t	cftable_entry;
563*d7cd6603SJérôme Duval     cistpl_cftable_entry_cb_t	cftable_entry_cb;
564*d7cd6603SJérôme Duval     cistpl_device_geo_t		device_geo;
565*d7cd6603SJérôme Duval     cistpl_vers_2_t		vers_2;
566*d7cd6603SJérôme Duval     cistpl_org_t		org;
567*d7cd6603SJérôme Duval     cistpl_format_t		format;
568*d7cd6603SJérôme Duval } cisparse_t;
569*d7cd6603SJérôme Duval 
570*d7cd6603SJérôme Duval typedef struct tuple_t {
571*d7cd6603SJérôme Duval     u_int	Attributes;
572*d7cd6603SJérôme Duval     cisdata_t 	DesiredTuple;
573*d7cd6603SJérôme Duval     u_int	Flags;		/* internal use */
574*d7cd6603SJérôme Duval     u_int	LinkOffset;	/* internal use */
575*d7cd6603SJérôme Duval     u_int	CISOffset;	/* internal use */
576*d7cd6603SJérôme Duval     cisdata_t	TupleCode;
577*d7cd6603SJérôme Duval     cisdata_t	TupleLink;
578*d7cd6603SJérôme Duval     cisdata_t	TupleOffset;
579*d7cd6603SJérôme Duval     cisdata_t	TupleDataMax;
580*d7cd6603SJérôme Duval     cisdata_t	TupleDataLen;
581*d7cd6603SJérôme Duval     cisdata_t	*TupleData;
582*d7cd6603SJérôme Duval } tuple_t;
583*d7cd6603SJérôme Duval 
584*d7cd6603SJérôme Duval /* Special cisdata_t value */
585*d7cd6603SJérôme Duval #define RETURN_FIRST_TUPLE	0xff
586*d7cd6603SJérôme Duval 
587*d7cd6603SJérôme Duval /* Attributes for tuple calls */
588*d7cd6603SJérôme Duval #define TUPLE_RETURN_LINK	0x01
589*d7cd6603SJérôme Duval #define TUPLE_RETURN_COMMON	0x02
590*d7cd6603SJérôme Duval 
591*d7cd6603SJérôme Duval /* For ValidateCIS */
592*d7cd6603SJérôme Duval typedef struct cisinfo_t {
593*d7cd6603SJérôme Duval     u_int	Chains;
594*d7cd6603SJérôme Duval } cisinfo_t;
595*d7cd6603SJérôme Duval 
596*d7cd6603SJérôme Duval #define CISTPL_MAX_CIS_SIZE	0x200
597*d7cd6603SJérôme Duval 
598*d7cd6603SJérôme Duval /* For ReplaceCIS */
599*d7cd6603SJérôme Duval typedef struct cisdump_t {
600*d7cd6603SJérôme Duval     u_int	Length;
601*d7cd6603SJérôme Duval     cisdata_t	Data[CISTPL_MAX_CIS_SIZE];
602*d7cd6603SJérôme Duval } cisdump_t;
603*d7cd6603SJérôme Duval 
604*d7cd6603SJérôme Duval #endif /* LINUX_CISTPL_H */
605