Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cistpl.h
Go to the documentation of this file.
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  * <[email protected]>. 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 typedef unsigned char cisdata_t;
19 
20 #define CISTPL_NULL 0x00
21 #define CISTPL_DEVICE 0x01
22 #define CISTPL_LONGLINK_CB 0x02
23 #define CISTPL_INDIRECT 0x03
24 #define CISTPL_CONFIG_CB 0x04
25 #define CISTPL_CFTABLE_ENTRY_CB 0x05
26 #define CISTPL_LONGLINK_MFC 0x06
27 #define CISTPL_BAR 0x07
28 #define CISTPL_PWR_MGMNT 0x08
29 #define CISTPL_EXTDEVICE 0x09
30 #define CISTPL_CHECKSUM 0x10
31 #define CISTPL_LONGLINK_A 0x11
32 #define CISTPL_LONGLINK_C 0x12
33 #define CISTPL_LINKTARGET 0x13
34 #define CISTPL_NO_LINK 0x14
35 #define CISTPL_VERS_1 0x15
36 #define CISTPL_ALTSTR 0x16
37 #define CISTPL_DEVICE_A 0x17
38 #define CISTPL_JEDEC_C 0x18
39 #define CISTPL_JEDEC_A 0x19
40 #define CISTPL_CONFIG 0x1a
41 #define CISTPL_CFTABLE_ENTRY 0x1b
42 #define CISTPL_DEVICE_OC 0x1c
43 #define CISTPL_DEVICE_OA 0x1d
44 #define CISTPL_DEVICE_GEO 0x1e
45 #define CISTPL_DEVICE_GEO_A 0x1f
46 #define CISTPL_MANFID 0x20
47 #define CISTPL_FUNCID 0x21
48 #define CISTPL_FUNCE 0x22
49 #define CISTPL_SWIL 0x23
50 #define CISTPL_END 0xff
51 /* Layer 2 tuples */
52 #define CISTPL_VERS_2 0x40
53 #define CISTPL_FORMAT 0x41
54 #define CISTPL_GEOMETRY 0x42
55 #define CISTPL_BYTEORDER 0x43
56 #define CISTPL_DATE 0x44
57 #define CISTPL_BATTERY 0x45
58 #define CISTPL_FORMAT_A 0x47
59 /* Layer 3 tuples */
60 #define CISTPL_ORG 0x46
61 #define CISTPL_SPCL 0x90
62 
63 typedef struct cistpl_longlink_t {
66 
67 typedef struct cistpl_checksum_t {
72 
73 #define CISTPL_MAX_FUNCTIONS 8
74 #define CISTPL_MFC_ATTR 0x00
75 #define CISTPL_MFC_COMMON 0x01
76 
77 typedef struct cistpl_longlink_mfc_t {
79  struct {
84 
85 #define CISTPL_MAX_ALTSTR_STRINGS 4
86 
87 typedef struct cistpl_altstr_t {
90  char str[254];
92 
93 #define CISTPL_DTYPE_NULL 0x00
94 #define CISTPL_DTYPE_ROM 0x01
95 #define CISTPL_DTYPE_OTPROM 0x02
96 #define CISTPL_DTYPE_EPROM 0x03
97 #define CISTPL_DTYPE_EEPROM 0x04
98 #define CISTPL_DTYPE_FLASH 0x05
99 #define CISTPL_DTYPE_SRAM 0x06
100 #define CISTPL_DTYPE_DRAM 0x07
101 #define CISTPL_DTYPE_FUNCSPEC 0x0d
102 #define CISTPL_DTYPE_EXTEND 0x0e
103 
104 #define CISTPL_MAX_DEVICES 4
105 
106 typedef struct cistpl_device_t {
108  struct {
115 
116 #define CISTPL_DEVICE_MWAIT 0x01
117 #define CISTPL_DEVICE_3VCC 0x02
118 
119 typedef struct cistpl_device_o_t {
123 
124 #define CISTPL_VERS_1_MAX_PROD_STRINGS 4
125 
126 typedef struct cistpl_vers_1_t {
131  char str[254];
133 
134 typedef struct cistpl_jedec_t {
136  struct {
139  } id[CISTPL_MAX_DEVICES];
141 
142 typedef struct cistpl_manfid_t {
146 
147 #define CISTPL_FUNCID_MULTI 0x00
148 #define CISTPL_FUNCID_MEMORY 0x01
149 #define CISTPL_FUNCID_SERIAL 0x02
150 #define CISTPL_FUNCID_PARALLEL 0x03
151 #define CISTPL_FUNCID_FIXED 0x04
152 #define CISTPL_FUNCID_VIDEO 0x05
153 #define CISTPL_FUNCID_NETWORK 0x06
154 #define CISTPL_FUNCID_AIMS 0x07
155 #define CISTPL_FUNCID_SCSI 0x08
156 
157 #define CISTPL_SYSINIT_POST 0x01
158 #define CISTPL_SYSINIT_ROM 0x02
159 
160 typedef struct cistpl_funcid_t {
164 
165 typedef struct cistpl_funce_t {
169 
170 /*======================================================================
171 
172  Modem Function Extension Tuples
173 
174 ======================================================================*/
175 
176 #define CISTPL_FUNCE_SERIAL_IF 0x00
177 #define CISTPL_FUNCE_SERIAL_CAP 0x01
178 #define CISTPL_FUNCE_SERIAL_SERV_DATA 0x02
179 #define CISTPL_FUNCE_SERIAL_SERV_FAX 0x03
180 #define CISTPL_FUNCE_SERIAL_SERV_VOICE 0x04
181 #define CISTPL_FUNCE_SERIAL_CAP_DATA 0x05
182 #define CISTPL_FUNCE_SERIAL_CAP_FAX 0x06
183 #define CISTPL_FUNCE_SERIAL_CAP_VOICE 0x07
184 #define CISTPL_FUNCE_SERIAL_IF_DATA 0x08
185 #define CISTPL_FUNCE_SERIAL_IF_FAX 0x09
186 #define CISTPL_FUNCE_SERIAL_IF_VOICE 0x0a
187 
188 /* UART identification */
189 #define CISTPL_SERIAL_UART_8250 0x00
190 #define CISTPL_SERIAL_UART_16450 0x01
191 #define CISTPL_SERIAL_UART_16550 0x02
192 #define CISTPL_SERIAL_UART_8251 0x03
193 #define CISTPL_SERIAL_UART_8530 0x04
194 #define CISTPL_SERIAL_UART_85230 0x05
195 
196 /* UART capabilities */
197 #define CISTPL_SERIAL_UART_SPACE 0x01
198 #define CISTPL_SERIAL_UART_MARK 0x02
199 #define CISTPL_SERIAL_UART_ODD 0x04
200 #define CISTPL_SERIAL_UART_EVEN 0x08
201 #define CISTPL_SERIAL_UART_5BIT 0x01
202 #define CISTPL_SERIAL_UART_6BIT 0x02
203 #define CISTPL_SERIAL_UART_7BIT 0x04
204 #define CISTPL_SERIAL_UART_8BIT 0x08
205 #define CISTPL_SERIAL_UART_1STOP 0x10
206 #define CISTPL_SERIAL_UART_MSTOP 0x20
207 #define CISTPL_SERIAL_UART_2STOP 0x40
208 
209 typedef struct cistpl_serial_t {
214 
215 typedef struct cistpl_modem_cap_t {
221 
222 #define CISTPL_SERIAL_MOD_103 0x01
223 #define CISTPL_SERIAL_MOD_V21 0x02
224 #define CISTPL_SERIAL_MOD_V23 0x04
225 #define CISTPL_SERIAL_MOD_V22 0x08
226 #define CISTPL_SERIAL_MOD_212A 0x10
227 #define CISTPL_SERIAL_MOD_V22BIS 0x20
228 #define CISTPL_SERIAL_MOD_V26 0x40
229 #define CISTPL_SERIAL_MOD_V26BIS 0x80
230 #define CISTPL_SERIAL_MOD_V27BIS 0x01
231 #define CISTPL_SERIAL_MOD_V29 0x02
232 #define CISTPL_SERIAL_MOD_V32 0x04
233 #define CISTPL_SERIAL_MOD_V32BIS 0x08
234 #define CISTPL_SERIAL_MOD_V34 0x10
235 
236 #define CISTPL_SERIAL_ERR_MNP2_4 0x01
237 #define CISTPL_SERIAL_ERR_V42_LAPM 0x02
238 
239 #define CISTPL_SERIAL_CMPR_V42BIS 0x01
240 #define CISTPL_SERIAL_CMPR_MNP5 0x02
241 
242 #define CISTPL_SERIAL_CMD_AT1 0x01
243 #define CISTPL_SERIAL_CMD_AT2 0x02
244 #define CISTPL_SERIAL_CMD_AT3 0x04
245 #define CISTPL_SERIAL_CMD_MNP_AT 0x08
246 #define CISTPL_SERIAL_CMD_V25BIS 0x10
247 #define CISTPL_SERIAL_CMD_V25A 0x20
248 #define CISTPL_SERIAL_CMD_DMCL 0x40
249 
250 typedef struct cistpl_data_serv_t {
263 
264 typedef struct cistpl_fax_serv_t {
273 
274 typedef struct cistpl_voice_serv_t {
278 
279 /*======================================================================
280 
281  LAN Function Extension Tuples
282 
283 ======================================================================*/
284 
285 #define CISTPL_FUNCE_LAN_TECH 0x01
286 #define CISTPL_FUNCE_LAN_SPEED 0x02
287 #define CISTPL_FUNCE_LAN_MEDIA 0x03
288 #define CISTPL_FUNCE_LAN_NODE_ID 0x04
289 #define CISTPL_FUNCE_LAN_CONNECTOR 0x05
290 
291 /* LAN technologies */
292 #define CISTPL_LAN_TECH_ARCNET 0x01
293 #define CISTPL_LAN_TECH_ETHERNET 0x02
294 #define CISTPL_LAN_TECH_TOKENRING 0x03
295 #define CISTPL_LAN_TECH_LOCALTALK 0x04
296 #define CISTPL_LAN_TECH_FDDI 0x05
297 #define CISTPL_LAN_TECH_ATM 0x06
298 #define CISTPL_LAN_TECH_WIRELESS 0x07
299 
300 typedef struct cistpl_lan_tech_t {
303 
304 typedef struct cistpl_lan_speed_t {
307 
308 /* LAN media definitions */
309 #define CISTPL_LAN_MEDIA_UTP 0x01
310 #define CISTPL_LAN_MEDIA_STP 0x02
311 #define CISTPL_LAN_MEDIA_THIN_COAX 0x03
312 #define CISTPL_LAN_MEDIA_THICK_COAX 0x04
313 #define CISTPL_LAN_MEDIA_FIBER 0x05
314 #define CISTPL_LAN_MEDIA_900MHZ 0x06
315 #define CISTPL_LAN_MEDIA_2GHZ 0x07
316 #define CISTPL_LAN_MEDIA_5GHZ 0x08
317 #define CISTPL_LAN_MEDIA_DIFF_IR 0x09
318 #define CISTPL_LAN_MEDIA_PTP_IR 0x0a
319 
320 typedef struct cistpl_lan_media_t {
323 
324 typedef struct cistpl_lan_node_id_t {
326  u_char id[16];
328 
329 typedef struct cistpl_lan_connector_t {
332 
333 /*======================================================================
334 
335  IDE Function Extension Tuples
336 
337 ======================================================================*/
338 
339 #define CISTPL_IDE_INTERFACE 0x01
340 
341 typedef struct cistpl_ide_interface_t {
344 
345 /* First feature byte */
346 #define CISTPL_IDE_SILICON 0x04
347 #define CISTPL_IDE_UNIQUE 0x08
348 #define CISTPL_IDE_DUAL 0x10
349 
350 /* Second feature byte */
351 #define CISTPL_IDE_HAS_SLEEP 0x01
352 #define CISTPL_IDE_HAS_STANDBY 0x02
353 #define CISTPL_IDE_HAS_IDLE 0x04
354 #define CISTPL_IDE_LOW_POWER 0x08
355 #define CISTPL_IDE_REG_INHIBIT 0x10
356 #define CISTPL_IDE_HAS_INDEX 0x20
357 #define CISTPL_IDE_IOIS16 0x40
358 
359 typedef struct cistpl_ide_feature_t {
363 
364 #define CISTPL_FUNCE_IDE_IFACE 0x01
365 #define CISTPL_FUNCE_IDE_MASTER 0x02
366 #define CISTPL_FUNCE_IDE_SLAVE 0x03
367 
368 /*======================================================================
369 
370  Configuration Table Entries
371 
372 ======================================================================*/
373 
374 #define CISTPL_BAR_SPACE 0x07
375 #define CISTPL_BAR_SPACE_IO 0x10
376 #define CISTPL_BAR_PREFETCH 0x20
377 #define CISTPL_BAR_CACHEABLE 0x40
378 #define CISTPL_BAR_1MEG_MAP 0x80
379 
380 typedef struct cistpl_bar_t {
383 } cistpl_bar_t;
384 
385 typedef struct cistpl_config_t {
391 
392 /* These are bits in the 'present' field, and indices in 'param' */
393 #define CISTPL_POWER_VNOM 0
394 #define CISTPL_POWER_VMIN 1
395 #define CISTPL_POWER_VMAX 2
396 #define CISTPL_POWER_ISTATIC 3
397 #define CISTPL_POWER_IAVG 4
398 #define CISTPL_POWER_IPEAK 5
399 #define CISTPL_POWER_IDOWN 6
400 
401 #define CISTPL_POWER_HIGHZ_OK 0x01
402 #define CISTPL_POWER_HIGHZ_REQ 0x02
403 
404 typedef struct cistpl_power_t {
409 
410 typedef struct cistpl_timing_t {
415 
416 #define CISTPL_IO_LINES_MASK 0x1f
417 #define CISTPL_IO_8BIT 0x20
418 #define CISTPL_IO_16BIT 0x40
419 #define CISTPL_IO_RANGE 0x80
420 
421 #define CISTPL_IO_MAX_WIN 16
422 
423 typedef struct cistpl_io_t {
426  struct {
430 } cistpl_io_t;
431 
432 typedef struct cistpl_irq_t {
435 } cistpl_irq_t;
436 
437 #define CISTPL_MEM_MAX_WIN 8
438 
439 typedef struct cistpl_mem_t {
442  struct {
447 } cistpl_mem_t;
448 
449 #define CISTPL_CFTABLE_DEFAULT 0x0001
450 #define CISTPL_CFTABLE_BVDS 0x0002
451 #define CISTPL_CFTABLE_WP 0x0004
452 #define CISTPL_CFTABLE_RDYBSY 0x0008
453 #define CISTPL_CFTABLE_MWAIT 0x0010
454 #define CISTPL_CFTABLE_AUDIO 0x0800
455 #define CISTPL_CFTABLE_READONLY 0x1000
456 #define CISTPL_CFTABLE_PWRDOWN 0x2000
457 
458 typedef struct cistpl_cftable_entry_t {
469 
470 #define CISTPL_CFTABLE_MASTER 0x000100
471 #define CISTPL_CFTABLE_INVALIDATE 0x000200
472 #define CISTPL_CFTABLE_VGA_PALETTE 0x000400
473 #define CISTPL_CFTABLE_PARITY 0x000800
474 #define CISTPL_CFTABLE_WAIT 0x001000
475 #define CISTPL_CFTABLE_SERR 0x002000
476 #define CISTPL_CFTABLE_FAST_BACK 0x004000
477 #define CISTPL_CFTABLE_BINARY_AUDIO 0x010000
478 #define CISTPL_CFTABLE_PWM_AUDIO 0x020000
479 
489 
490 typedef struct cistpl_device_geo_t {
492  struct {
501 
502 typedef struct cistpl_vers_2_t {
509  char str[244];
511 
512 typedef struct cistpl_org_t {
514  char desc[30];
515 } cistpl_org_t;
516 
517 #define CISTPL_ORG_FS 0x00
518 #define CISTPL_ORG_APPSPEC 0x01
519 #define CISTPL_ORG_XIP 0x02
520 
521 typedef struct cistpl_format_t {
527 
528 #define CISTPL_FORMAT_DISK 0x00
529 #define CISTPL_FORMAT_MEM 0x01
530 
531 #define CISTPL_EDC_NONE 0x00
532 #define CISTPL_EDC_CKSUM 0x01
533 #define CISTPL_EDC_CRC 0x02
534 #define CISTPL_EDC_PCC 0x03
535 
536 typedef union cisparse_t {
555 } cisparse_t;
556 
557 typedef struct tuple_t {
560  u_int Flags; /* internal use */
561  u_int LinkOffset; /* internal use */
562  u_int CISOffset; /* internal use */
569 } tuple_t;
570 
571 /* Special cisdata_t value */
572 #define RETURN_FIRST_TUPLE 0xff
573 
574 /* Attributes for tuple calls */
575 #define TUPLE_RETURN_LINK 0x01
576 #define TUPLE_RETURN_COMMON 0x02
577 
578 #define CISTPL_MAX_CIS_SIZE 0x200
579 
580 #endif /* LINUX_CISTPL_H */