cis.h revision 5f9e250aa611c12bbaccc0be612e5b97ccca2762
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#pragma ident "%Z%%M% %I% %E% SMI"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This is the Card Services Card Information Structure (CIS) interpreter
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * header file. CIS information in this file is based on the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Release 2.01 PCMCIA standard.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The CIS interpreter has a single entry point with a bunch of function
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * id numbers.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISP_CIS_SETUP 0x01 /* setup CS address in CIS */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISP_CIS_LIST_CREATE 0x02 /* create the CIS linked list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISP_CIS_LIST_DESTROY 0x03 /* destroy the CIS linked list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISP_CIS_GET_LTUPLE 0x04 /* get a tuple */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISP_CIS_PARSE_TUPLE 0x05 /* parse a tuple */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISP_CIS_CONV_DEVSPEED 0x06 /* convert devspeed to nS and back */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISP_CIS_CONV_DEVSIZE 0x07 /* convert device size */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Make the calls to CardServices look like function calls.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * define the tuples that we recognize
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Layer 1 - Basic Compatability TUples
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_NULL 0x000 /* null tuple - ignore */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_DEVICE 0x001 /* device information */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_LONGLINK_CB 0x002 /* longlink to next tuple chain */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_CONFIG_CB 0x004 /* configuration tuple */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_CFTABLE_ENTRY_CB 0x005 /* configuration table entry */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_LONGLINK_MFC 0x006 /* multi-function tuple */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_BAR 0x007 /* Base Address Register definition */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_CHECKSUM 0x010 /* checksum control */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_LONGLINK_A 0x011 /* long-link to AM */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_LONGLINK_C 0x012 /* long-link to CM */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_LINKTARGET 0x013 /* link-target control */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_NO_LINK 0x014 /* no-link control */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VERS_1 0x015 /* level 1 version information */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_ALTSTR 0x016 /* alternate language string */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_DEVICE_A 0x017 /* AM device information */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_JEDEC_C 0x018 /* JEDEC programming info for CM */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_JEDEC_A 0x019 /* JEDEC programming info for AM */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_CFTABLE_ENTRY 0x01b /* configuration-table-entry */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_DEVICE_OC 0x01c /* other op conditions CM device info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_DEVICE_OA 0x01d /* other op conditions AM device info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_DEVICEGEO 0x01e /* Common Memory device geometry */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_DEVICEGEO_A 0x01f /* Attribute Memory device geometry */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_MANFID 0x020 /* manufacturer identification */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_FUNCID 0x021 /* function identification */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_FUNCE 0x022 /* function extension */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Layer 2 - Data Recording Format Tuples
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_SWIL 0x023 /* software interleave */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VERS_2 0x040 /* level 2 version information */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_FORMAT 0x041 /* Common Memory recording format */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_DATE 0x044 /* card initialization date */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_BATTERY 0x045 /* battery replacement date */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_FORMAT_A 0x047 /* Attribute Memory recording format */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Layer 3 - Data Organization Tuples
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Layer 4 - System Specific Standard Tuples
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_80 0x080 /* vendor-specific 0x80 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_81 0x081 /* vendor-specific 0x81 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_82 0x082 /* vendor-specific 0x82 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_83 0x083 /* vendor-specific 0x83 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_84 0x084 /* vendor-specific 0x84 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_85 0x085 /* vendor-specific 0x85 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_86 0x086 /* vendor-specific 0x86 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_87 0x087 /* vendor-specific 0x87 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_88 0x088 /* vendor-specific 0x88 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_89 0x089 /* vendor-specific 0x89 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_8a 0x08a /* vendor-specific 0x8a */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_8b 0x08b /* vendor-specific 0x8b */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_8c 0x08c /* vendor-specific 0x8c */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_8d 0x08d /* vendor-specific 0x8d */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_8e 0x08e /* vendor-specific 0x8e */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_VEND_SPEC_8f 0x08f /* vendor-specific 0x8f */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_SPCL 0x090 /* special-purpose tuple */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Macro to check if tuple is a vendor-specific tuple.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CISTPL_IS_VENDOR_SPECIFIC(td) (((td) >= CISTPL_VENDSPEC_START) && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The GetFirstTuple and GetNextTuple Card Services function calls use
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the DesiredTuple member of the tuple_t structure to determine
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * while tuple type to return; since the CIS parser doesn't ever
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return CISTPL_END tuples, we can never ask for those tuples,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * so we overload this tuple code to mean that we want the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * first (or next) tuple in the chain.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * XXX - If we ever do return CISTPL_END tuples, we'll have to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * re-think this.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RETURN_FIRST_TUPLE 0x0ff /* return first/next tuple */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RETURN_NEXT_TUPLE 0x0ff /* return first/next tuple */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * types for data in CIS and pointers into PC card's CIS space
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The "size" member is used by the NEXT_CIS_ADDR macro so that
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * we don't run past the end of the mapped CIS address space.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct cisptr_t {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte acc_handle_t handle; /* access handle of CIS space */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t offset; /* byte offset into CIS space */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* see flag definitions for cistpl_t structure */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This is the maximum length that the data portion of a tuple can be.
* field definitions as the tuple handler flags defined in cis_handlers.h
#if !defined(_KERNEL)
#ifdef CISMALLOC_DEBUG
typedef struct cis_u_malloc_tag_t {
typedef struct cistpl_t {
} read;
} cistpl_t;
typedef struct cistpl_ignore_list_t {
#ifdef __cplusplus