xref: /freebsd/sys/dev/cardbus/cardbus_cis.h (revision 0db7e66cdc52a79ee5bd40d02c0241e98771278e)
10db7e66cSJonathan Chen /*
20db7e66cSJonathan Chen  * Copyright (c) 2000,2001 Jonathan Chen.
30db7e66cSJonathan Chen  * All rights reserved.
40db7e66cSJonathan Chen  *
50db7e66cSJonathan Chen  * Redistribution and use in source and binary forms, with or without
60db7e66cSJonathan Chen  * modification, are permitted provided that the following conditions
70db7e66cSJonathan Chen  * are met:
80db7e66cSJonathan Chen  * 1. Redistributions of source code must retain the above copyright
90db7e66cSJonathan Chen  *    notice, this list of conditions, and the following disclaimer,
100db7e66cSJonathan Chen  *    without modification, immediately at the beginning of the file.
110db7e66cSJonathan Chen  * 2. Redistributions in binary form must reproduce the above copyright
120db7e66cSJonathan Chen  *    notice, this list of conditions and the following disclaimer in
130db7e66cSJonathan Chen  *    the documentation and/or other materials provided with the
140db7e66cSJonathan Chen  *    distribution.
150db7e66cSJonathan Chen  *
160db7e66cSJonathan Chen  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
170db7e66cSJonathan Chen  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
180db7e66cSJonathan Chen  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
190db7e66cSJonathan Chen  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
200db7e66cSJonathan Chen  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
210db7e66cSJonathan Chen  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
220db7e66cSJonathan Chen  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
230db7e66cSJonathan Chen  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
240db7e66cSJonathan Chen  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
250db7e66cSJonathan Chen  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
260db7e66cSJonathan Chen  * SUCH DAMAGE.
270db7e66cSJonathan Chen  *
280db7e66cSJonathan Chen  * $FreeBSD$
290db7e66cSJonathan Chen  */
300db7e66cSJonathan Chen 
310db7e66cSJonathan Chen /*
320db7e66cSJonathan Chen  * Cardbus CIS definitions
330db7e66cSJonathan Chen  */
340db7e66cSJonathan Chen 
350db7e66cSJonathan Chen int cardbus_do_cis(device_t dev, device_t child);
360db7e66cSJonathan Chen 
370db7e66cSJonathan Chen #define MAXTUPLESIZE		0x400
380db7e66cSJonathan Chen 
390db7e66cSJonathan Chen /* CIS TUPLES */
400db7e66cSJonathan Chen 
410db7e66cSJonathan Chen #define CISTPL_NULL		0x00
420db7e66cSJonathan Chen #define CISTPL_DEVICE		0x01
430db7e66cSJonathan Chen #define CISTPL_LONG_LINK_CB	0x02
440db7e66cSJonathan Chen #define CISTPL_INDIRECT		0x03
450db7e66cSJonathan Chen #define CISTPL_CONFIG_CB	0x04
460db7e66cSJonathan Chen #define CISTPL_CFTABLE_ENTRY_CB	0x05
470db7e66cSJonathan Chen #define CISTPL_LONGLINK_MFC	0x06
480db7e66cSJonathan Chen #define CISTPL_BAR		0x07
490db7e66cSJonathan Chen #define CISTPL_PWR_MGMNT	0x08
500db7e66cSJonathan Chen #define CISTPL_EXTDEVICE	0x09
510db7e66cSJonathan Chen #define CISTPL_CHECKSUM		0x10
520db7e66cSJonathan Chen #define CISTPL_LONGLINK_A	0x11
530db7e66cSJonathan Chen #define CISTPL_LONGLINK_C	0x12
540db7e66cSJonathan Chen #define CISTPL_LINKTARGET	0x13
550db7e66cSJonathan Chen #define CISTPL_NO_LINK		0x14
560db7e66cSJonathan Chen #define CISTPL_VERS_1		0x15
570db7e66cSJonathan Chen #define CISTPL_ALTSTR		0x16
580db7e66cSJonathan Chen #define CISTPL_DEVICE_A		0x17
590db7e66cSJonathan Chen #define CISTPL_JEDEC_C		0x18
600db7e66cSJonathan Chen #define CISTPL_JEDEC_A		0x19
610db7e66cSJonathan Chen #define CISTPL_CONFIG		0x1A
620db7e66cSJonathan Chen #define CISTPL_CFTABLE_ENTRY	0x1B
630db7e66cSJonathan Chen #define CISTPL_DEVICE_OC	0x1C
640db7e66cSJonathan Chen #define CISTPL_DEVICE_OA	0x1D
650db7e66cSJonathan Chen #define CISTPL_DEVICE_GEO	0x1E
660db7e66cSJonathan Chen #define CISTPL_DEVICE_GEO_A	0x1F
670db7e66cSJonathan Chen #define CISTPL_MANFID		0x20
680db7e66cSJonathan Chen #define CISTPL_FUNCID		0x21
690db7e66cSJonathan Chen #define CISTPL_FUNCE		0x22
700db7e66cSJonathan Chen #define CISTPL_SWIL		0x23
710db7e66cSJonathan Chen #define CISTPL_VERS_2		0x40
720db7e66cSJonathan Chen #define CISTPL_FORMAT		0x41
730db7e66cSJonathan Chen #define CISTPL_GEOMETRY		0x42
740db7e66cSJonathan Chen #define CISTPL_BYTEORDER	0x43
750db7e66cSJonathan Chen #define CISTPL_DATE		0x44
760db7e66cSJonathan Chen #define CISTPL_BATTERY		0x45
770db7e66cSJonathan Chen #define CISTPL_ORG		0x46
780db7e66cSJonathan Chen #define CISTPL_END		0xFF
790db7e66cSJonathan Chen 
800db7e66cSJonathan Chen /* BAR */
810db7e66cSJonathan Chen #define TPL_BAR_REG_ASI_MASK	0x07
820db7e66cSJonathan Chen #define TPL_BAR_REG_AS		0x08
830db7e66cSJonathan Chen 
840db7e66cSJonathan Chen /* CISTPL_FUNC */
850db7e66cSJonathan Chen #define TPL_FUNC_MF		0	/* multi function tuple */
860db7e66cSJonathan Chen #define TPL_FUNC_MEM		1	/* memory */
870db7e66cSJonathan Chen #define TPL_FUNC_SERIAL		2	/* serial, including modem and fax */
880db7e66cSJonathan Chen #define TPL_FUNC_PARALLEL	3	/* parallel, including printer and SCSI */
890db7e66cSJonathan Chen #define TPL_FUNC_DISK		4	/* Disk */
900db7e66cSJonathan Chen #define TPL_FUNC_VIDEO		5	/* Video Adaptor */
910db7e66cSJonathan Chen #define TPL_FUNC_LAN		6	/* LAN Adaptor */
920db7e66cSJonathan Chen #define TPL_FUNC_AIMS		7	/* Auto Inclement Mass Strages */
930db7e66cSJonathan Chen 
940db7e66cSJonathan Chen /* TPL_FUNC_LAN */
950db7e66cSJonathan Chen #define TPL_FUNCE_LAN_TECH	1	/* technology */
960db7e66cSJonathan Chen #define TPL_FUNCE_LAN_SPEED	2	/* speed */
970db7e66cSJonathan Chen #define TPL_FUNCE_LAN_MEDIA	2	/* which media do you use? */
980db7e66cSJonathan Chen #define TPL_FUNCE_LAN_NID	4	/* node id (address) */
990db7e66cSJonathan Chen #define TPL_FUNCE_LAN_CONN	5	/* connector type (shape) */
100