17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
57c478bdstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
67c478bdstevel@tonic-gate * (the "License").  You may not use this file except in compliance
77c478bdstevel@tonic-gate * with the License.
87c478bdstevel@tonic-gate *
97c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
117c478bdstevel@tonic-gate * See the License for the specific language governing permissions
127c478bdstevel@tonic-gate * and limitations under the License.
137c478bdstevel@tonic-gate *
147c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
157c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
177c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
187c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bdstevel@tonic-gate *
207c478bdstevel@tonic-gate * CDDL HEADER END
217c478bdstevel@tonic-gate */
227c478bdstevel@tonic-gate/*
237c478bdstevel@tonic-gate * Copyright (c) 1995-2001 by Sun Microsystems, Inc.
247c478bdstevel@tonic-gate * All rights reserved.
257c478bdstevel@tonic-gate */
267c478bdstevel@tonic-gate
277c478bdstevel@tonic-gate#ifndef _CIS_HANDLERS_H
287c478bdstevel@tonic-gate#define	_CIS_HANDLERS_H
297c478bdstevel@tonic-gate
307c478bdstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bdstevel@tonic-gate
327c478bdstevel@tonic-gate#ifdef	__cplusplus
337c478bdstevel@tonic-gateextern "C" {
347c478bdstevel@tonic-gate#endif
357c478bdstevel@tonic-gate
367c478bdstevel@tonic-gate/*
377c478bdstevel@tonic-gate * This is the CIS tuple handler header file.
387c478bdstevel@tonic-gate *
397c478bdstevel@tonic-gate * Each tuple that we recognize and are prepared to handle is assigned a
407c478bdstevel@tonic-gate *	cistpl_callout_t structure.  This lets us specify a handler for
417c478bdstevel@tonic-gate *	this tuple, as well as flags that describe this tuple and which
427c478bdstevel@tonic-gate *	are used by the CIS interpreter and tuple parser.
437c478bdstevel@tonic-gate */
447c478bdstevel@tonic-gatetypedef struct cistpl_callout_t {
457c478bdstevel@tonic-gate    cisdata_t	type;		/* type of tuple */
467c478bdstevel@tonic-gate    cisdata_t	subtype;	/* only used for CISTPL_FUNCE */
477c478bdstevel@tonic-gate    uint32_t	flags;		/* misc flags */
487c478bdstevel@tonic-gate    uint32_t	(*handler)();	/* tuple handler */
497c478bdstevel@tonic-gate    char	*text;		/* name of tuple */
507c478bdstevel@tonic-gate} cistpl_callout_t;
517c478bdstevel@tonic-gate
527c478bdstevel@tonic-gate/*
537c478bdstevel@tonic-gate * Flags that are used by a tuple handler to specify what action it
547c478bdstevel@tonic-gate *	should perform.
557c478bdstevel@tonic-gate */
567c478bdstevel@tonic-gate#define	HANDTPL_NOERROR		0x000000000 /* no error */
577c478bdstevel@tonic-gate#define	HANDTPL_SET_FLAGS	0x000000001 /* set tuple flags */
587c478bdstevel@tonic-gate#define	HANDTPL_COPY_DONE	0x000000002 /* tuple data copy is done */
597c478bdstevel@tonic-gate#define	HANDTPL_PARSE_LTUPLE	0x000000004 /* parse tuple, return opt data */
607c478bdstevel@tonic-gate#define	HANDTPL_RETURN_NAME	0x000000008 /* return tuple name string */
617c478bdstevel@tonic-gate
627c478bdstevel@tonic-gate/*
637c478bdstevel@tonic-gate * This flag is returned by tuple handlers if they encounter an error. It
647c478bdstevel@tonic-gate *	is returned by cis_list_lcreate if any of the tuple handlers have
657c478bdstevel@tonic-gate *	return an error while processing the CIS.
667c478bdstevel@tonic-gate *
677c478bdstevel@tonic-gate * Note that the following bit is reserved:
687c478bdstevel@tonic-gate *		#define	BAD_CIS_ADDR	0x080000000
697c478bdstevel@tonic-gate *	It appears in cis.h and is used to indicate that cis_list_create
707c478bdstevel@tonic-gate *	tried to read past the end of the mapped in CIS space.
717c478bdstevel@tonic-gate */
727c478bdstevel@tonic-gate#define	HANDTPL_ERROR		0x001000000 /* handler returned an error */
737c478bdstevel@tonic-gate
747c478bdstevel@tonic-gate/*
757c478bdstevel@tonic-gate * General-use constants and macros that aren't specific to a tuple.
767c478bdstevel@tonic-gate */
777c478bdstevel@tonic-gate#define	CISTPL_EXT_BIT	0x080		/* additional extension bytes follow */
787c478bdstevel@tonic-gate
797c478bdstevel@tonic-gate/*
807c478bdstevel@tonic-gate * Constants, macros and structures used by cistpl_devspeed and
817c478bdstevel@tonic-gate *	cis_convert_devspeed functions.
827c478bdstevel@tonic-gate */
837c478bdstevel@tonic-gate#define	CISTPL_DEVSPEED_TABLE	0x000000001 /* use the device speed table */
847c478bdstevel@tonic-gate#define	CISTPL_DEVSPEED_EXT	0x000000002 /* use the extended speed table */
857c478bdstevel@tonic-gate#define	CISTPL_DEVSPEED_MAX_TBL	8 		/* max devspeed table entries */
867c478bdstevel@tonic-gate#define	CISTPL_DEVSPEED_MAX_EXP	8		/* max exponent entries */
877c478bdstevel@tonic-gate#define	CISTPL_DEVSPEED_MAX_MAN	16		/* max mantissa entries */
887c478bdstevel@tonic-gate#define	CISTPL_DEVSPEED_TBL(t)	cistpl_devspeed_struct.table[(t) &	\
897c478bdstevel@tonic-gate						(CISTPL_DEVSPEED_MAX_TBL - 1)]
907c478bdstevel@tonic-gate#define	CISTPL_DEVSPEED_MAN(m)	cistpl_devspeed_struct.mantissa[(m) &	\
917c478bdstevel@tonic-gate						(CISTPL_DEVSPEED_MAX_MAN - 1)]
927c478bdstevel@tonic-gate#define	CISTPL_DEVSPEED_EXP(e)	cistpl_devspeed_struct.exponent[(e) &	\
937c478bdstevel@tonic-gate						(CISTPL_DEVSPEED_MAX_EXP - 1)]
947c478bdstevel@tonic-gatetypedef struct cistpl_devspeed_struct_t {
957c478bdstevel@tonic-gate	uint32_t	*table;
967c478bdstevel@tonic-gate	uint32_t	*tenfac;
977c478bdstevel@tonic-gate	uint32_t	*mantissa;
987c478bdstevel@tonic-gate	uint32_t	*exponent;
997c478bdstevel@tonic-gate} cistpl_devspeed_struct_t;
1007c478bdstevel@tonic-gate
1017c478bdstevel@tonic-gate/*
1027c478bdstevel@tonic-gate * Constants, flags and structure typedefs that are used by specific tuples.
1037c478bdstevel@tonic-gate *
1047c478bdstevel@tonic-gate * CISTPL_DEVICE, CISTPL_DEVICE_A, CISTPL_DEVICE_OC and CISTPL_DEVICE_OA
1057c478bdstevel@tonic-gate */
1067c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_NULL	0x00	/* a NULL device (hole) */
1077c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_ROM		0x01	/* device is of type ROM */
1087c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_OTPROM	0x02	/* device is of type OTPROM */
1097c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_EPROM	0x03	/* device is of type EPROM */
1107c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_EEPROM	0x04	/* device is of type EEPROM */
1117c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_FLASH	0x05	/* device is of type FLASH */
1127c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_SRAM	0x06	/* device is of type SRAM */
1137c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_DRAM	0x07	/* device is of type DRAM */
1147c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_RSVD_8	0x08	/* reserved */
1157c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_RSVD_9	0x09	/* reserved */
1167c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_RSVD_a	0x0a	/* reserved */
1177c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_RSVD_b	0x0b	/* reserved */
1187c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_RSVD_c	0x0c	/* reserved */
1197c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_FUNCSPEC	0x0d	/* device is of type FUNCSPEC */
1207c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_EXTEND	0x0e	/* device is of type extended */
1217c478bdstevel@tonic-gate#define	CISTPL_DEVICE_DTYPE_RSVD_f	0x0f	/* reserved */
1227c478bdstevel@tonic-gate
1237c478bdstevel@tonic-gate/*
1247c478bdstevel@tonic-gate * Flags for cistpl_device_node_t->flags member for CISTPL_DEVICE
1257c478bdstevel@tonic-gate *	and CISTPL_DEVICE_A tuples
1267c478bdstevel@tonic-gate */
1277c478bdstevel@tonic-gate#define	CISTPL_DEVICE_WPS		0x00000001	/* WPS bit is set */
1287c478bdstevel@tonic-gate/*
1297c478bdstevel@tonic-gate * Flags and values for cistpl_device_node_t->flags member for
1307c478bdstevel@tonic-gate *	CISTPL_DEVICE_OC and CISTPL_DEVICE_OA tuples
1317c478bdstevel@tonic-gate */
1327c478bdstevel@tonic-gate#define	CISTPL_DEVICE_OC_MWAIT		0x00010000	/* use MWAIT */
1337c478bdstevel@tonic-gate#define	CISTPL_DEVICE_OC_Vcc_MASK	0x00060000	/* mask for Vcc value */
1347c478bdstevel@tonic-gate#define	CISTPL_DEVICE_OC_Vcc5		0x00000000	/* 5.0 volt operation */
1357c478bdstevel@tonic-gate#define	CISTPL_DEVICE_OC_Vcc33		0x00020000	/* 3.3 volt operation */
1367c478bdstevel@tonic-gate#define	CISTPL_DEVICE_OC_VccXX		0x00040000	/* X.X volt operation */
1377c478bdstevel@tonic-gate#define	CISTPL_DEVICE_OC_VccYY		0x00060000	/* Y.Y volt operation */
1387c478bdstevel@tonic-gate/*
1397c478bdstevel@tonic-gate * CISTPL_DEVICE_MAX_DEVICES defines the maximum number of devices that
1407c478bdstevel@tonic-gate *	we can parse in a CISTPL_DEVICE{...} tuple
1417c478bdstevel@tonic-gate */
1427c478bdstevel@tonic-gate#define	CISTPL_DEVICE_MAX_DEVICES	10
1437c478bdstevel@tonic-gate
1447c478bdstevel@tonic-gate/*
1457c478bdstevel@tonic-gate * CISTPL_DEVICE_SPEED_SIZE_IGNORE if the device speed is set to this, then
1467c478bdstevel@tonic-gate *	ignore the speed and size values
1477c478bdstevel@tonic-gate */
1487c478bdstevel@tonic-gate#define	CISTPL_DEVICE_SPEED_SIZE_IGNORE	0x0ff	/* ignore size and speed info */
1497c478bdstevel@tonic-gate
1507c478bdstevel@tonic-gatetypedef struct cistpl_device_node_t {
1517c478bdstevel@tonic-gate	uint32_t	flags;	/* flags specific to this device */
1527c478bdstevel@tonic-gate	uint32_t	speed;	/* device speed in device speed code format */
1537c478bdstevel@tonic-gate	uint32_t	nS_speed; /* device speed in nS */
1547c478bdstevel@tonic-gate	uint32_t	type;	/* device type */
1557c478bdstevel@tonic-gate	uint32_t	size;	/* device size */
1567c478bdstevel@tonic-gate	uint32_t	size_in_bytes; /* device size in bytes */
1577c478bdstevel@tonic-gate} cistpl_device_node_t;
1587c478bdstevel@tonic-gate
1597c478bdstevel@tonic-gatetypedef struct cistpl_device_t {
1607c478bdstevel@tonic-gate	uint32_t		num_devices; /* number of devices found */
1617c478bdstevel@tonic-gate	cistpl_device_node_t	devnode[CISTPL_DEVICE_MAX_DEVICES];
1627c478bdstevel@tonic-gate} cistpl_device_t;
1637c478bdstevel@tonic-gate
1647c478bdstevel@tonic-gate/*
1657c478bdstevel@tonic-gate * CISTPL_CONFIG
1667c478bdstevel@tonic-gate */
1677c478bdstevel@tonic-gate#define	MAKE_CONFIG_REG_ADDR(base, reg)	(base + (reg * 2))
1687c478bdstevel@tonic-gate#define	CISTPL_CONFIG_MAX_CONFIG_REGS	128 /* max num config regs */
1697c478bdstevel@tonic-gatetypedef struct cistpl_config_t {
1707c478bdstevel@tonic-gate    uint32_t	present;	/* register present flags */
1717c478bdstevel@tonic-gate    uint32_t	nr;		/* number of config registers found */
1727c478bdstevel@tonic-gate    uint32_t	hr;		/* highest config register index found */
1737c478bdstevel@tonic-gate    uint32_t	regs[CISTPL_CONFIG_MAX_CONFIG_REGS];	/* reg offsets */
1747c478bdstevel@tonic-gate    uint32_t	base;		/* base offset of config registers */
1757c478bdstevel@tonic-gate    uint32_t	last;		/* last config index */
1767c478bdstevel@tonic-gate} cistpl_config_t;
1777c478bdstevel@tonic-gate
1787c478bdstevel@tonic-gate/*
1797c478bdstevel@tonic-gate * CISTPL_VERS_1
1807c478bdstevel@tonic-gate */
1817c478bdstevel@tonic-gate#define	CISTPL_VERS_1_MAX_PROD_STRINGS	4 /* max number product strings */
1827c478bdstevel@tonic-gatetypedef struct cistpl_vers_1_t {
1837c478bdstevel@tonic-gate    uint32_t	major;		/* major version number */
1847c478bdstevel@tonic-gate    uint32_t	minor;		/* minor version number */
1857c478bdstevel@tonic-gate    uint32_t	ns;		/* number of information strings */
1867c478bdstevel@tonic-gate				/* pointers to product information strings */
1877c478bdstevel@tonic-gate    char	pi[CISTPL_VERS_1_MAX_PROD_STRINGS][CIS_MAX_TUPLE_DATA_LEN];
1887c478bdstevel@tonic-gate} cistpl_vers_1_t;
1897c478bdstevel@tonic-gate
1907c478bdstevel@tonic-gate/*
1917c478bdstevel@tonic-gate * CISTPL_VERS_2
1927c478bdstevel@tonic-gate */
1937c478bdstevel@tonic-gatetypedef struct cistpl_vers_2_t {
1947c478bdstevel@tonic-gate    uint32_t	vers;		/* version number */
1957c478bdstevel@tonic-gate    uint32_t	comply;		/* level of compliance */
1967c478bdstevel@tonic-gate    uint32_t	dindex;		/* byte address of first data byte in card */
1977c478bdstevel@tonic-gate    uint32_t	reserved;	/* two reserved bytes */
1987c478bdstevel@tonic-gate    uint32_t	vspec8;		/* vendor specific (byte 8) */
1997c478bdstevel@tonic-gate    uint32_t	vspec9;		/* vendor specific (byte 9) */
2007c478bdstevel@tonic-gate    uint32_t	nhdr;		/* number of copies of CIS present on device */
2017c478bdstevel@tonic-gate    char	oem[CIS_MAX_TUPLE_DATA_LEN];	/* Vendor of software that */
2027c478bdstevel@tonic-gate							/* formatted card */
2037c478bdstevel@tonic-gate    char	info[CIS_MAX_TUPLE_DATA_LEN];	/* Informational message */
2047c478bdstevel@tonic-gate							/* about card */
2057c478bdstevel@tonic-gate} cistpl_vers_2_t;
2067c478bdstevel@tonic-gate
2077c478bdstevel@tonic-gate/*
2087c478bdstevel@tonic-gate * CISTPL_JEDEC_A and CISTPL_JEDEC_C
2097c478bdstevel@tonic-gate */
2107c478bdstevel@tonic-gate#define	CISTPL_JEDEC_MAX_IDENTIFIERS	4
2117c478bdstevel@tonic-gatetypedef struct jedec_ident_t {
2127c478bdstevel@tonic-gate	uint32_t	id;	/* manufacturer id */
2137c478bdstevel@tonic-gate	uint32_t	info;	/* manufacturer specific info */
2147c478bdstevel@tonic-gate} jedec_ident_t;
2157c478bdstevel@tonic-gate
2167c478bdstevel@tonic-gatetypedef struct cistpl_jedec_t {
2177c478bdstevel@tonic-gate	uint32_t	nid;		/* # of JEDEC identifiers present */
2187c478bdstevel@tonic-gate	jedec_ident_t	jid[CISTPL_JEDEC_MAX_IDENTIFIERS];
2197c478bdstevel@tonic-gate} cistpl_jedec_t;
2207c478bdstevel@tonic-gate
2217c478bdstevel@tonic-gate/*
2227c478bdstevel@tonic-gate * CISTPL_FORMAT and CISTPL_FORMAT_A
2237c478bdstevel@tonic-gate *
2247c478bdstevel@tonic-gate * These tuples describe the data recording format for a region.
2257c478bdstevel@tonic-gate */
2267c478bdstevel@tonic-gatetypedef struct cistpl_format_t {
2277c478bdstevel@tonic-gate	uint32_t	type;	/* format type code */
2287c478bdstevel@tonic-gate	uint32_t	edc_length; /* error detection code length */
2297c478bdstevel@tonic-gate	uint32_t	edc_type; /* error detection code type */
2307c478bdstevel@tonic-gate	uint32_t	offset;	/* offset of first byte of data in this part */
2317c478bdstevel@tonic-gate	uint32_t	nbytes;	/* number of bytes of data in this partition */
2327c478bdstevel@tonic-gate	union {
2337c478bdstevel@tonic-gate		struct disk {
2347c478bdstevel@tonic-gate		    uint32_t	bksize; /* block size */
2357c478bdstevel@tonic-gate		    uint32_t	nblocks; /* nblocks data for disk-like device */
2367c478bdstevel@tonic-gate		    uint32_t	edcloc; /* location of error detection code */
2377c478bdstevel@tonic-gate		} disk;
2387c478bdstevel@tonic-gate		struct mem {
2397c478bdstevel@tonic-gate		    uint32_t	flags; /* various flags */
2407c478bdstevel@tonic-gate		    uint32_t	reserved; /* reserved byte */
2417c478bdstevel@tonic-gate		    caddr_t	address; /* physical addr for mem-like device */
2427c478bdstevel@tonic-gate		    uint32_t	edcloc; /* location of error detection code */
2437c478bdstevel@tonic-gate		} mem;
2447c478bdstevel@tonic-gate	} dev;
2457c478bdstevel@tonic-gate} cistpl_format_t;
2467c478bdstevel@tonic-gate
2477c478bdstevel@tonic-gate/*
2487c478bdstevel@tonic-gate * device format types
2497c478bdstevel@tonic-gate */
2507c478bdstevel@tonic-gate#define	TPLFMTTYPE_DISK	0x00	/* disk-like format */
2517c478bdstevel@tonic-gate#define	TPLFMTTYPE_MEM	0x01	/* memory-like format */
2527c478bdstevel@tonic-gate#define	TPLFMTTYPE_VS	0x80	/* vendor specific format */
2537c478bdstevel@tonic-gate
2547c478bdstevel@tonic-gate/*
2557c478bdstevel@tonic-gate * error detection code types
2567c478bdstevel@tonic-gate */
2577c478bdstevel@tonic-gate#define	TPLFMTEDC_NONE	0x00	/* no error detection code */
2587c478bdstevel@tonic-gate#define	TPLFMTEDC_CKSUM	0x01	/* arithmetic checksum is used */
2597c478bdstevel@tonic-gate#define	TPLFMTEDC_CRC	0x02	/* 16-bit CRC */
2607c478bdstevel@tonic-gate#define	TPLFMTEDC_PCC	0x03	/* whole-partition arithmetic checksum */
2617c478bdstevel@tonic-gate#define	TPLFMTEDC_VS	0x80	/* vendor specific error checking */
2627c478bdstevel@tonic-gate
2637c478bdstevel@tonic-gate#define	EDC_LENGTH_MASK	0x07
2647c478bdstevel@tonic-gate#define	EDC_TYPE_MASK   0x0f
2657c478bdstevel@tonic-gate#define	EDC_TYPE_SHIFT	3
2667c478bdstevel@tonic-gate
2677c478bdstevel@tonic-gate/*
2687c478bdstevel@tonic-gate * flags for memory-like devices
2697c478bdstevel@tonic-gate */
2707c478bdstevel@tonic-gate#define	TPLFMTFLAGS_ADDR	0x01	/* address is valid */
2717c478bdstevel@tonic-gate#define	TPLFMTFLAGS_AUTO	0x02	/* automatically map memory region */
2727c478bdstevel@tonic-gate
2737c478bdstevel@tonic-gate/*
2747c478bdstevel@tonic-gate * CISTPL_GEOMETRY
2757c478bdstevel@tonic-gate */
2767c478bdstevel@tonic-gatetypedef struct cistpl_geometry_t {
2777c478bdstevel@tonic-gate	uint32_t	spt;
2787c478bdstevel@tonic-gate	uint32_t	tpc;
2797c478bdstevel@tonic-gate	uint32_t	ncyl;
2807c478bdstevel@tonic-gate} cistpl_geometry_t;
2817c478bdstevel@tonic-gate
2827c478bdstevel@tonic-gate/*
2837c478bdstevel@tonic-gate * CISTPL_BYTEORDER
2847c478bdstevel@tonic-gate */
2857c478bdstevel@tonic-gatetypedef struct cistpl_byteorder_t {
2867c478bdstevel@tonic-gate	uint32_t	order;		/* byte order code */
2877c478bdstevel@tonic-gate	uint32_t	map;		/* byte mapping code */
2887c478bdstevel@tonic-gate} cistpl_byteorder_t;
2897c478bdstevel@tonic-gate
2907c478bdstevel@tonic-gate/*
2917c478bdstevel@tonic-gate * byte order and mapping codes
2927c478bdstevel@tonic-gate */
2937c478bdstevel@tonic-gate#define	TPLBYTEORD_LOW	0x00	/* specifies little endian order */
2947c478bdstevel@tonic-gate#define	TPLBYTEORD_HIGH	0x01	/* specifies big endian order */
2957c478bdstevel@tonic-gate#define	TPLBYTEORD_VS	0x80	/* vendor specific order 0x80-0xFF */
2967c478bdstevel@tonic-gate
2977c478bdstevel@tonic-gate#define	TPLBYTEMAP_LOW	0x00	/* byte zero is least significant byte */
2987c478bdstevel@tonic-gate#define	TPLBYTEMAP_HIGH	0x01	/* byte zero is most significant byte */
2997c478bdstevel@tonic-gate#define	TPLBYTEMAP_VS	0x80	/* vendor specific mapping */
3007c478bdstevel@tonic-gate
3017c478bdstevel@tonic-gate/*
3027c478bdstevel@tonic-gate * CISTPL_DATE
3037c478bdstevel@tonic-gate */
3047c478bdstevel@tonic-gatetypedef struct cistpl_date_t {
3057c478bdstevel@tonic-gate	uint32_t	time;
3067c478bdstevel@tonic-gate	uint32_t	day;
3077c478bdstevel@tonic-gate} cistpl_date_t;
3087c478bdstevel@tonic-gate
3097c478bdstevel@tonic-gate/*
3107c478bdstevel@tonic-gate * CISTPL_BATTERY
3117c478bdstevel@tonic-gate */
3127c478bdstevel@tonic-gatetypedef struct cistpl_battery_t {
3137c478bdstevel@tonic-gate	uint32_t	rday;		/* replacement date */
3147c478bdstevel@tonic-gate	uint32_t	xday;		/* expiration date */
3157c478bdstevel@tonic-gate} cistpl_battery_t;
3167c478bdstevel@tonic-gate
3177c478bdstevel@tonic-gate/*
3187c478bdstevel@tonic-gate * CISTPL_ORG
3197c478bdstevel@tonic-gate */
3207c478bdstevel@tonic-gatetypedef struct cistpl_org_t {
3217c478bdstevel@tonic-gate	uint32_t	type;		/* data organization code */
3227c478bdstevel@tonic-gate	char	desc[CIS_MAX_TUPLE_DATA_LEN];	/* text description of */
3237c478bdstevel@tonic-gate						/* this organization */
3247c478bdstevel@tonic-gate} cistpl_org_t;
3257c478bdstevel@tonic-gate
3267c478bdstevel@tonic-gate/*
3277c478bdstevel@tonic-gate * CISTPL_MANFID
3287c478bdstevel@tonic-gate */
3297c478bdstevel@tonic-gatetypedef struct cistpl_manfid_t {
3307c478bdstevel@tonic-gate	uint32_t	manf;		/* PCMCIA PC Card manufacturer code */
3317c478bdstevel@tonic-gate	uint32_t	card;		/* manufacturer information */
3327c478bdstevel@tonic-gate} cistpl_manfid_t;
3337c478bdstevel@tonic-gate
3347c478bdstevel@tonic-gate/*
3357c478bdstevel@tonic-gate * CISTPL_FUNCID
3367c478bdstevel@tonic-gate */
3377c478bdstevel@tonic-gatetypedef struct cistpl_funcid_t {
3387c478bdstevel@tonic-gate	uint32_t	function;		/* PC Card function code */
3397c478bdstevel@tonic-gate	uint32_t	sysinit;		/* system initialization mask */
3407c478bdstevel@tonic-gate} cistpl_funcid_t;
3417c478bdstevel@tonic-gate
3427c478bdstevel@tonic-gate/*
3437c478bdstevel@tonic-gate * Function types for CISTPL_FUNCID; note that the TPLFUNC_UNKNOWN is
3447c478bdstevel@tonic-gate *	not defined by the PCMCIA standard.
3457c478bdstevel@tonic-gate *
3467c478bdstevel@tonic-gate * Definitions for cistpl_funcid_t->function
3477c478bdstevel@tonic-gate */
3487c478bdstevel@tonic-gate#define	TPLFUNC_MULTI		0x000	/* vendor-specific multifunction card */
3497c478bdstevel@tonic-gate#define	TPLFUNC_MEMORY		0x001	/* memory card */
3507c478bdstevel@tonic-gate#define	TPLFUNC_SERIAL		0x002	/* serial I/O port */
3517c478bdstevel@tonic-gate#define	TPLFUNC_PARALLEL	0x003	/* parallel printer port */
3527c478bdstevel@tonic-gate#define	TPLFUNC_FIXED		0x004	/* fixed disk, silicon or removeable */
3537c478bdstevel@tonic-gate#define	TPLFUNC_VIDEO		0x005	/* video interface */
3547c478bdstevel@tonic-gate#define	TPLFUNC_LAN		0x006	/* Local Area Network adapter */
3557c478bdstevel@tonic-gate#define	TPLFUNC_AIMS		0x007	/* Auto Incrementing Mass Storage */
3567c478bdstevel@tonic-gate#define	TPLFUNC_SCSI		0x008	/* SCSI bridge */
3577c478bdstevel@tonic-gate#define	TPLFUNC_SECURITY	0x009	/* Security Cards */
3587c478bdstevel@tonic-gate#define	TPLFUNC_VENDOR_SPECIFIC	0x0fe	/* Vendor Specific */
3597c478bdstevel@tonic-gate#define	TPLFUNC_UNKNOWN		0x0ff	/* unknown function(s) */
3607c478bdstevel@tonic-gate/*
3617c478bdstevel@tonic-gate * Definitions for cistpl_funcid_t->sysinit
3627c478bdstevel@tonic-gate */
3637c478bdstevel@tonic-gate#define	TPLINIT_POST		0x01	/* POST should attempt configure */
3647c478bdstevel@tonic-gate#define	TPLINIT_ROM		0x02	/* map ROM during sys init */
3657c478bdstevel@tonic-gate
3667c478bdstevel@tonic-gate/*
3677c478bdstevel@tonic-gate * CISTPL_FUNCE
3687c478bdstevel@tonic-gate */
3697c478bdstevel@tonic-gatetypedef struct cistpl_funce_t {
3707c478bdstevel@tonic-gate	uint32_t	function;		/* type of extended data */
3717c478bdstevel@tonic-gate	uint32_t	subfunction;
3727c478bdstevel@tonic-gate	union {
3737c478bdstevel@tonic-gate		struct serial {
3747c478bdstevel@tonic-gate			uint32_t ua;	/* UART in use */
3757c478bdstevel@tonic-gate			uint32_t uc;	/* UART capabilities */
3767c478bdstevel@tonic-gate		} serial;
3777c478bdstevel@tonic-gate		struct modem {
3787c478bdstevel@tonic-gate			uint32_t fc;	/* supported flow control methods */
3797c478bdstevel@tonic-gate			uint32_t cb;	/* size of DCE command buffer */
3807c478bdstevel@tonic-gate			uint32_t eb;	/* size of DCE to DCE buffer */
3817c478bdstevel@tonic-gate			uint32_t tb;	/* size of DTE to DCE buffer */
3827c478bdstevel@tonic-gate		} modem;
3837c478bdstevel@tonic-gate		struct data_modem {
3847c478bdstevel@tonic-gate			uint32_t ud;	/* highest data rate */
3857c478bdstevel@tonic-gate			uint32_t ms;	/* modulation standards */
3867c478bdstevel@tonic-gate			/* err correct proto and non-CCITT modulation */
3877c478bdstevel@tonic-gate			uint32_t em;
3887c478bdstevel@tonic-gate			uint32_t dc;	/* data compression protocols */
3897c478bdstevel@tonic-gate			uint32_t cm;	/* command protocols */
3907c478bdstevel@tonic-gate			uint32_t ex;	/* escape mechanisms */
3917c478bdstevel@tonic-gate			uint32_t dy;	/* standardized data encryption */
3927c478bdstevel@tonic-gate			uint32_t ef;	/* misc. end user features */
3937c478bdstevel@tonic-gate			uint32_t ncd;	/* number of country codes */
3947c478bdstevel@tonic-gate			uchar_t cd[16];	/* CCITT country code */
3957c478bdstevel@tonic-gate		} data_modem;
3967c478bdstevel@tonic-gate		struct fax {
3977c478bdstevel@tonic-gate			uint32_t uf;	/* highest data rate in DTE/UART */
3987c478bdstevel@tonic-gate			uint32_t fm;	/* CCITT modulation standards */
3997c478bdstevel@tonic-gate			uint32_t fy;	/* standardized data encryption */
4007c478bdstevel@tonic-gate			uint32_t fs;	/* feature selection */
4017c478bdstevel@tonic-gate			uint32_t ncf; /* number of country codes */
4027c478bdstevel@tonic-gate			uchar_t cf[16];	/* CCITT country codes */
4037c478bdstevel@tonic-gate		} fax;
4047c478bdstevel@tonic-gate		struct voice {
4057c478bdstevel@tonic-gate			uint32_t uv;	/* highest data rate */
4067c478bdstevel@tonic-gate			uint32_t nsr;
4077c478bdstevel@tonic-gate			uint32_t sr[16]; /* voice sampling rates (*100) */
4087c478bdstevel@tonic-gate			uint32_t nss;
4097c478bdstevel@tonic-gate			uint32_t ss[16]; /* voice sample sizes (*10) */
4107c478bdstevel@tonic-gate			uint32_t nsc;
4117c478bdstevel@tonic-gate			uint32_t sc[16]; /* voice compression methods */
4127c478bdstevel@tonic-gate		} voice;
4137c478bdstevel@tonic-gate		struct lan {
4147c478bdstevel@tonic-gate			uint32_t tech; /* network technology */
4157c478bdstevel@tonic-gate			uint32_t speed; /* media bit or baud rate */
4167c478bdstevel@tonic-gate			uint32_t media; /* network media supported */
4177c478bdstevel@tonic-gate			uint32_t con; /* open/closed connector standard */
4187c478bdstevel@tonic-gate			uint32_t id_sz; /* length of lan station id */
4197c478bdstevel@tonic-gate			uchar_t id[16]; /* station ID */
4207c478bdstevel@tonic-gate		} lan;
4217c478bdstevel@tonic-gate	}   data;
4227c478bdstevel@tonic-gate} cistpl_funce_t;
4237c478bdstevel@tonic-gate
4247c478bdstevel@tonic-gate/* serial port subfunctions */
4257c478bdstevel@tonic-gate#define	TPLFE_SUB_SERIAL	0 /* serial port */
4267c478bdstevel@tonic-gate#define	TPLFE_SUB_MODEM_COMMON	1 /* common modem interface */
4277c478bdstevel@tonic-gate#define	TPLFE_SUB_MODEM_DATA	2 /* data modem services */
4287c478bdstevel@tonic-gate#define	TPLFE_SUB_MODEM_FAX	3 /* fax modem services */
4297c478bdstevel@tonic-gate#define	TPLFE_SUB_VOICE		4 /* voice services */
4307c478bdstevel@tonic-gate/* modem subfunctions for description of capabilities */
4317c478bdstevel@tonic-gate#define	TPLFE_CAP_MODEM_DATA	5 /* data modem capabilities */
4327c478bdstevel@tonic-gate#define	TPLFE_CAP_MODEM_FAX	6 /* fax modem capabilities */
4337c478bdstevel@tonic-gate#define	TPLFE_CAP_MODEM_VOICE	7 /* voice modem capabilities */
4347c478bdstevel@tonic-gate/* serial port subfunctions for description of capabilities */
4357c478bdstevel@tonic-gate#define	TPLFE_CAP_SERIAL_DATA	8 /* serial port capabilities - data modem */
4367c478bdstevel@tonic-gate#define	TPLFE_CAP_SERIAL_FAX	9 /* serial port capabilities - fax modem */
4377c478bdstevel@tonic-gate#define	TPLFE_CAP_SERIAL_VOICE 10 /* serial port capabilities - voice */
4387c478bdstevel@tonic-gate
4397c478bdstevel@tonic-gate/* serial port UART definitions */
4407c478bdstevel@tonic-gate#define	TPLFE_UA_8250		0 /* Intel 8250 */
4417c478bdstevel@tonic-gate#define	TPLFE_UA_16450		1 /* NS 16450 */
4427c478bdstevel@tonic-gate#define	TPLFE_UA_16550		2 /* NS 16550 */
4437c478bdstevel@tonic-gate
4447c478bdstevel@tonic-gate/* serial port capabilities definitions */
4457c478bdstevel@tonic-gate#define	TPLFE_UC_PARITY_SPACE	0x0001 /* space parity supported */
4467c478bdstevel@tonic-gate#define	TPLFE_UC_PARITY_MARK	0x0002 /* mark parity supported */
4477c478bdstevel@tonic-gate#define	TPLFE_UC_PARITY_ODD	0x0004 /* odd parity supported */
4487c478bdstevel@tonic-gate#define	TPLFE_UC_PARITY_EVEN	0x0008 /* even parity supported */
4497c478bdstevel@tonic-gate#define	TPLFE_UC_CS5		0x0100 /* 5 bit characters supported */
4507c478bdstevel@tonic-gate#define	TPLFE_UC_CS6		0x0200 /* 6 bit characters supported */
4517c478bdstevel@tonic-gate#define	TPLFE_UC_CS7		0x0400 /* 7 bit characters supported */
4527c478bdstevel@tonic-gate#define	TPLFE_UC_CS8		0x0800 /* 8 bit characters supported */
4537c478bdstevel@tonic-gate#define	TPLFE_UC_STOP_1		0x1000 /* 1 stop bit supported */
4547c478bdstevel@tonic-gate#define	TPLFE_UC_STOP_15	0x2000 /* 1.5 stop bits supported */
4557c478bdstevel@tonic-gate#define	TPLFE_UC_STOP_2		0x4000 /* 2 stop bits supported */
4567c478bdstevel@tonic-gate
4577c478bdstevel@tonic-gate/* modem flow control methods */
4587c478bdstevel@tonic-gate#define	TPLFE_FC_TX_XONOFF	0x01 /* transmit XON/XOFF */
4597c478bdstevel@tonic-gate#define	TPLFE_FC_RX_XONOFF	0x02 /* receiver XON/XOFF */
4607c478bdstevel@tonic-gate#define	TPLFE_FC_TX_HW		0x04 /* transmit hardware flow control (CTS) */
4617c478bdstevel@tonic-gate#define	TPLFE_FC_RX_HW		0x08 /* receiver hardware flow control (RTS) */
4627c478bdstevel@tonic-gate#define	TPLFE_FC_TRANS		0x10 /* tranparent flow control */
4637c478bdstevel@tonic-gate
4647c478bdstevel@tonic-gate/* modem modulation standards */
4657c478bdstevel@tonic-gate#define	TPLFE_MS_BELL103	0x0001 /* 300bps */
4667c478bdstevel@tonic-gate#define	TPLFE_MS_V21		0x0002 /* 300bps (V.21) */
4677c478bdstevel@tonic-gate#define	TPLFE_MS_V23		0x0004 /* 600/1200bps (V.23) */
4687c478bdstevel@tonic-gate#define	TPLFE_MS_V22AB		0x0008 /* 1200bps (V.22A V.22B) */
4697c478bdstevel@tonic-gate#define	TPLFE_MS_BELL212	0x0010 /* 2400bsp (US Bell 212) */
4707c478bdstevel@tonic-gate#define	TPLFE_MS_V22BIS		0x0020 /* 2400bps (V.22bis) */
4717c478bdstevel@tonic-gate#define	TPLFE_MS_V26		0x0040 /* 2400bps leased line (V.26) */
4727c478bdstevel@tonic-gate#define	TPLFE_MS_V26BIS		0x0080 /* 2400bps (V.26bis) */
4737c478bdstevel@tonic-gate#define	TPLFE_MS_V27BIS		0x0100 /* 4800/2400bps leased line (V.27bis) */
4747c478bdstevel@tonic-gate#define	TPLFE_MS_V29		0x0200 /* 9600/7200/4800 leased line (V.29) */
4757c478bdstevel@tonic-gate#define	TPLFE_MS_V32		0x0400 /* up to 9600bps (V.32) */
4767c478bdstevel@tonic-gate#define	TPLFE_MS_V32BIS		0x0800 /* up to 14400bps (V.32bis) */
4777c478bdstevel@tonic-gate#define	TPLFE_MS_VFAST		0x1000 /* up to 28800 V.FAST */
4787c478bdstevel@tonic-gate
4797c478bdstevel@tonic-gate/* modem error correction/detection protocols */
4807c478bdstevel@tonic-gate#define	TPLFE_EM_MNP		0x01 /* MNP levels 2-4 */
4817c478bdstevel@tonic-gate#define	TPLFE_EM_V42		0x02 /* CCITT LAPM (V.42) */
4827c478bdstevel@tonic-gate
4837c478bdstevel@tonic-gate/* modem data compression protocols */
4847c478bdstevel@tonic-gate#define	TPLFE_DC_V42BIS		0x01 /* CCITT compression V.42 */
4857c478bdstevel@tonic-gate#define	TPLFE_DC_MNP5		0x02 /* MNP compression (uses MNP 2, 3 or 4) */
4867c478bdstevel@tonic-gate
4877c478bdstevel@tonic-gate/* modem command protocols */
4887c478bdstevel@tonic-gate#define	TPLFE_CM_AT1	0x01 /* ANSI/EIA/TIA 602 "Action" commands */
4897c478bdstevel@tonic-gate#define	TPLFE_CM_AT2	0x02 /* ANSI/EIA/TIA 602 "ACE/DCE IF Params" */
4907c478bdstevel@tonic-gate#define	TPLFE_CM_AT3	0x04 /* ANSI/EIA/TIA 602 "Ace Parameters" */
4917c478bdstevel@tonic-gate#define	TPLFE_CM_MNP_AT	0x08 /* MNP specificat AT commands */
4927c478bdstevel@tonic-gate#define	TPLFE_CM_V25BIS	0x10 /* V.25bis calling commands */
4937c478bdstevel@tonic-gate#define	TPLFE_CM_V25A	0x20 /* V.25bis test procedures */
4947c478bdstevel@tonic-gate#define	TPLFE_CM_DMCL	0x40 /* DMCL command mode */
4957c478bdstevel@tonic-gate
4967c478bdstevel@tonic-gate/* modem escape mechanism */
4977c478bdstevel@tonic-gate#define	TPLFE_EX_BREAK		0x01 /* BREAK support standardized */
4987c478bdstevel@tonic-gate#define	TPLFE_EX_PLUS		0x02 /* +++ returns to command mode */
4997c478bdstevel@tonic-gate#define	TPLFE_EX_UD		0x04 /* user defined escape character */
5007c478bdstevel@tonic-gate
5017c478bdstevel@tonic-gate/* modem miscellaneous features */
5027c478bdstevel@tonic-gate#define	TPLFE_EF_CALLERID	0x01 /* Caller ID is supported */
5037c478bdstevel@tonic-gate
5047c478bdstevel@tonic-gate/* fax modulation standards */
5057c478bdstevel@tonic-gate#define	TPLFE_FM_V21C2	0x01 /* 300bps (V.21-C2) */
5067c478bdstevel@tonic-gate#define	TPLFE_FM_V27TER	0x02 /* 4800/2400bps (V.27ter) */
5077c478bdstevel@tonic-gate#define	TPLFE_FM_V29	0x04 /* 9600/7200/4800 leased line (V.29) */
5087c478bdstevel@tonic-gate#define	TPLFE_FM_V17	0x08 /* 14.4K/12K/9600/7200bps (V.17) */
5097c478bdstevel@tonic-gate#define	TPLFE_FM_V33	0x10 /* 14.4K/12K/9600/7200 lease line (V.33) */
5107c478bdstevel@tonic-gate
5117c478bdstevel@tonic-gate/* fax feature selection */
5127c478bdstevel@tonic-gate#define	TPLFE_FS_T3		0x01 /* Group 2 (T.3) service class */
5137c478bdstevel@tonic-gate#define	TPLFE_FS_T4		0x02 /* Group 3 (T.4) service class */
5147c478bdstevel@tonic-gate#define	TPLFE_FS_T6		0x04 /* Group 4 (T.6) service class */
5157c478bdstevel@tonic-gate#define	TPLFE_FS_ECM		0x08 /* Error Correction Modeer */
5167c478bdstevel@tonic-gate#define	TPLFE_FS_VOICEREQ	0x10 /* voice requests allowed */
5177c478bdstevel@tonic-gate#define	TPLFE_FS_POLLING	0x20 /* polling support */
5187c478bdstevel@tonic-gate#define	TPLFE_FS_FTP		0x40 /* file transfer support */
5197c478bdstevel@tonic-gate#define	TPLFE_FS_PASSWORD	0x80 /* password support */
5207c478bdstevel@tonic-gate
5217c478bdstevel@tonic-gate/* LAN tuple definitions */
5227c478bdstevel@tonic-gate#define	TPLFE_NETWORK_INFO	0x00
5237c478bdstevel@tonic-gate
5247c478bdstevel@tonic-gate/* LAN technology types */
5257c478bdstevel@tonic-gate#define	TPLFE_LAN_TECH_ARCNET		1
5267c478bdstevel@tonic-gate#define	TPLFE_LAN_TECH_ETHERNET		2
5277c478bdstevel@tonic-gate#define	TPLFE_LAN_TECH_TOKENRING	3
5287c478bdstevel@tonic-gate#define	TPLFE_LAN_TECH_LOCALTALK	4
5297c478bdstevel@tonic-gate#define	TPLFE_LAN_TECH_FDDI		5
5307c478bdstevel@tonic-gate#define	TPLFE_LAN_TECH_ATM		6
5317c478bdstevel@tonic-gate#define	TPLFE_LAN_TECH_WIRELESS		7
5327c478bdstevel@tonic-gate
5337c478bdstevel@tonic-gate/* LAN media types */
5347c478bdstevel@tonic-gate#define	TPLFE_LAN_MEDIA_INHERENT	0
5357c478bdstevel@tonic-gate#define	TPLFE_LAN_MEDIA_UTP		1
5367c478bdstevel@tonic-gate#define	TPLFE_LAN_MEDIA_STP		2
5377c478bdstevel@tonic-gate#define	TPLFE_LAN_MEDIA_THIN_COAX	3
5387c478bdstevel@tonic-gate#define	TPLFE_LAN_MEDIA_THICK_COAX	4
5397c478bdstevel@tonic-gate#define	TPLFE_LAN_MEDIA_FIBER		5
5407c478bdstevel@tonic-gate#define	TPLFE_LAN_MEDIA_SSR_902		6
5417c478bdstevel@tonic-gate#define	TPLFE_LAN_MEDIA_SSR_2_4		7
5427c478bdstevel@tonic-gate#define	TPLFE_LAN_MEDIA_SSR_5_4		8
5437c478bdstevel@tonic-gate#define	TPLFE_LAN_MEDIA_DIFFUSE_IR	9
5447c478bdstevel@tonic-gate#define	TPLFE_LAN_MEDIA_PTP_IR		10
5457c478bdstevel@tonic-gate
5467c478bdstevel@tonic-gate/*
5477c478bdstevel@tonic-gate * CISTPL_CFTABLE_ENTRY
5487c478bdstevel@tonic-gate *
5497c478bdstevel@tonic-gate * These flags and macros are used internally to the handler.
5507c478bdstevel@tonic-gate */
5517c478bdstevel@tonic-gate	/* mask to get the config entry number from TPCE_INDX */
5527c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_CFGENTRYM		0x03f
5537c478bdstevel@tonic-gate		/* default config bit in TPCE_INDX */
5547c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_DEFAULTM		0x040
5557c478bdstevel@tonic-gate		/* interface config byte follows */
5567c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IFM			0x080
5577c478bdstevel@tonic-gate
5587c478bdstevel@tonic-gate		/* power bit mask for tpce_fs */
5597c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_PWRM		0x003
5607c478bdstevel@tonic-gate		/* Vcc, Vpp1 and Vpp2 descriptions */
5617c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_PWR_VPP2M	0x003
5627c478bdstevel@tonic-gate		/* Vcc and Vpp1=Vpp2 descriptions */
5637c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_PWR_VPP1M	0x002
5647c478bdstevel@tonic-gate		/* Vcc description only */
5657c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_PWR_VCCM		0x001
5667c478bdstevel@tonic-gate		/* no connection on sleep/power down */
5677c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_NC_SLEEPM		0x07d
5687c478bdstevel@tonic-gate		/* zero value required */
5697c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_ZEROM			0x07e
5707c478bdstevel@tonic-gate		/* no connection ever */
5717c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_NCM			0x07f
5727c478bdstevel@tonic-gate
5737c478bdstevel@tonic-gate		/* timing data exists */
5747c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_TDM		0x004
5757c478bdstevel@tonic-gate		/* WAIT scale mask */
5767c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_TD_WAITM		0x003
5777c478bdstevel@tonic-gate#define	GET_TPCE_FS_TD_WAITS(sf)	((sf)& \
5787c478bdstevel@tonic-gate					    CISTPL_CFTABLE_TPCE_FS_TD_WAITM)
5797c478bdstevel@tonic-gate		/* RDY/BSY scale mask */
5807c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_TD_RDYM		0x01c
5817c478bdstevel@tonic-gate#define	GET_TPCE_FS_TD_RDYS(sf)	(((sf)>>2)& \
5827c478bdstevel@tonic-gate					CISTPL_CFTABLE_TPCE_FS_TD_RDYM)
5837c478bdstevel@tonic-gate		/* RSVD scale mask */
5847c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_TD_RSVDM		0x0e0
5857c478bdstevel@tonic-gate#define	GET_TPCE_FS_TD_RSVDS(sf)	(((sf)>>5)& \
5867c478bdstevel@tonic-gate					    CISTPL_CFTABLE_TPCE_FS_TD_RSVDM)
5877c478bdstevel@tonic-gate
5887c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_IOM		0x008	/* I/O data exists */
5897c478bdstevel@tonic-gate		/* I/O addr lines mask */
5907c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_IO_ALM		0x01f
5917c478bdstevel@tonic-gate		/* RANGE bit in TPCE_IO */
5927c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_IO_RANGEM	0x080
5937c478bdstevel@tonic-gate		/* max of 16 I/O ranges */
5947c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_ENTRY_MAX_IO_RANGES	16
5957c478bdstevel@tonic-gate
5967c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_IRQM		0x010	/* IRQ data exists */
5977c478bdstevel@tonic-gate		/* extended IRQ mask exists */
5987c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_IRQ_MASKM	0x010
5997c478bdstevel@tonic-gate
6007c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MEMM		0x060	/* mem space mask */
6017c478bdstevel@tonic-gate		/* space selection byte ... */
6027c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MEM3M		0x060
6037c478bdstevel@tonic-gate		/* length (2 bytes) and card address (2 bytes) */
6047c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MEM2M		0x040
6057c478bdstevel@tonic-gate		/* single 2-byte length */
6067c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MEM1M		0x020
6077c478bdstevel@tonic-gate		/* max of 8 mem space descriptors */
6087c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_ENTRY_MAX_MEM_WINDOWS	8
6097c478bdstevel@tonic-gate		/* number of bytes/page description */
6107c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MEM_PGSIZE	256
6117c478bdstevel@tonic-gate		/* host addr info present */
6127c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MEM_HOSTM	0x080
6137c478bdstevel@tonic-gate
6147c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MISCM		0x080	/* misc fields mask */
6157c478bdstevel@tonic-gate
6167c478bdstevel@tonic-gate/*
6177c478bdstevel@tonic-gate * Constants, macros, structures and flags used by cistpl_pd_parse()
6187c478bdstevel@tonic-gate *	cistpl_expd_parse() and the CISTPL_CFTABLE_ENTRY tuple handler.
6197c478bdstevel@tonic-gate */
6207c478bdstevel@tonic-gate#define	CISTPL_PD_MAN(m)	cistpl_pd_struct.mantissa[m&15]
6217c478bdstevel@tonic-gate#define	CISTPL_PD_EXP(e)	cistpl_pd_struct.exponent[e&7]
6227c478bdstevel@tonic-gatetypedef struct cistpl_pd_struct_t {
6237c478bdstevel@tonic-gate    uint32_t	*mantissa;
6247c478bdstevel@tonic-gate    uint32_t	*exponent;
6257c478bdstevel@tonic-gate} cistpl_pd_struct_t;
6267c478bdstevel@tonic-gate
6277c478bdstevel@tonic-gate/*
6287c478bdstevel@tonic-gate * These flags are passed to the caller in the cistpl_cftable_entry_t->flags
6297c478bdstevel@tonic-gate *	field and indicate what interface information is available.  The low
6307c478bdstevel@tonic-gate *	order byte of this field is reserved and no flags should be defined
6317c478bdstevel@tonic-gate *	to exist there.
6327c478bdstevel@tonic-gate */
6337c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_DEFAULT	0x000000100 /* this is a default conf */
6347c478bdstevel@tonic-gate
6357c478bdstevel@tonic-gate/* interface config description present flags */
6367c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF		0x000000200 /* if config byte exists */
6377c478bdstevel@tonic-gate/*
6387c478bdstevel@tonic-gate * When the CISTPL_CFTABLE_TPCE_IF flag is set, the following flags
6397c478bdstevel@tonic-gate *	are available in the ifc member of the cistpl_cftable_entry_t
6407c478bdstevel@tonic-gate *	structure.
6417c478bdstevel@tonic-gate */
6427c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_MEMORY	0x00	/* memory interface */
6437c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_IO_MEM	0x01	/* IO and memory */
6447c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_RSVD_2	0x02	/* reserved */
6457c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_RSVD_3	0x03	/* reserved */
6467c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_CUSTOM_0	0x04	/* custom interface 0 */
6477c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_CUSTOM_1	0x05	/* custom interface 1 */
6487c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_CUSTOM_2	0x06	/* custom interface 2 */
6497c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_CUSTOM_3	0x07	/* custom interface 3 */
6507c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_RSVD_8	0x08	/* reserved */
6517c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_RSVD_9	0x09	/* reserved */
6527c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_RSVD_a	0x0a	/* reserved */
6537c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_RSVD_b	0x0b	/* reserved */
6547c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_RSVD_c	0x0c	/* reserved */
6557c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_RSVD_d	0x0d	/* reserved */
6567c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_RSVD_e	0x0e	/* reserved */
6577c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_RSVD_f	0x0f	/* reserved */
6587c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_MASK	0x0f	/* interface type mask */
6597c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_BVD	0x10	/* BVD active in PRR */
6607c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_WP	0x20	/* WP active in PRR */
6617c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_RDY	0x40	/* RDY active in PRR */
6627c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_IF_MWAIT	0x80	/* WAIT - mem cycles */
6637c478bdstevel@tonic-gate
6647c478bdstevel@tonic-gate/* power description present flags */
6657c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_PWR	0x000001000 /* power info exists */
6667c478bdstevel@tonic-gate
6677c478bdstevel@tonic-gate/* timing description present flags */
6687c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_TD	0x000010000 /* timing info exists */
6697c478bdstevel@tonic-gate
6707c478bdstevel@tonic-gate/* I/O description present flags */
6717c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_IO	0x000100000 /* I/O information exists */
6727c478bdstevel@tonic-gate
6737c478bdstevel@tonic-gate/* IRQ description present flags */
6747c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_IRQ	0x000200000 /* IRQ information exists */
6757c478bdstevel@tonic-gate
6767c478bdstevel@tonic-gate/* memory space description present flags */
6777c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MEM	0x001000000 /* MEM space info exists */
6787c478bdstevel@tonic-gate
6797c478bdstevel@tonic-gate/* misc description present flags */
6807c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MISC	0x002000000 /* MISC info exists */
6817c478bdstevel@tonic-gate
6827c478bdstevel@tonic-gate/* additional information tuples present flags */
6837c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_STCE_EV	0x004000000 /* STCE_EV exists */
6847c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_STCE_PD	0x008000000 /* STCE_PD exists */
6857c478bdstevel@tonic-gate
6867c478bdstevel@tonic-gate/*
6877c478bdstevel@tonic-gate * Power description flags and structures.
6887c478bdstevel@tonic-gate *
6897c478bdstevel@tonic-gate * The following eight values represent what the power description structure
6907c478bdstevel@tonic-gate *	parameter selection byte tells us is present.  A copy of this byte
6917c478bdstevel@tonic-gate *	is in the low order byte of each parameter's flag field.
6927c478bdstevel@tonic-gate */
6937c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_NOMV		0x001	/* nominal supply voltage */
6947c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_MINV		0x002	/* minimum supply voltage */
6957c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_MAXV		0x004	/* maximum supply voltage */
6967c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_STATICI	0x008	/* continuous supply current */
6977c478bdstevel@tonic-gate		/* max current required averaged over 1 second */
6987c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_AVGI		0x010
6997c478bdstevel@tonic-gate		/* maximum current required averaged over 10mS */
7007c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_PEAKI		0x020
7017c478bdstevel@tonic-gate		/* power down supply curent required */
7027c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_PDOWNI	0x040
7037c478bdstevel@tonic-gate		/* power supply is about to blow up */
7047c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_RFU		0x080
7057c478bdstevel@tonic-gate
7067c478bdstevel@tonic-gate/*
7077c478bdstevel@tonic-gate * For each voltage/current parameter, there is an associated flags field.
7087c478bdstevel@tonic-gate *	The following flags are in this field.  The low order byte of each
7097c478bdstevel@tonic-gate *	of these flags fields also contains a copy of the power description
7107c478bdstevel@tonic-gate *	structure parameter selection byte as read from the tuple, that's why
7117c478bdstevel@tonic-gate *	we start the flag values at 0x0100 and go up from there.
7127c478bdstevel@tonic-gate */
7137c478bdstevel@tonic-gate		/* this parameter exists */
7147c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_EXISTS	0x000000100
7157c478bdstevel@tonic-gate		/* multiply return value by 10 */
7167c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_MUL10		0x000000200
7177c478bdstevel@tonic-gate		/* no connection on sleep/power down */
7187c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_NC_SLEEP	0x000001000
7197c478bdstevel@tonic-gate		/* zero value required */
7207c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_ZERO		0x000002000
7217c478bdstevel@tonic-gate		/* no connection ever */
7227c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_PD_NC		0x000004000
7237c478bdstevel@tonic-gate
7247c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_pwr_t {
7257c478bdstevel@tonic-gate	uint32_t	nomV;		/* nominal supply voltage */
7267c478bdstevel@tonic-gate	uint32_t	nomV_flags;
7277c478bdstevel@tonic-gate	uint32_t	minV;		/* minimum supply voltage */
7287c478bdstevel@tonic-gate	uint32_t	minV_flags;
7297c478bdstevel@tonic-gate	uint32_t	maxV;		/* maximum supply voltage */
7307c478bdstevel@tonic-gate	uint32_t	maxV_flags;
7317c478bdstevel@tonic-gate	uint32_t	staticI;	/* continuous supply current */
7327c478bdstevel@tonic-gate	uint32_t	staticI_flags;
7337c478bdstevel@tonic-gate	uint32_t	avgI;		/* max current required */
7347c478bdstevel@tonic-gate					/* averaged over 1 sec. */
7357c478bdstevel@tonic-gate	uint32_t	avgI_flags;
7367c478bdstevel@tonic-gate	uint32_t	peakI;		/* max current required */
7377c478bdstevel@tonic-gate					/* averaged over 10mS */
7387c478bdstevel@tonic-gate	uint32_t	peakI_flags;
7397c478bdstevel@tonic-gate	uint32_t	pdownI;		/* power down supply curent required */
7407c478bdstevel@tonic-gate	uint32_t	pdownI_flags;
7417c478bdstevel@tonic-gate} cistpl_cftable_entry_pwr_t;
7427c478bdstevel@tonic-gate
7437c478bdstevel@tonic-gate/*
7447c478bdstevel@tonic-gate * Flags for the global power description structure.  These show up in
7457c478bdstevel@tonic-gate *	the flags field of the structure.
7467c478bdstevel@tonic-gate */
7477c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_PWR_VCC	0x000000001 /* Vcc description valid  */
7487c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_PWR_VPP1	0x000000002 /* vpp1 description valid */
7497c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_PWR_VPP2	0x000000004 /* Vpp2 description valid */
7507c478bdstevel@tonic-gate
7517c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_pd_t {
7527c478bdstevel@tonic-gate	uint32_t	flags; /* which descriptions are valid */
7537c478bdstevel@tonic-gate	struct cistpl_cftable_entry_pwr_t pd_vcc; /* VCC power description */
7547c478bdstevel@tonic-gate	struct cistpl_cftable_entry_pwr_t pd_vpp1; /* Vpp1 power description */
7557c478bdstevel@tonic-gate	struct cistpl_cftable_entry_pwr_t pd_vpp2; /* Vpp2 power description */
7567c478bdstevel@tonic-gate} cistpl_cftable_entry_pd_t;
7577c478bdstevel@tonic-gate
7587c478bdstevel@tonic-gate/*
7597c478bdstevel@tonic-gate * Device speed structure.  Each field is only valid if the
7607c478bdstevel@tonic-gate *	CISTPL_CFTABLE_TPCE_FS_TD flag is set.
7617c478bdstevel@tonic-gate *
7627c478bdstevel@tonic-gate * The following flags describe which timing information is available.
7637c478bdstevel@tonic-gate *	They appear in the flags field of the device speed structure.
7647c478bdstevel@tonic-gate */
7657c478bdstevel@tonic-gate		/* WAIT timing exists */
7667c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_TD_WAIT	0x000000001
7677c478bdstevel@tonic-gate		/* RDY/BSY timing exists */
7687c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_TD_RDY	0x000000002
7697c478bdstevel@tonic-gate		/* RSVD timing exists */
7707c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_TD_RSVD	0x000000004
7717c478bdstevel@tonic-gate
7727c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_speed_t {
7737c478bdstevel@tonic-gate    uint32_t	flags;		/* which timing information is present */
7747c478bdstevel@tonic-gate    uint32_t	wait;		/* max WAIT time in device speed format */
7757c478bdstevel@tonic-gate    uint32_t	nS_wait;	/* max WAIT time in nS */
7767c478bdstevel@tonic-gate    uint32_t	rdybsy;		/* max RDY/BSY time in device speed format */
7777c478bdstevel@tonic-gate    uint32_t	nS_rdybsy;	/* max RDY/BSY time in nS */
7787c478bdstevel@tonic-gate    uint32_t	rsvd;		/* max RSVD time in device speed format */
7797c478bdstevel@tonic-gate    uint32_t	nS_rsvd;	/* max RSVD time in nS */
7807c478bdstevel@tonic-gate} cistpl_cftable_entry_speed_t;
7817c478bdstevel@tonic-gate
7827c478bdstevel@tonic-gate/*
7837c478bdstevel@tonic-gate * Device I/O range description structures.  Only valid if the
7847c478bdstevel@tonic-gate *	CISTPL_CFTABLE_TPCE_FS_IO flag is set.
7857c478bdstevel@tonic-gate *
7867c478bdstevel@tonic-gate * The following flags describe the IO description information. They
7877c478bdstevel@tonic-gate *	appear in the flags field of the IO space description structure.
7887c478bdstevel@tonic-gate */
7897c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_IO_BUS	0x060	/* bus width mask */
7907c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_IO_BUS8	0x020	/* 8-bit flag */
7917c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_IO_BUS16	0x040	/* 16-bit flag */
7927c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_IO_RANGE	0x080	/* IO address ranges exist */
7937c478bdstevel@tonic-gate
7947c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_io_range_t {
7957c478bdstevel@tonic-gate    uint32_t	addr;		/* I/O start address */
7967c478bdstevel@tonic-gate    uint32_t	length;		/* I/O register length */
7977c478bdstevel@tonic-gate} cistpl_cftable_entry_io_range_t;
7987c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_io_t {
7997c478bdstevel@tonic-gate    uint32_t	flags;		/* direct copy of TPCE_IO byte in tuple */
8007c478bdstevel@tonic-gate    uint32_t	addr_lines;	/* number of decoded I/O address lines */
8017c478bdstevel@tonic-gate    uint32_t	ranges;		/* number of I/O ranges */
8027c478bdstevel@tonic-gate    struct cistpl_cftable_entry_io_range_t
8037c478bdstevel@tonic-gate	    range[CISTPL_CFTABLE_ENTRY_MAX_IO_RANGES];
8047c478bdstevel@tonic-gate} cistpl_cftable_entry_io_t;
8057c478bdstevel@tonic-gate
8067c478bdstevel@tonic-gate/*
8077c478bdstevel@tonic-gate * Device IRQ description structure.  Only valid if the
8087c478bdstevel@tonic-gate *	CISTPL_CFTABLE_TPCE_FS_IRQ flag is set.
8097c478bdstevel@tonic-gate */
8107c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_irq_t {
8117c478bdstevel@tonic-gate    uint32_t	flags;		/* direct copy of TPCE_IR byte in tuple */
8127c478bdstevel@tonic-gate    uint32_t	irqs;		/* bit mask for each allowed IRQ */
8137c478bdstevel@tonic-gate} cistpl_cftable_entry_irq_t;
8147c478bdstevel@tonic-gate
8157c478bdstevel@tonic-gate/*
8167c478bdstevel@tonic-gate * Device memory space description structure.  Only valid if the
8177c478bdstevel@tonic-gate *	CISTPL_CFTABLE_TPCE_FS_MEM flag is set.
8187c478bdstevel@tonic-gate *
8197c478bdstevel@tonic-gate * The following flags describe the memory description information.  They
8207c478bdstevel@tonic-gate *	appear in the flags field of the memory space description structure.
8217c478bdstevel@tonic-gate */
8227c478bdstevel@tonic-gate		/* space descriptors */
8237c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MEM3	0x000000001
8247c478bdstevel@tonic-gate		/* host_addr=card_addr */
8257c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MEM2	0x000000002
8267c478bdstevel@tonic-gate		/* card address=0, any host address */
8277c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MEM1	0x000000004
8287c478bdstevel@tonic-gate		/* if host address is present in MEM3 */
8297c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MEM_HOST	0x000000008
8307c478bdstevel@tonic-gate
8317c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_mem_window_t {
8327c478bdstevel@tonic-gate    uint32_t	length;		/* length of this window */
8337c478bdstevel@tonic-gate    uint32_t	card_addr;	/* card address */
8347c478bdstevel@tonic-gate    uint32_t	host_addr;	/* host address */
8357c478bdstevel@tonic-gate} cistpl_cftable_entry_mem_window_t;
8367c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_mem_t {
8377c478bdstevel@tonic-gate    uint32_t	flags;		/* memory desc type and host addr info */
8387c478bdstevel@tonic-gate    uint32_t	windows;	/* number of memory space descriptors */
8397c478bdstevel@tonic-gate    cistpl_cftable_entry_mem_window_t
8407c478bdstevel@tonic-gate	    window[CISTPL_CFTABLE_ENTRY_MAX_MEM_WINDOWS];
8417c478bdstevel@tonic-gate} cistpl_cftable_entry_mem_t;
8427c478bdstevel@tonic-gate
8437c478bdstevel@tonic-gate/*
8447c478bdstevel@tonic-gate * Devices misc description structure.  Only valid if the
8457c478bdstevel@tonic-gate *	CISTPL_CFTABLE_TPCE_FS_MISC flag is set.
8467c478bdstevel@tonic-gate */
8477c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_FS_MISC_MAX	2	   /* # bytes we understand */
8487c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_MI_MTC_MASK	0x00000007 /* max twin cards mask */
8497c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_MI_AUDIO	0x00000008 /* audio on BVD2 */
8507c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_MI_READONLY	0x00000010 /* R/O storage */
8517c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_MI_PWRDOWN	0x00000020 /* powerdown capable */
8527c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_MI_DRQ_MASK	0x00000c00 /* DMAREQ mask */
8537c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_MI_DRQ_SPK	0x00000400 /* DMAREQ on SPKR */
8547c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_MI_DRQ_IOIS	0x00000800 /* DMAREQ on IOIS16 */
8557c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_MI_DRQ_INP	0x00000c00 /* DMAREQ on INPACK */
8567c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_MI_DMA_8	0x00000000 /* DMA width 8 bits */
8577c478bdstevel@tonic-gate#define	CISTPL_CFTABLE_TPCE_MI_DMA_16	0x00001000 /* DMA width 16 bits */
8587c478bdstevel@tonic-gate
8597c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_misc_t {
8607c478bdstevel@tonic-gate    uint32_t	flags;		/* misc features flags */
8617c478bdstevel@tonic-gate} cistpl_cftable_entry_misc_t;
8627c478bdstevel@tonic-gate
8637c478bdstevel@tonic-gate/*
8647c478bdstevel@tonic-gate * Additional information sub-tuples defines and structure
8657c478bdstevel@tonic-gate */
8667c478bdstevel@tonic-gate#define	STCE_EV		0x0c0	/* Environment Descriptor Subtuple */
8677c478bdstevel@tonic-gate#define	STCE_PD		0x0c1	/* Physical Device Name Subtuple */
8687c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_stce_ev_t {
8697c478bdstevel@tonic-gate	char	stev_strs[CIS_MAX_TUPLE_DATA_LEN];
8707c478bdstevel@tonic-gate} cistpl_cftable_entry_stce_ev_t;
8717c478bdstevel@tonic-gate
8727c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_stce_pd_t {
8737c478bdstevel@tonic-gate	char	stpd_strs[CIS_MAX_TUPLE_DATA_LEN];
8747c478bdstevel@tonic-gate} cistpl_cftable_entry_stce_pd_t;
8757c478bdstevel@tonic-gate
8767c478bdstevel@tonic-gate/*
8777c478bdstevel@tonic-gate * cistpl_cftable_entry_t - this is the struct that the caller passes
8787c478bdstevel@tonic-gate *				to the CISTPL_CFTABLE_ENTRY handler
8797c478bdstevel@tonic-gate */
8807c478bdstevel@tonic-gatetypedef struct cistpl_cftable_entry_t {
8817c478bdstevel@tonic-gate    uint32_t	flags;		/* which descriptions are valid */
8827c478bdstevel@tonic-gate    uint32_t	ifc;		/* interface description info */
8837c478bdstevel@tonic-gate    uint32_t	pin;		/* values for PRR */
8847c478bdstevel@tonic-gate    uint32_t	index;		/* configuration index number */
8857c478bdstevel@tonic-gate    struct cistpl_cftable_entry_pd_t	pd; /* power requirements description */
8867c478bdstevel@tonic-gate    struct cistpl_cftable_entry_speed_t	speed; /* device speed description */
8877c478bdstevel@tonic-gate    struct cistpl_cftable_entry_io_t	io; /* device I/O map */
8887c478bdstevel@tonic-gate    struct cistpl_cftable_entry_irq_t	irq; /* device IRQ utilization */
8897c478bdstevel@tonic-gate    struct cistpl_cftable_entry_mem_t	mem; /* device memory space */
8907c478bdstevel@tonic-gate    struct cistpl_cftable_entry_misc_t	misc; /* misc device features */
8917c478bdstevel@tonic-gate} cistpl_cftable_entry_t;
8927c478bdstevel@tonic-gate
8937c478bdstevel@tonic-gate/*
8947c478bdstevel@tonic-gate * CISTPL_LINKTARGET
8957c478bdstevel@tonic-gate *
8967c478bdstevel@tonic-gate * This tuple is used to verify that tuple chains other than the primary
8977c478bdstevel@tonic-gate *	chain which starts at offset 0 in Attribute Memory are valid. All
8987c478bdstevel@tonic-gate *	secondary tuple chains are required to contain this tuple as the
8997c478bdstevel@tonic-gate *	first tuple of the chain.
9007c478bdstevel@tonic-gate * This tuple must have a link field of at least MIN_LINKTARGET_LENGTH and
9017c478bdstevel@tonic-gate *	must contain the byte pattern CISTPL_LINKTARGET_MAGIC.
9027c478bdstevel@tonic-gate * LINKTARGET_AC_HEADER_LENGTH is the number of bytes contained in a
9037c478bdstevel@tonic-gate *	valid CISTPL_LINKTARGET tuple header.
9047c478bdstevel@tonic-gate */
9057c478bdstevel@tonic-gate#define	MIN_LINKTARGET_LENGTH		3
9067c478bdstevel@tonic-gate#define	CISTPL_LINKTARGET_MAGIC		"CIS"
9077c478bdstevel@tonic-gate#define	LINKTARGET_AC_HEADER_LENGTH	2
9087c478bdstevel@tonic-gate
9097c478bdstevel@tonic-gatetypedef struct cistpl_linktarget_t {
9107c478bdstevel@tonic-gate	uint32_t	length;		/* number of bytes in tpltg_tag */
9117c478bdstevel@tonic-gate	char	tpltg_tag[CIS_MAX_TUPLE_DATA_LEN];
9127c478bdstevel@tonic-gate} cistpl_linktarget_t;
9137c478bdstevel@tonic-gate
9147c478bdstevel@tonic-gate/*
9157c478bdstevel@tonic-gate * CISTPL_LONGLINK_A and CISTPL_LONGLINK_C
9167c478bdstevel@tonic-gate *
9177c478bdstevel@tonic-gate * Both of these tuples are processed the same way. The target address is
9187c478bdstevel@tonic-gate *	really an offset from the beginning of the specified address space
9197c478bdstevel@tonic-gate *	and is not a virtual address.
9207c478bdstevel@tonic-gate * This tuple must have a link field of at least MIN_LONGLINK_AC_LENGTH.
9217c478bdstevel@tonic-gate */
9227c478bdstevel@tonic-gate#define	MIN_LONGLINK_AC_LENGTH		4
9237c478bdstevel@tonic-gate
9247c478bdstevel@tonic-gatetypedef struct cistpl_longlink_ac_t {
9257c478bdstevel@tonic-gate	uint32_t		flags;		/* space flags */
9267c478bdstevel@tonic-gate	uint32_t		tpll_addr;	/* target address, normalized */
9277c478bdstevel@tonic-gate} cistpl_longlink_ac_t;
9287c478bdstevel@tonic-gate/*
9297c478bdstevel@tonic-gate * Flags for cistpl_longlink_ac_t->flags
9307c478bdstevel@tonic-gate */
9317c478bdstevel@tonic-gate#define	CISTPL_LONGLINK_AC_AM	0x0001	/* longlink to AM */
9327c478bdstevel@tonic-gate#define	CISTPL_LONGLINK_AC_CM	0x0002	/* longlink to CM */
9337c478bdstevel@tonic-gate
9347c478bdstevel@tonic-gate/*
9357c478bdstevel@tonic-gate * CISTPL_LONGLINK_MFC
9367c478bdstevel@tonic-gate *
9377c478bdstevel@tonic-gate * This tuple describes the start of the function-specific CIS for each
9387c478bdstevel@tonic-gate *	function on a multi-function card.
9397c478bdstevel@tonic-gate *
9407c478bdstevel@tonic-gate * This tuple must have a link field of at least MIN_LONGLINK_AC_LENGTH.
9417c478bdstevel@tonic-gate */
9427c478bdstevel@tonic-gate#define	MIN_LONGLINK_MFC_LENGTH		6
9437c478bdstevel@tonic-gate#define	MIN_LONGLINK_MFC_NREGS		1
9447c478bdstevel@tonic-gate
9457c478bdstevel@tonic-gatetypedef struct cis_function_t {
9467c478bdstevel@tonic-gate	uint32_t	tas;    /* target address space of function */
9477c478bdstevel@tonic-gate	uint32_t	addr;   /* target address offset */
9487c478bdstevel@tonic-gate} cis_function_t;
9497c478bdstevel@tonic-gate
9507c478bdstevel@tonic-gatetypedef struct cistpl_longlink_mfc_t {
9517c478bdstevel@tonic-gate	uint32_t	nfuncs;		/* number of functions */
9527c478bdstevel@tonic-gate	uint32_t	nregs;		/* number of config register sets */
9537c478bdstevel@tonic-gate	cis_function_t	function[CIS_MAX_FUNCTIONS];
9547c478bdstevel@tonic-gate} cistpl_longlink_mfc_t;
9557c478bdstevel@tonic-gate/*
9567c478bdstevel@tonic-gate * Flags for cistpl_longlink_mfc_t->function[n]->tas
9577c478bdstevel@tonic-gate */
9587c478bdstevel@tonic-gate#define	CISTPL_LONGLINK_MFC_TAS_AM	0x00	/* CIS in attribute memory */
9597c478bdstevel@tonic-gate#define	CISTPL_LONGLINK_MFC_TAS_CM	0x01	/* CIS in common memory */
9607c478bdstevel@tonic-gate
9617c478bdstevel@tonic-gate/*
9627c478bdstevel@tonic-gate * CISTPL_LONGLINK_CB
9637c478bdstevel@tonic-gate *
9647c478bdstevel@tonic-gate * This tuple describes the start of a function's CIS chain
9657c478bdstevel@tonic-gate *	for CardBus cards
9667c478bdstevel@tonic-gate */
9677c478bdstevel@tonic-gatetypedef struct cistpl_longlink_cb_t {
9687c478bdstevel@tonic-gate	uint32_t	flags;		/* address space flags */
9697c478bdstevel@tonic-gate	uint32_t	addr;		/* raw (unproessed) address value */
9707c478bdstevel@tonic-gate	union {
9717c478bdstevel@tonic-gate	    /* device-dependant config space info */
9727c478bdstevel@tonic-gate	    struct {
9737c478bdstevel@tonic-gate		uint32_t	offset;	/* offset within config space */
9747c478bdstevel@tonic-gate	    } cfg;
9757c478bdstevel@tonic-gate	    /* memory space info */
9767c478bdstevel@tonic-gate	    struct {
9777c478bdstevel@tonic-gate		uint32_t	asi;	/* BAR */
9787c478bdstevel@tonic-gate		uint32_t	offset;	/* offset within BAR space */
9797c478bdstevel@tonic-gate	    } mem;
9807c478bdstevel@tonic-gate	    /* expansion ROM space info */
9817c478bdstevel@tonic-gate	    struct {
9827c478bdstevel@tonic-gate		uint32_t	image;	/* image number */
9837c478bdstevel@tonic-gate		uint32_t	offset;	/* offset from iamge base */
9847c478bdstevel@tonic-gate	    } rom;
9857c478bdstevel@tonic-gate	} space;
9867c478bdstevel@tonic-gate} cistpl_longlink_cb_t;
9877c478bdstevel@tonic-gate/*
9887c478bdstevel@tonic-gate * Flags for cistpl_longlink_cb_t->flags
9897c478bdstevel@tonic-gate */
9907c478bdstevel@tonic-gate#define	CISTPL_LONGLINK_CB_CFG	0x0001	/* config space info valid */
9917c478bdstevel@tonic-gate#define	CISTPL_LONGLINK_CB_MEM	0x0002	/* memory space info valid */
9927c478bdstevel@tonic-gate#define	CISTPL_LONGLINK_CB_ROM	0x0004	/* expansion ROM space info valid */
9937c478bdstevel@tonic-gate
9947c478bdstevel@tonic-gate/*
9957c478bdstevel@tonic-gate * CISTPL_SPCL
9967c478bdstevel@tonic-gate *
9977c478bdstevel@tonic-gate * This tuple is the Special Purpose tuple and it's contents are dependant
9987c478bdstevel@tonic-gate *	on the meaning of the header information in this tuple.
9997c478bdstevel@tonic-gate */
10007c478bdstevel@tonic-gatetypedef struct cistpl_spcl_t {
10017c478bdstevel@tonic-gate	uint32_t	id;		/* tuple contents identification */
10027c478bdstevel@tonic-gate	uint32_t	seq;		/* data sequence number */
10037c478bdstevel@tonic-gate	uint32_t	bytes;		/* number of bytes following */
10047c478bdstevel@tonic-gate	uchar_t		data[CIS_MAX_TUPLE_DATA_LEN];
10057c478bdstevel@tonic-gate} cistpl_spcl_t;
10067c478bdstevel@tonic-gate/*
10077c478bdstevel@tonic-gate * Flags for cistpl_spcl_t->seq
10087c478bdstevel@tonic-gate */
10097c478bdstevel@tonic-gate#define	CISTPL_SPCL_SEQ_END	0x080	/* last tuple in sequence */
10107c478bdstevel@tonic-gate
10117c478bdstevel@tonic-gate/*
10127c478bdstevel@tonic-gate * CISTPL_SWIL
10137c478bdstevel@tonic-gate *
10147c478bdstevel@tonic-gate * This tuple describes the software interleaving of data within a
10157c478bdstevel@tonic-gate *	partition on the card.
10167c478bdstevel@tonic-gate */
10177c478bdstevel@tonic-gatetypedef struct cistpl_swil_t {
10187c478bdstevel@tonic-gate	uint32_t	intrlv;		/* interleave */
10197c478bdstevel@tonic-gate} cistpl_swil_t;
10207c478bdstevel@tonic-gate
10217c478bdstevel@tonic-gate/*
10227c478bdstevel@tonic-gate * CISTPL_BAR
10237c478bdstevel@tonic-gate *
10247c478bdstevel@tonic-gate * This tuple describes the CardBus Base Address Registers
10257c478bdstevel@tonic-gate */
10267c478bdstevel@tonic-gatetypedef struct cistpl_bar_t {
10277c478bdstevel@tonic-gate	uint32_t	attributes;	/* attributes */
10287c478bdstevel@tonic-gate	uint32_t	size;		/* BAR size */
10297c478bdstevel@tonic-gate} cistpl_bar_t;
10307c478bdstevel@tonic-gate/*
10317c478bdstevel@tonic-gate * Flags for cistpl_bar_t->attributes
10327c478bdstevel@tonic-gate */
10337c478bdstevel@tonic-gate#define	CISTPL_BAR_ASI_MASK	0x007	/* Base Address Register mask */
10347c478bdstevel@tonic-gate#define	CISTPL_BAR_ASI_BAR_1	0x001	/* Base Address Register 1 */
10357c478bdstevel@tonic-gate#define	CISTPL_BAR_ASI_BAR_2	0x002	/* Base Address Register 2 */
10367c478bdstevel@tonic-gate#define	CISTPL_BAR_ASI_BAR_3	0x003	/* Base Address Register 3 */
10377c478bdstevel@tonic-gate#define	CISTPL_BAR_ASI_BAR_4	0x004	/* Base Address Register 4 */
10387c478bdstevel@tonic-gate#define	CISTPL_BAR_ASI_BAR_5	0x005	/* Base Address Register 5 */
10397c478bdstevel@tonic-gate#define	CISTPL_BAR_ASI_BAR_6	0x006	/* Base Address Register 6 */
10407c478bdstevel@tonic-gate#define	CISTPL_BAR_ASI_BAR_7	0x007	/* Base Address Register 7 */
10417c478bdstevel@tonic-gate#define	CISTPL_BAR_ASI_EXP_ROM	0x007	/* Expansion ROM BAR */
10427c478bdstevel@tonic-gate
10437c478bdstevel@tonic-gate#define	CISTPL_BAR_AS_MEM	0x000	/* BAR is of type memory */
10447c478bdstevel@tonic-gate#define	CISTPL_BAR_AS_IO	0x008	/* BAR is of type IO */
10457c478bdstevel@tonic-gate
10467c478bdstevel@tonic-gate#define	CISTPL_BAR_PREFETCH_CACHE_MASK	0x060	/* prefetch/cache mask */
10477c478bdstevel@tonic-gate#define	CISTPL_BAR_PREFETCH		0x020	/* prefetchable not cacheable */
10487c478bdstevel@tonic-gate#define	CISTPL_BAR_PREFETCH_CACHE	0x040	/* prefetchable and cacheable */
10497c478bdstevel@tonic-gate
10507c478bdstevel@tonic-gate#define	CISTPL_BAR_BELOW_1MB	0x080	/* must locate within first MB */
10517c478bdstevel@tonic-gate
10527c478bdstevel@tonic-gate/*
10537c478bdstevel@tonic-gate * CISTPL_DEVICEGEO and CISTPL_DEVICEGEO_A
10547c478bdstevel@tonic-gate *
10557c478bdstevel@tonic-gate * These tuples describe the device geometry of memory partitions.
10567c478bdstevel@tonic-gate */
10577c478bdstevel@tonic-gate#define	CISTPL_DEVICEGEO_MAX_PARTITIONS	42
10587c478bdstevel@tonic-gatetypedef struct cistpl_devicegeo_info_t {
10597c478bdstevel@tonic-gate	uint32_t	bus;		/* card interface width in bytes */
10607c478bdstevel@tonic-gate	uint32_t	ebs;		/* minimum erase block size */
10617c478bdstevel@tonic-gate	uint32_t	rbs;		/* minimum read block size */
10627c478bdstevel@tonic-gate	uint32_t	wbs;		/* minimum write bock size */
10637c478bdstevel@tonic-gate	uint32_t	part;		/* segment partition subdivisions */
10647c478bdstevel@tonic-gate	uint32_t	hwil;		/* hardware interleave */
10657c478bdstevel@tonic-gate} cistpl_devicegeo_info_t;
10667c478bdstevel@tonic-gatetypedef struct cistpl_devicegeo_t {
10677c478bdstevel@tonic-gate	cistpl_devicegeo_info_t	info[CISTPL_DEVICEGEO_MAX_PARTITIONS];
10687c478bdstevel@tonic-gate} cistpl_devicegeo_t;
10697c478bdstevel@tonic-gate
10707c478bdstevel@tonic-gate/*
10717c478bdstevel@tonic-gate * The cistpl_get_tuple_name_t used to support the HANDTPL_RETURN_NAME
10727c478bdstevel@tonic-gate *	operation of the CIS parser.
10737c478bdstevel@tonic-gate */
10747c478bdstevel@tonic-gatetypedef struct cistpl_get_tuple_name_t {
10757c478bdstevel@tonic-gate	char	name[CIS_MAX_TUPLE_NAME_LEN];
10767c478bdstevel@tonic-gate} cistpl_get_tuple_name_t;
10777c478bdstevel@tonic-gate
10787c478bdstevel@tonic-gate/*
10797c478bdstevel@tonic-gate * cisparse_t - the structure that unifies all tuple parsing structures
10807c478bdstevel@tonic-gate */
10817c478bdstevel@tonic-gatetypedef union cisparse_t {
10827c478bdstevel@tonic-gate	cistpl_config_t		cistpl_config;
10837c478bdstevel@tonic-gate	cistpl_device_t		cistpl_device;
10847c478bdstevel@tonic-gate	cistpl_vers_1_t		cistpl_vers_1;
10857c478bdstevel@tonic-gate	cistpl_vers_2_t		cistpl_vers_2;
10867c478bdstevel@tonic-gate	cistpl_jedec_t		cistpl_jedec;
10877c478bdstevel@tonic-gate	cistpl_format_t		cistpl_format;
10887c478bdstevel@tonic-gate	cistpl_geometry_t	cistpl_geometry;
10897c478bdstevel@tonic-gate	cistpl_byteorder_t	cistpl_byteorder;
10907c478bdstevel@tonic-gate	cistpl_date_t		cistpl_date;
10917c478bdstevel@tonic-gate	cistpl_battery_t	cistpl_battery;
10927c478bdstevel@tonic-gate	cistpl_org_t		cistpl_org;
10937c478bdstevel@tonic-gate	cistpl_manfid_t		cistpl_manfid;
10947c478bdstevel@tonic-gate	cistpl_funcid_t		cistpl_funcid;
10957c478bdstevel@tonic-gate	cistpl_funce_t		cistpl_funce;
10967c478bdstevel@tonic-gate	cistpl_cftable_entry_t	cistpl_cftable_entry;
10977c478bdstevel@tonic-gate	cistpl_linktarget_t	cistpl_linktarget;
10987c478bdstevel@tonic-gate	cistpl_longlink_ac_t	cistpl_longlink_ac;
10997c478bdstevel@tonic-gate	cistpl_longlink_mfc_t	cistpl_longlink_mfc;
11007c478bdstevel@tonic-gate	cistpl_spcl_t		cistpl_spcl;
11017c478bdstevel@tonic-gate	cistpl_swil_t		cistpl_swil;
11027c478bdstevel@tonic-gate	cistpl_bar_t		cistpl_bar;
11037c478bdstevel@tonic-gate	cistpl_devicegeo_t	cistpl_devicegeo;
11047c478bdstevel@tonic-gate	cistpl_longlink_cb_t	cistpl_longlink_cb;
11057c478bdstevel@tonic-gate	cistpl_get_tuple_name_t	cistpl_get_tuple_name;
11067c478bdstevel@tonic-gate	/* members below are for legacy support - REMOVE THEM BEFORE FCS!! */
11077c478bdstevel@tonic-gate	cistpl_config_t		config;
11087c478bdstevel@tonic-gate	cistpl_device_t		device;
11097c478bdstevel@tonic-gate	cistpl_vers_1_t		version_1;
11107c478bdstevel@tonic-gate	cistpl_vers_2_t		version_2;
11117c478bdstevel@tonic-gate	cistpl_jedec_t		jedec;
11127c478bdstevel@tonic-gate	cistpl_format_t		format;
11137c478bdstevel@tonic-gate	cistpl_geometry_t	geometry;
11147c478bdstevel@tonic-gate	cistpl_byteorder_t	byteorder;
11157c478bdstevel@tonic-gate	cistpl_date_t		date;
11167c478bdstevel@tonic-gate	cistpl_battery_t	battery;
11177c478bdstevel@tonic-gate	cistpl_org_t		org;
11187c478bdstevel@tonic-gate	cistpl_manfid_t		manfid;
11197c478bdstevel@tonic-gate	cistpl_funcid_t		funcid;
11207c478bdstevel@tonic-gate	cistpl_funce_t		funce;
11217c478bdstevel@tonic-gate	cistpl_cftable_entry_t	cftable;
11227c478bdstevel@tonic-gate	cistpl_linktarget_t	linktarget;
11237c478bdstevel@tonic-gate	cistpl_longlink_ac_t	longlink_ac;
11247c478bdstevel@tonic-gate	cistpl_longlink_mfc_t	longlink_mfc;
11257c478bdstevel@tonic-gate	cistpl_spcl_t		spcl;
11267c478bdstevel@tonic-gate	cistpl_swil_t		swil;
11277c478bdstevel@tonic-gate	cistpl_bar_t		bar;
11287c478bdstevel@tonic-gate	cistpl_devicegeo_t	devgeo;
11297c478bdstevel@tonic-gate	cistpl_longlink_cb_t	longlink_cb;
11307c478bdstevel@tonic-gate	cistpl_get_tuple_name_t	tuple_name;
11317c478bdstevel@tonic-gate} cisparse_t;
11327c478bdstevel@tonic-gate
11337c478bdstevel@tonic-gate#ifdef	__cplusplus
11347c478bdstevel@tonic-gate}
11357c478bdstevel@tonic-gate#endif
11367c478bdstevel@tonic-gate
11377c478bdstevel@tonic-gate#endif	/* _CIS_HANDLERS_H */
1138