2 * cistpl.h 1.35 2001/08/24 12:16:12
4 * The contents of this file are subject to the Mozilla Public License
5 * Version 2.0 (the "License"); you may not use this file except in
6 * compliance with the License. You may obtain a copy of the License
7 * at http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS"
10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11 * the License for the specific language governing rights and
12 * limitations under the License.
14 * The initial developer of the original code is David A. Hinds
15 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
16 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
18 * Alternatively, the contents of this file may be used under the
19 * terms of the GNU General Public License version 2 (the "GPL"), in
20 * which case the provisions of the GPL are applicable instead of the
21 * above. If you wish to allow the use of your version of this file
22 * only under the terms of the GPL and not to allow others to use
23 * your version of this file under the MPL, indicate your decision by
24 * deleting the provisions above and replace them with the notice and
25 * other provisions required by the GPL. If you do not delete the
26 * provisions above, a recipient may use your version of this file
27 * under either the MPL or the GPL.
30 #ifndef _LINUX_CISTPL_H
31 #define _LINUX_CISTPL_H
33 #define CISTPL_NULL 0x00
34 #define CISTPL_DEVICE 0x01
35 #define CISTPL_LONGLINK_CB 0x02
36 #define CISTPL_INDIRECT 0x03
37 #define CISTPL_CONFIG_CB 0x04
38 #define CISTPL_CFTABLE_ENTRY_CB 0x05
39 #define CISTPL_LONGLINK_MFC 0x06
40 #define CISTPL_BAR 0x07
41 #define CISTPL_PWR_MGMNT 0x08
42 #define CISTPL_EXTDEVICE 0x09
43 #define CISTPL_CHECKSUM 0x10
44 #define CISTPL_LONGLINK_A 0x11
45 #define CISTPL_LONGLINK_C 0x12
46 #define CISTPL_LINKTARGET 0x13
47 #define CISTPL_NO_LINK 0x14
48 #define CISTPL_VERS_1 0x15
49 #define CISTPL_ALTSTR 0x16
50 #define CISTPL_DEVICE_A 0x17
51 #define CISTPL_JEDEC_C 0x18
52 #define CISTPL_JEDEC_A 0x19
53 #define CISTPL_CONFIG 0x1a
54 #define CISTPL_CFTABLE_ENTRY 0x1b
55 #define CISTPL_DEVICE_OC 0x1c
56 #define CISTPL_DEVICE_OA 0x1d
57 #define CISTPL_DEVICE_GEO 0x1e
58 #define CISTPL_DEVICE_GEO_A 0x1f
59 #define CISTPL_MANFID 0x20
60 #define CISTPL_FUNCID 0x21
61 #define CISTPL_FUNCE 0x22
62 #define CISTPL_SWIL 0x23
63 #define CISTPL_END 0xff
65 #define CISTPL_VERS_2 0x40
66 #define CISTPL_FORMAT 0x41
67 #define CISTPL_GEOMETRY 0x42
68 #define CISTPL_BYTEORDER 0x43
69 #define CISTPL_DATE 0x44
70 #define CISTPL_BATTERY 0x45
71 #define CISTPL_FORMAT_A 0x47
73 #define CISTPL_ORG 0x46
74 #define CISTPL_SPCL 0x90
76 typedef struct cistpl_longlink_t {
80 typedef struct cistpl_checksum_t {
86 #define CISTPL_MAX_FUNCTIONS 8
87 #define CISTPL_MFC_ATTR 0x00
88 #define CISTPL_MFC_COMMON 0x01
90 typedef struct cistpl_longlink_mfc_t {
95 } fn[CISTPL_MAX_FUNCTIONS];
96 } cistpl_longlink_mfc_t;
98 #define CISTPL_MAX_ALTSTR_STRINGS 4
100 typedef struct cistpl_altstr_t {
102 u_char ofs[CISTPL_MAX_ALTSTR_STRINGS];
106 #define CISTPL_DTYPE_NULL 0x00
107 #define CISTPL_DTYPE_ROM 0x01
108 #define CISTPL_DTYPE_OTPROM 0x02
109 #define CISTPL_DTYPE_EPROM 0x03
110 #define CISTPL_DTYPE_EEPROM 0x04
111 #define CISTPL_DTYPE_FLASH 0x05
112 #define CISTPL_DTYPE_SRAM 0x06
113 #define CISTPL_DTYPE_DRAM 0x07
114 #define CISTPL_DTYPE_FUNCSPEC 0x0d
115 #define CISTPL_DTYPE_EXTEND 0x0e
117 #define CISTPL_MAX_DEVICES 4
119 typedef struct cistpl_device_t {
126 } dev[CISTPL_MAX_DEVICES];
129 #define CISTPL_DEVICE_MWAIT 0x01
130 #define CISTPL_DEVICE_3VCC 0x02
132 typedef struct cistpl_device_o_t {
134 cistpl_device_t device;
137 #define CISTPL_VERS_1_MAX_PROD_STRINGS 4
139 typedef struct cistpl_vers_1_t {
143 u_char ofs[CISTPL_VERS_1_MAX_PROD_STRINGS];
147 typedef struct cistpl_jedec_t {
152 } id[CISTPL_MAX_DEVICES];
155 typedef struct cistpl_manfid_t {
160 #define CISTPL_FUNCID_MULTI 0x00
161 #define CISTPL_FUNCID_MEMORY 0x01
162 #define CISTPL_FUNCID_SERIAL 0x02
163 #define CISTPL_FUNCID_PARALLEL 0x03
164 #define CISTPL_FUNCID_FIXED 0x04
165 #define CISTPL_FUNCID_VIDEO 0x05
166 #define CISTPL_FUNCID_NETWORK 0x06
167 #define CISTPL_FUNCID_AIMS 0x07
168 #define CISTPL_FUNCID_SCSI 0x08
170 #define CISTPL_SYSINIT_POST 0x01
171 #define CISTPL_SYSINIT_ROM 0x02
173 typedef struct cistpl_funcid_t {
178 typedef struct cistpl_funce_t {
183 /*======================================================================
185 Modem Function Extension Tuples
187 ======================================================================*/
189 #define CISTPL_FUNCE_SERIAL_IF 0x00
190 #define CISTPL_FUNCE_SERIAL_CAP 0x01
191 #define CISTPL_FUNCE_SERIAL_SERV_DATA 0x02
192 #define CISTPL_FUNCE_SERIAL_SERV_FAX 0x03
193 #define CISTPL_FUNCE_SERIAL_SERV_VOICE 0x04
194 #define CISTPL_FUNCE_SERIAL_CAP_DATA 0x05
195 #define CISTPL_FUNCE_SERIAL_CAP_FAX 0x06
196 #define CISTPL_FUNCE_SERIAL_CAP_VOICE 0x07
197 #define CISTPL_FUNCE_SERIAL_IF_DATA 0x08
198 #define CISTPL_FUNCE_SERIAL_IF_FAX 0x09
199 #define CISTPL_FUNCE_SERIAL_IF_VOICE 0x0a
201 /* UART identification */
202 #define CISTPL_SERIAL_UART_8250 0x00
203 #define CISTPL_SERIAL_UART_16450 0x01
204 #define CISTPL_SERIAL_UART_16550 0x02
205 #define CISTPL_SERIAL_UART_8251 0x03
206 #define CISTPL_SERIAL_UART_8530 0x04
207 #define CISTPL_SERIAL_UART_85230 0x05
209 /* UART capabilities */
210 #define CISTPL_SERIAL_UART_SPACE 0x01
211 #define CISTPL_SERIAL_UART_MARK 0x02
212 #define CISTPL_SERIAL_UART_ODD 0x04
213 #define CISTPL_SERIAL_UART_EVEN 0x08
214 #define CISTPL_SERIAL_UART_5BIT 0x01
215 #define CISTPL_SERIAL_UART_6BIT 0x02
216 #define CISTPL_SERIAL_UART_7BIT 0x04
217 #define CISTPL_SERIAL_UART_8BIT 0x08
218 #define CISTPL_SERIAL_UART_1STOP 0x10
219 #define CISTPL_SERIAL_UART_MSTOP 0x20
220 #define CISTPL_SERIAL_UART_2STOP 0x40
222 typedef struct cistpl_serial_t {
228 typedef struct cistpl_modem_cap_t {
231 u_char rcv_buf_0, rcv_buf_1, rcv_buf_2;
232 u_char xmit_buf_0, xmit_buf_1, xmit_buf_2;
233 } cistpl_modem_cap_t;
235 #define CISTPL_SERIAL_MOD_103 0x01
236 #define CISTPL_SERIAL_MOD_V21 0x02
237 #define CISTPL_SERIAL_MOD_V23 0x04
238 #define CISTPL_SERIAL_MOD_V22 0x08
239 #define CISTPL_SERIAL_MOD_212A 0x10
240 #define CISTPL_SERIAL_MOD_V22BIS 0x20
241 #define CISTPL_SERIAL_MOD_V26 0x40
242 #define CISTPL_SERIAL_MOD_V26BIS 0x80
243 #define CISTPL_SERIAL_MOD_V27BIS 0x01
244 #define CISTPL_SERIAL_MOD_V29 0x02
245 #define CISTPL_SERIAL_MOD_V32 0x04
246 #define CISTPL_SERIAL_MOD_V32BIS 0x08
247 #define CISTPL_SERIAL_MOD_V34 0x10
249 #define CISTPL_SERIAL_ERR_MNP2_4 0x01
250 #define CISTPL_SERIAL_ERR_V42_LAPM 0x02
252 #define CISTPL_SERIAL_CMPR_V42BIS 0x01
253 #define CISTPL_SERIAL_CMPR_MNP5 0x02
255 #define CISTPL_SERIAL_CMD_AT1 0x01
256 #define CISTPL_SERIAL_CMD_AT2 0x02
257 #define CISTPL_SERIAL_CMD_AT3 0x04
258 #define CISTPL_SERIAL_CMD_MNP_AT 0x08
259 #define CISTPL_SERIAL_CMD_V25BIS 0x10
260 #define CISTPL_SERIAL_CMD_V25A 0x20
261 #define CISTPL_SERIAL_CMD_DMCL 0x40
263 typedef struct cistpl_data_serv_t {
268 u_char error_control;
273 u_char misc_features;
274 u_char ccitt_code[0];
275 } cistpl_data_serv_t;
277 typedef struct cistpl_fax_serv_t {
284 u_char ccitt_code[0];
287 typedef struct cistpl_voice_serv_t {
290 } cistpl_voice_serv_t;
292 /*======================================================================
294 LAN Function Extension Tuples
296 ======================================================================*/
298 #define CISTPL_FUNCE_LAN_TECH 0x01
299 #define CISTPL_FUNCE_LAN_SPEED 0x02
300 #define CISTPL_FUNCE_LAN_MEDIA 0x03
301 #define CISTPL_FUNCE_LAN_NODE_ID 0x04
302 #define CISTPL_FUNCE_LAN_CONNECTOR 0x05
304 /* LAN technologies */
305 #define CISTPL_LAN_TECH_ARCNET 0x01
306 #define CISTPL_LAN_TECH_ETHERNET 0x02
307 #define CISTPL_LAN_TECH_TOKENRING 0x03
308 #define CISTPL_LAN_TECH_LOCALTALK 0x04
309 #define CISTPL_LAN_TECH_FDDI 0x05
310 #define CISTPL_LAN_TECH_ATM 0x06
311 #define CISTPL_LAN_TECH_WIRELESS 0x07
313 typedef struct cistpl_lan_tech_t {
317 typedef struct cistpl_lan_speed_t {
319 } cistpl_lan_speed_t;
321 /* LAN media definitions */
322 #define CISTPL_LAN_MEDIA_UTP 0x01
323 #define CISTPL_LAN_MEDIA_STP 0x02
324 #define CISTPL_LAN_MEDIA_THIN_COAX 0x03
325 #define CISTPL_LAN_MEDIA_THICK_COAX 0x04
326 #define CISTPL_LAN_MEDIA_FIBER 0x05
327 #define CISTPL_LAN_MEDIA_900MHZ 0x06
328 #define CISTPL_LAN_MEDIA_2GHZ 0x07
329 #define CISTPL_LAN_MEDIA_5GHZ 0x08
330 #define CISTPL_LAN_MEDIA_DIFF_IR 0x09
331 #define CISTPL_LAN_MEDIA_PTP_IR 0x0a
333 typedef struct cistpl_lan_media_t {
335 } cistpl_lan_media_t;
337 typedef struct cistpl_lan_node_id_t {
340 } cistpl_lan_node_id_t;
342 typedef struct cistpl_lan_connector_t {
344 } cistpl_lan_connector_t;
346 /*======================================================================
348 IDE Function Extension Tuples
350 ======================================================================*/
352 #define CISTPL_IDE_INTERFACE 0x01
354 typedef struct cistpl_ide_interface_t {
356 } cistpl_ide_interface_t;
358 /* First feature byte */
359 #define CISTPL_IDE_SILICON 0x04
360 #define CISTPL_IDE_UNIQUE 0x08
361 #define CISTPL_IDE_DUAL 0x10
363 /* Second feature byte */
364 #define CISTPL_IDE_HAS_SLEEP 0x01
365 #define CISTPL_IDE_HAS_STANDBY 0x02
366 #define CISTPL_IDE_HAS_IDLE 0x04
367 #define CISTPL_IDE_LOW_POWER 0x08
368 #define CISTPL_IDE_REG_INHIBIT 0x10
369 #define CISTPL_IDE_HAS_INDEX 0x20
370 #define CISTPL_IDE_IOIS16 0x40
372 typedef struct cistpl_ide_feature_t {
375 } cistpl_ide_feature_t;
377 #define CISTPL_FUNCE_IDE_IFACE 0x01
378 #define CISTPL_FUNCE_IDE_MASTER 0x02
379 #define CISTPL_FUNCE_IDE_SLAVE 0x03
381 /*======================================================================
383 Configuration Table Entries
385 ======================================================================*/
387 #define CISTPL_BAR_SPACE 0x07
388 #define CISTPL_BAR_SPACE_IO 0x10
389 #define CISTPL_BAR_PREFETCH 0x20
390 #define CISTPL_BAR_CACHEABLE 0x40
391 #define CISTPL_BAR_1MEG_MAP 0x80
393 typedef struct cistpl_bar_t {
398 typedef struct cistpl_config_t {
405 /* These are bits in the 'present' field, and indices in 'param' */
406 #define CISTPL_POWER_VNOM 0
407 #define CISTPL_POWER_VMIN 1
408 #define CISTPL_POWER_VMAX 2
409 #define CISTPL_POWER_ISTATIC 3
410 #define CISTPL_POWER_IAVG 4
411 #define CISTPL_POWER_IPEAK 5
412 #define CISTPL_POWER_IDOWN 6
414 #define CISTPL_POWER_HIGHZ_OK 0x01
415 #define CISTPL_POWER_HIGHZ_REQ 0x02
417 typedef struct cistpl_power_t {
423 typedef struct cistpl_timing_t {
424 u_int wait, waitscale;
425 u_int ready, rdyscale;
426 u_int reserved, rsvscale;
429 #define CISTPL_IO_LINES_MASK 0x1f
430 #define CISTPL_IO_8BIT 0x20
431 #define CISTPL_IO_16BIT 0x40
432 #define CISTPL_IO_RANGE 0x80
434 #define CISTPL_IO_MAX_WIN 16
436 typedef struct cistpl_io_t {
442 } win[CISTPL_IO_MAX_WIN];
445 typedef struct cistpl_irq_t {
450 #define CISTPL_MEM_MAX_WIN 8
452 typedef struct cistpl_mem_t {
459 } win[CISTPL_MEM_MAX_WIN];
462 #define CISTPL_CFTABLE_DEFAULT 0x0001
463 #define CISTPL_CFTABLE_BVDS 0x0002
464 #define CISTPL_CFTABLE_WP 0x0004
465 #define CISTPL_CFTABLE_RDYBSY 0x0008
466 #define CISTPL_CFTABLE_MWAIT 0x0010
467 #define CISTPL_CFTABLE_AUDIO 0x0800
468 #define CISTPL_CFTABLE_READONLY 0x1000
469 #define CISTPL_CFTABLE_PWRDOWN 0x2000
471 typedef struct cistpl_cftable_entry_t {
475 cistpl_power_t vcc, vpp1, vpp2;
476 cistpl_timing_t timing;
481 } cistpl_cftable_entry_t;
483 #define CISTPL_CFTABLE_MASTER 0x000100
484 #define CISTPL_CFTABLE_INVALIDATE 0x000200
485 #define CISTPL_CFTABLE_VGA_PALETTE 0x000400
486 #define CISTPL_CFTABLE_PARITY 0x000800
487 #define CISTPL_CFTABLE_WAIT 0x001000
488 #define CISTPL_CFTABLE_SERR 0x002000
489 #define CISTPL_CFTABLE_FAST_BACK 0x004000
490 #define CISTPL_CFTABLE_BINARY_AUDIO 0x010000
491 #define CISTPL_CFTABLE_PWM_AUDIO 0x020000
493 typedef struct cistpl_cftable_entry_cb_t {
496 cistpl_power_t vcc, vpp1, vpp2;
501 } cistpl_cftable_entry_cb_t;
503 typedef struct cistpl_device_geo_t {
512 } geo[CISTPL_MAX_DEVICES];
513 } cistpl_device_geo_t;
515 typedef struct cistpl_vers_2_t {
519 u_char vspec8, vspec9;
525 typedef struct cistpl_org_t {
530 #define CISTPL_ORG_FS 0x00
531 #define CISTPL_ORG_APPSPEC 0x01
532 #define CISTPL_ORG_XIP 0x02
534 typedef struct cistpl_format_t {
541 #define CISTPL_FORMAT_DISK 0x00
542 #define CISTPL_FORMAT_MEM 0x01
544 #define CISTPL_EDC_NONE 0x00
545 #define CISTPL_EDC_CKSUM 0x01
546 #define CISTPL_EDC_CRC 0x02
547 #define CISTPL_EDC_PCC 0x03
549 typedef union cisparse_t {
550 cistpl_device_t device;
551 cistpl_checksum_t checksum;
552 cistpl_longlink_t longlink;
553 cistpl_longlink_mfc_t longlink_mfc;
554 cistpl_vers_1_t version_1;
555 cistpl_altstr_t altstr;
556 cistpl_jedec_t jedec;
557 cistpl_manfid_t manfid;
558 cistpl_funcid_t funcid;
559 cistpl_funce_t funce;
561 cistpl_config_t config;
562 cistpl_cftable_entry_t cftable_entry;
563 cistpl_cftable_entry_cb_t cftable_entry_cb;
564 cistpl_device_geo_t device_geo;
565 cistpl_vers_2_t vers_2;
567 cistpl_format_t format;
570 typedef struct tuple_t {
572 cisdata_t DesiredTuple;
573 u_int Flags; /* internal use */
574 u_int LinkOffset; /* internal use */
575 u_int CISOffset; /* internal use */
578 cisdata_t TupleOffset;
579 cisdata_t TupleDataMax;
580 cisdata_t TupleDataLen;
581 cisdata_t *TupleData;
584 /* Special cisdata_t value */
585 #define RETURN_FIRST_TUPLE 0xff
587 /* Attributes for tuple calls */
588 #define TUPLE_RETURN_LINK 0x01
589 #define TUPLE_RETURN_COMMON 0x02
591 /* For ValidateCIS */
592 typedef struct cisinfo_t {
596 #define CISTPL_MAX_CIS_SIZE 0x200
599 typedef struct cisdump_t {
601 cisdata_t Data[CISTPL_MAX_CIS_SIZE];
604 #endif /* LINUX_CISTPL_H */