cardbus_cis.h revision 82378
167276Sjon/*
267276Sjon * Copyright (c) 2000,2001 Jonathan Chen.
367276Sjon * All rights reserved.
467276Sjon *
567276Sjon * Redistribution and use in source and binary forms, with or without
667276Sjon * modification, are permitted provided that the following conditions
767276Sjon * are met:
867276Sjon * 1. Redistributions of source code must retain the above copyright
967276Sjon *    notice, this list of conditions, and the following disclaimer,
1067276Sjon *    without modification, immediately at the beginning of the file.
1167276Sjon * 2. Redistributions in binary form must reproduce the above copyright
1267276Sjon *    notice, this list of conditions and the following disclaimer in
1367276Sjon *    the documentation and/or other materials provided with the
1467276Sjon *    distribution.
1567276Sjon *
1667276Sjon * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1767276Sjon * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1867276Sjon * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1967276Sjon * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
2067276Sjon * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2167276Sjon * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2267276Sjon * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2367276Sjon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2467276Sjon * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2567276Sjon * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2667276Sjon * SUCH DAMAGE.
2767276Sjon *
2867276Sjon * $FreeBSD: head/sys/dev/cardbus/cardbus_cis.h 82378 2001-08-27 00:09:42Z jon $
2967276Sjon */
3067276Sjon
3167276Sjon/*
3267276Sjon * Cardbus CIS definitions
3367276Sjon */
3467276Sjon
3570715Sjonstruct cis_tupleinfo;
3670715Sjon
3782375Sjonint	cardbus_do_cis(device_t, device_t);
3882375Sjonint	cardbus_cis_read(device_t, device_t, u_int8_t, struct cis_tupleinfo**,
3982375Sjon	    int*);
4082375Sjonvoid	cardbus_cis_free(device_t, struct cis_tupleinfo*, int*);
4167276Sjon
4282375Sjon#define	MAXTUPLESIZE		0x400
4367276Sjon
4467276Sjon/* CIS TUPLES */
4567276Sjon
4682375Sjon#define	CISTPL_NULL		0x00
4782375Sjon#define	CISTPL_DEVICE		0x01
4882375Sjon#define	CISTPL_LONG_LINK_CB	0x02
4982375Sjon#define	CISTPL_INDIRECT		0x03
5082375Sjon#define	CISTPL_CONFIG_CB	0x04
5182375Sjon#define	CISTPL_CFTABLE_ENTRY_CB	0x05
5282375Sjon#define	CISTPL_LONGLINK_MFC	0x06
5382375Sjon#define	CISTPL_BAR		0x07
5482375Sjon#define	CISTPL_PWR_MGMNT	0x08
5582375Sjon#define	CISTPL_EXTDEVICE	0x09
5682375Sjon#define	CISTPL_CHECKSUM		0x10
5782375Sjon#define	CISTPL_LONGLINK_A	0x11
5882375Sjon#define	CISTPL_LONGLINK_C	0x12
5982375Sjon#define	CISTPL_LINKTARGET	0x13
6082375Sjon#define	CISTPL_NO_LINK		0x14
6182375Sjon#define	CISTPL_VERS_1		0x15
6282375Sjon#define	CISTPL_ALTSTR		0x16
6382375Sjon#define	CISTPL_DEVICE_A		0x17
6482375Sjon#define	CISTPL_JEDEC_C		0x18
6582375Sjon#define	CISTPL_JEDEC_A		0x19
6682375Sjon#define	CISTPL_CONFIG		0x1A
6782375Sjon#define	CISTPL_CFTABLE_ENTRY	0x1B
6882375Sjon#define	CISTPL_DEVICE_OC	0x1C
6982375Sjon#define	CISTPL_DEVICE_OA	0x1D
7082375Sjon#define	CISTPL_DEVICE_GEO	0x1E
7182375Sjon#define	CISTPL_DEVICE_GEO_A	0x1F
7282375Sjon#define	CISTPL_MANFID		0x20
7382375Sjon#define	CISTPL_FUNCID		0x21
7482375Sjon#define	CISTPL_FUNCE		0x22
7582375Sjon#define	CISTPL_SWIL		0x23
7682375Sjon#define	CISTPL_VERS_2		0x40
7782375Sjon#define	CISTPL_FORMAT		0x41
7882375Sjon#define	CISTPL_GEOMETRY		0x42
7982375Sjon#define	CISTPL_BYTEORDER	0x43
8082375Sjon#define	CISTPL_DATE		0x44
8182375Sjon#define	CISTPL_BATTERY		0x45
8282375Sjon#define	CISTPL_ORG		0x46
8382375Sjon#define	CISTPL_CUSTOMSTART	0x80
8482375Sjon#define	CISTPL_END		0xFF
8567276Sjon
8682375Sjon#define	CISTPL_GENERIC		-1	/* catchall */
8770715Sjon
8867276Sjon/* BAR */
8982375Sjon#define	TPL_BAR_REG_ASI_MASK			0x07
9082375Sjon#define	TPL_BAR_REG_AS				0x10
9182378Sjon#define	TPL_BAR_REG_PREFETCHABLE_ONLY		0x20
9282378Sjon#define	TPL_BAR_REG_PREFETCHABLE_CACHEABLE	0x40
9382378Sjon#define	TPL_BAR_REG_PREFETCHABLE		0x60
9482378Sjon#define	TPL_BAR_REG_BELOW1MB			0x80
9567276Sjon
9667276Sjon/* CISTPL_FUNC */
9782375Sjon#define	TPL_FUNC_MF		0	/* multi function tuple */
9882375Sjon#define	TPL_FUNC_MEM		1	/* memory */
9982375Sjon#define	TPL_FUNC_SERIAL		2	/* serial, including modem and fax */
10082375Sjon#define	TPL_FUNC_PARALLEL	3	/* parallel, including printer and SCSI */
10182375Sjon#define	TPL_FUNC_DISK		4	/* Disk */
10282375Sjon#define	TPL_FUNC_VIDEO		5	/* Video Adaptor */
10382375Sjon#define	TPL_FUNC_LAN		6	/* LAN Adaptor */
10482375Sjon#define	TPL_FUNC_AIMS		7	/* Auto Inclement Mass Strages */
10567276Sjon
10667276Sjon/* TPL_FUNC_LAN */
10782375Sjon#define	TPL_FUNCE_LAN_TECH	1	/* technology */
10882375Sjon#define	TPL_FUNCE_LAN_SPEED	2	/* speed */
10982375Sjon#define	TPL_FUNCE_LAN_MEDIA	2	/* which media do you use? */
11082375Sjon#define	TPL_FUNCE_LAN_NID	4	/* node id (address) */
11182375Sjon#define	TPL_FUNCE_LAN_CONN	5	/* connector type (shape) */
112