1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright (c) 1995-2001 by Sun Microsystems, Inc. 24*0Sstevel@tonic-gate * All rights reserved. 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate #ifndef _CIS_HANDLERS_H 28*0Sstevel@tonic-gate #define _CIS_HANDLERS_H 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gate #ifdef __cplusplus 33*0Sstevel@tonic-gate extern "C" { 34*0Sstevel@tonic-gate #endif 35*0Sstevel@tonic-gate 36*0Sstevel@tonic-gate /* 37*0Sstevel@tonic-gate * This is the CIS tuple handler header file. 38*0Sstevel@tonic-gate * 39*0Sstevel@tonic-gate * Each tuple that we recognize and are prepared to handle is assigned a 40*0Sstevel@tonic-gate * cistpl_callout_t structure. This lets us specify a handler for 41*0Sstevel@tonic-gate * this tuple, as well as flags that describe this tuple and which 42*0Sstevel@tonic-gate * are used by the CIS interpreter and tuple parser. 43*0Sstevel@tonic-gate */ 44*0Sstevel@tonic-gate typedef struct cistpl_callout_t { 45*0Sstevel@tonic-gate cisdata_t type; /* type of tuple */ 46*0Sstevel@tonic-gate cisdata_t subtype; /* only used for CISTPL_FUNCE */ 47*0Sstevel@tonic-gate uint32_t flags; /* misc flags */ 48*0Sstevel@tonic-gate uint32_t (*handler)(); /* tuple handler */ 49*0Sstevel@tonic-gate char *text; /* name of tuple */ 50*0Sstevel@tonic-gate } cistpl_callout_t; 51*0Sstevel@tonic-gate 52*0Sstevel@tonic-gate /* 53*0Sstevel@tonic-gate * Flags that are used by a tuple handler to specify what action it 54*0Sstevel@tonic-gate * should perform. 55*0Sstevel@tonic-gate */ 56*0Sstevel@tonic-gate #define HANDTPL_NOERROR 0x000000000 /* no error */ 57*0Sstevel@tonic-gate #define HANDTPL_SET_FLAGS 0x000000001 /* set tuple flags */ 58*0Sstevel@tonic-gate #define HANDTPL_COPY_DONE 0x000000002 /* tuple data copy is done */ 59*0Sstevel@tonic-gate #define HANDTPL_PARSE_LTUPLE 0x000000004 /* parse tuple, return opt data */ 60*0Sstevel@tonic-gate #define HANDTPL_RETURN_NAME 0x000000008 /* return tuple name string */ 61*0Sstevel@tonic-gate 62*0Sstevel@tonic-gate /* 63*0Sstevel@tonic-gate * This flag is returned by tuple handlers if they encounter an error. It 64*0Sstevel@tonic-gate * is returned by cis_list_lcreate if any of the tuple handlers have 65*0Sstevel@tonic-gate * return an error while processing the CIS. 66*0Sstevel@tonic-gate * 67*0Sstevel@tonic-gate * Note that the following bit is reserved: 68*0Sstevel@tonic-gate * #define BAD_CIS_ADDR 0x080000000 69*0Sstevel@tonic-gate * It appears in cis.h and is used to indicate that cis_list_create 70*0Sstevel@tonic-gate * tried to read past the end of the mapped in CIS space. 71*0Sstevel@tonic-gate */ 72*0Sstevel@tonic-gate #define HANDTPL_ERROR 0x001000000 /* handler returned an error */ 73*0Sstevel@tonic-gate 74*0Sstevel@tonic-gate /* 75*0Sstevel@tonic-gate * General-use constants and macros that aren't specific to a tuple. 76*0Sstevel@tonic-gate */ 77*0Sstevel@tonic-gate #define CISTPL_EXT_BIT 0x080 /* additional extension bytes follow */ 78*0Sstevel@tonic-gate 79*0Sstevel@tonic-gate /* 80*0Sstevel@tonic-gate * Constants, macros and structures used by cistpl_devspeed and 81*0Sstevel@tonic-gate * cis_convert_devspeed functions. 82*0Sstevel@tonic-gate */ 83*0Sstevel@tonic-gate #define CISTPL_DEVSPEED_TABLE 0x000000001 /* use the device speed table */ 84*0Sstevel@tonic-gate #define CISTPL_DEVSPEED_EXT 0x000000002 /* use the extended speed table */ 85*0Sstevel@tonic-gate #define CISTPL_DEVSPEED_MAX_TBL 8 /* max devspeed table entries */ 86*0Sstevel@tonic-gate #define CISTPL_DEVSPEED_MAX_EXP 8 /* max exponent entries */ 87*0Sstevel@tonic-gate #define CISTPL_DEVSPEED_MAX_MAN 16 /* max mantissa entries */ 88*0Sstevel@tonic-gate #define CISTPL_DEVSPEED_TBL(t) cistpl_devspeed_struct.table[(t) & \ 89*0Sstevel@tonic-gate (CISTPL_DEVSPEED_MAX_TBL - 1)] 90*0Sstevel@tonic-gate #define CISTPL_DEVSPEED_MAN(m) cistpl_devspeed_struct.mantissa[(m) & \ 91*0Sstevel@tonic-gate (CISTPL_DEVSPEED_MAX_MAN - 1)] 92*0Sstevel@tonic-gate #define CISTPL_DEVSPEED_EXP(e) cistpl_devspeed_struct.exponent[(e) & \ 93*0Sstevel@tonic-gate (CISTPL_DEVSPEED_MAX_EXP - 1)] 94*0Sstevel@tonic-gate typedef struct cistpl_devspeed_struct_t { 95*0Sstevel@tonic-gate uint32_t *table; 96*0Sstevel@tonic-gate uint32_t *tenfac; 97*0Sstevel@tonic-gate uint32_t *mantissa; 98*0Sstevel@tonic-gate uint32_t *exponent; 99*0Sstevel@tonic-gate } cistpl_devspeed_struct_t; 100*0Sstevel@tonic-gate 101*0Sstevel@tonic-gate /* 102*0Sstevel@tonic-gate * Constants, flags and structure typedefs that are used by specific tuples. 103*0Sstevel@tonic-gate * 104*0Sstevel@tonic-gate * CISTPL_DEVICE, CISTPL_DEVICE_A, CISTPL_DEVICE_OC and CISTPL_DEVICE_OA 105*0Sstevel@tonic-gate */ 106*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_NULL 0x00 /* a NULL device (hole) */ 107*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_ROM 0x01 /* device is of type ROM */ 108*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_OTPROM 0x02 /* device is of type OTPROM */ 109*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_EPROM 0x03 /* device is of type EPROM */ 110*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_EEPROM 0x04 /* device is of type EEPROM */ 111*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_FLASH 0x05 /* device is of type FLASH */ 112*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_SRAM 0x06 /* device is of type SRAM */ 113*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_DRAM 0x07 /* device is of type DRAM */ 114*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_RSVD_8 0x08 /* reserved */ 115*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_RSVD_9 0x09 /* reserved */ 116*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_RSVD_a 0x0a /* reserved */ 117*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_RSVD_b 0x0b /* reserved */ 118*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_RSVD_c 0x0c /* reserved */ 119*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_FUNCSPEC 0x0d /* device is of type FUNCSPEC */ 120*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_EXTEND 0x0e /* device is of type extended */ 121*0Sstevel@tonic-gate #define CISTPL_DEVICE_DTYPE_RSVD_f 0x0f /* reserved */ 122*0Sstevel@tonic-gate 123*0Sstevel@tonic-gate /* 124*0Sstevel@tonic-gate * Flags for cistpl_device_node_t->flags member for CISTPL_DEVICE 125*0Sstevel@tonic-gate * and CISTPL_DEVICE_A tuples 126*0Sstevel@tonic-gate */ 127*0Sstevel@tonic-gate #define CISTPL_DEVICE_WPS 0x00000001 /* WPS bit is set */ 128*0Sstevel@tonic-gate /* 129*0Sstevel@tonic-gate * Flags and values for cistpl_device_node_t->flags member for 130*0Sstevel@tonic-gate * CISTPL_DEVICE_OC and CISTPL_DEVICE_OA tuples 131*0Sstevel@tonic-gate */ 132*0Sstevel@tonic-gate #define CISTPL_DEVICE_OC_MWAIT 0x00010000 /* use MWAIT */ 133*0Sstevel@tonic-gate #define CISTPL_DEVICE_OC_Vcc_MASK 0x00060000 /* mask for Vcc value */ 134*0Sstevel@tonic-gate #define CISTPL_DEVICE_OC_Vcc5 0x00000000 /* 5.0 volt operation */ 135*0Sstevel@tonic-gate #define CISTPL_DEVICE_OC_Vcc33 0x00020000 /* 3.3 volt operation */ 136*0Sstevel@tonic-gate #define CISTPL_DEVICE_OC_VccXX 0x00040000 /* X.X volt operation */ 137*0Sstevel@tonic-gate #define CISTPL_DEVICE_OC_VccYY 0x00060000 /* Y.Y volt operation */ 138*0Sstevel@tonic-gate /* 139*0Sstevel@tonic-gate * CISTPL_DEVICE_MAX_DEVICES defines the maximum number of devices that 140*0Sstevel@tonic-gate * we can parse in a CISTPL_DEVICE{...} tuple 141*0Sstevel@tonic-gate */ 142*0Sstevel@tonic-gate #define CISTPL_DEVICE_MAX_DEVICES 10 143*0Sstevel@tonic-gate 144*0Sstevel@tonic-gate /* 145*0Sstevel@tonic-gate * CISTPL_DEVICE_SPEED_SIZE_IGNORE if the device speed is set to this, then 146*0Sstevel@tonic-gate * ignore the speed and size values 147*0Sstevel@tonic-gate */ 148*0Sstevel@tonic-gate #define CISTPL_DEVICE_SPEED_SIZE_IGNORE 0x0ff /* ignore size and speed info */ 149*0Sstevel@tonic-gate 150*0Sstevel@tonic-gate typedef struct cistpl_device_node_t { 151*0Sstevel@tonic-gate uint32_t flags; /* flags specific to this device */ 152*0Sstevel@tonic-gate uint32_t speed; /* device speed in device speed code format */ 153*0Sstevel@tonic-gate uint32_t nS_speed; /* device speed in nS */ 154*0Sstevel@tonic-gate uint32_t type; /* device type */ 155*0Sstevel@tonic-gate uint32_t size; /* device size */ 156*0Sstevel@tonic-gate uint32_t size_in_bytes; /* device size in bytes */ 157*0Sstevel@tonic-gate } cistpl_device_node_t; 158*0Sstevel@tonic-gate 159*0Sstevel@tonic-gate typedef struct cistpl_device_t { 160*0Sstevel@tonic-gate uint32_t num_devices; /* number of devices found */ 161*0Sstevel@tonic-gate cistpl_device_node_t devnode[CISTPL_DEVICE_MAX_DEVICES]; 162*0Sstevel@tonic-gate } cistpl_device_t; 163*0Sstevel@tonic-gate 164*0Sstevel@tonic-gate /* 165*0Sstevel@tonic-gate * CISTPL_CONFIG 166*0Sstevel@tonic-gate */ 167*0Sstevel@tonic-gate #define MAKE_CONFIG_REG_ADDR(base, reg) (base + (reg * 2)) 168*0Sstevel@tonic-gate #define CISTPL_CONFIG_MAX_CONFIG_REGS 128 /* max num config regs */ 169*0Sstevel@tonic-gate typedef struct cistpl_config_t { 170*0Sstevel@tonic-gate uint32_t present; /* register present flags */ 171*0Sstevel@tonic-gate uint32_t nr; /* number of config registers found */ 172*0Sstevel@tonic-gate uint32_t hr; /* highest config register index found */ 173*0Sstevel@tonic-gate uint32_t regs[CISTPL_CONFIG_MAX_CONFIG_REGS]; /* reg offsets */ 174*0Sstevel@tonic-gate uint32_t base; /* base offset of config registers */ 175*0Sstevel@tonic-gate uint32_t last; /* last config index */ 176*0Sstevel@tonic-gate } cistpl_config_t; 177*0Sstevel@tonic-gate 178*0Sstevel@tonic-gate /* 179*0Sstevel@tonic-gate * CISTPL_VERS_1 180*0Sstevel@tonic-gate */ 181*0Sstevel@tonic-gate #define CISTPL_VERS_1_MAX_PROD_STRINGS 4 /* max number product strings */ 182*0Sstevel@tonic-gate typedef struct cistpl_vers_1_t { 183*0Sstevel@tonic-gate uint32_t major; /* major version number */ 184*0Sstevel@tonic-gate uint32_t minor; /* minor version number */ 185*0Sstevel@tonic-gate uint32_t ns; /* number of information strings */ 186*0Sstevel@tonic-gate /* pointers to product information strings */ 187*0Sstevel@tonic-gate char pi[CISTPL_VERS_1_MAX_PROD_STRINGS][CIS_MAX_TUPLE_DATA_LEN]; 188*0Sstevel@tonic-gate } cistpl_vers_1_t; 189*0Sstevel@tonic-gate 190*0Sstevel@tonic-gate /* 191*0Sstevel@tonic-gate * CISTPL_VERS_2 192*0Sstevel@tonic-gate */ 193*0Sstevel@tonic-gate typedef struct cistpl_vers_2_t { 194*0Sstevel@tonic-gate uint32_t vers; /* version number */ 195*0Sstevel@tonic-gate uint32_t comply; /* level of compliance */ 196*0Sstevel@tonic-gate uint32_t dindex; /* byte address of first data byte in card */ 197*0Sstevel@tonic-gate uint32_t reserved; /* two reserved bytes */ 198*0Sstevel@tonic-gate uint32_t vspec8; /* vendor specific (byte 8) */ 199*0Sstevel@tonic-gate uint32_t vspec9; /* vendor specific (byte 9) */ 200*0Sstevel@tonic-gate uint32_t nhdr; /* number of copies of CIS present on device */ 201*0Sstevel@tonic-gate char oem[CIS_MAX_TUPLE_DATA_LEN]; /* Vendor of software that */ 202*0Sstevel@tonic-gate /* formatted card */ 203*0Sstevel@tonic-gate char info[CIS_MAX_TUPLE_DATA_LEN]; /* Informational message */ 204*0Sstevel@tonic-gate /* about card */ 205*0Sstevel@tonic-gate } cistpl_vers_2_t; 206*0Sstevel@tonic-gate 207*0Sstevel@tonic-gate /* 208*0Sstevel@tonic-gate * CISTPL_JEDEC_A and CISTPL_JEDEC_C 209*0Sstevel@tonic-gate */ 210*0Sstevel@tonic-gate #define CISTPL_JEDEC_MAX_IDENTIFIERS 4 211*0Sstevel@tonic-gate typedef struct jedec_ident_t { 212*0Sstevel@tonic-gate uint32_t id; /* manufacturer id */ 213*0Sstevel@tonic-gate uint32_t info; /* manufacturer specific info */ 214*0Sstevel@tonic-gate } jedec_ident_t; 215*0Sstevel@tonic-gate 216*0Sstevel@tonic-gate typedef struct cistpl_jedec_t { 217*0Sstevel@tonic-gate uint32_t nid; /* # of JEDEC identifiers present */ 218*0Sstevel@tonic-gate jedec_ident_t jid[CISTPL_JEDEC_MAX_IDENTIFIERS]; 219*0Sstevel@tonic-gate } cistpl_jedec_t; 220*0Sstevel@tonic-gate 221*0Sstevel@tonic-gate /* 222*0Sstevel@tonic-gate * CISTPL_FORMAT and CISTPL_FORMAT_A 223*0Sstevel@tonic-gate * 224*0Sstevel@tonic-gate * These tuples describe the data recording format for a region. 225*0Sstevel@tonic-gate */ 226*0Sstevel@tonic-gate typedef struct cistpl_format_t { 227*0Sstevel@tonic-gate uint32_t type; /* format type code */ 228*0Sstevel@tonic-gate uint32_t edc_length; /* error detection code length */ 229*0Sstevel@tonic-gate uint32_t edc_type; /* error detection code type */ 230*0Sstevel@tonic-gate uint32_t offset; /* offset of first byte of data in this part */ 231*0Sstevel@tonic-gate uint32_t nbytes; /* number of bytes of data in this partition */ 232*0Sstevel@tonic-gate union { 233*0Sstevel@tonic-gate struct disk { 234*0Sstevel@tonic-gate uint32_t bksize; /* block size */ 235*0Sstevel@tonic-gate uint32_t nblocks; /* nblocks data for disk-like device */ 236*0Sstevel@tonic-gate uint32_t edcloc; /* location of error detection code */ 237*0Sstevel@tonic-gate } disk; 238*0Sstevel@tonic-gate struct mem { 239*0Sstevel@tonic-gate uint32_t flags; /* various flags */ 240*0Sstevel@tonic-gate uint32_t reserved; /* reserved byte */ 241*0Sstevel@tonic-gate caddr_t address; /* physical addr for mem-like device */ 242*0Sstevel@tonic-gate uint32_t edcloc; /* location of error detection code */ 243*0Sstevel@tonic-gate } mem; 244*0Sstevel@tonic-gate } dev; 245*0Sstevel@tonic-gate } cistpl_format_t; 246*0Sstevel@tonic-gate 247*0Sstevel@tonic-gate /* 248*0Sstevel@tonic-gate * device format types 249*0Sstevel@tonic-gate */ 250*0Sstevel@tonic-gate #define TPLFMTTYPE_DISK 0x00 /* disk-like format */ 251*0Sstevel@tonic-gate #define TPLFMTTYPE_MEM 0x01 /* memory-like format */ 252*0Sstevel@tonic-gate #define TPLFMTTYPE_VS 0x80 /* vendor specific format */ 253*0Sstevel@tonic-gate 254*0Sstevel@tonic-gate /* 255*0Sstevel@tonic-gate * error detection code types 256*0Sstevel@tonic-gate */ 257*0Sstevel@tonic-gate #define TPLFMTEDC_NONE 0x00 /* no error detection code */ 258*0Sstevel@tonic-gate #define TPLFMTEDC_CKSUM 0x01 /* arithmetic checksum is used */ 259*0Sstevel@tonic-gate #define TPLFMTEDC_CRC 0x02 /* 16-bit CRC */ 260*0Sstevel@tonic-gate #define TPLFMTEDC_PCC 0x03 /* whole-partition arithmetic checksum */ 261*0Sstevel@tonic-gate #define TPLFMTEDC_VS 0x80 /* vendor specific error checking */ 262*0Sstevel@tonic-gate 263*0Sstevel@tonic-gate #define EDC_LENGTH_MASK 0x07 264*0Sstevel@tonic-gate #define EDC_TYPE_MASK 0x0f 265*0Sstevel@tonic-gate #define EDC_TYPE_SHIFT 3 266*0Sstevel@tonic-gate 267*0Sstevel@tonic-gate /* 268*0Sstevel@tonic-gate * flags for memory-like devices 269*0Sstevel@tonic-gate */ 270*0Sstevel@tonic-gate #define TPLFMTFLAGS_ADDR 0x01 /* address is valid */ 271*0Sstevel@tonic-gate #define TPLFMTFLAGS_AUTO 0x02 /* automatically map memory region */ 272*0Sstevel@tonic-gate 273*0Sstevel@tonic-gate /* 274*0Sstevel@tonic-gate * CISTPL_GEOMETRY 275*0Sstevel@tonic-gate */ 276*0Sstevel@tonic-gate typedef struct cistpl_geometry_t { 277*0Sstevel@tonic-gate uint32_t spt; 278*0Sstevel@tonic-gate uint32_t tpc; 279*0Sstevel@tonic-gate uint32_t ncyl; 280*0Sstevel@tonic-gate } cistpl_geometry_t; 281*0Sstevel@tonic-gate 282*0Sstevel@tonic-gate /* 283*0Sstevel@tonic-gate * CISTPL_BYTEORDER 284*0Sstevel@tonic-gate */ 285*0Sstevel@tonic-gate typedef struct cistpl_byteorder_t { 286*0Sstevel@tonic-gate uint32_t order; /* byte order code */ 287*0Sstevel@tonic-gate uint32_t map; /* byte mapping code */ 288*0Sstevel@tonic-gate } cistpl_byteorder_t; 289*0Sstevel@tonic-gate 290*0Sstevel@tonic-gate /* 291*0Sstevel@tonic-gate * byte order and mapping codes 292*0Sstevel@tonic-gate */ 293*0Sstevel@tonic-gate #define TPLBYTEORD_LOW 0x00 /* specifies little endian order */ 294*0Sstevel@tonic-gate #define TPLBYTEORD_HIGH 0x01 /* specifies big endian order */ 295*0Sstevel@tonic-gate #define TPLBYTEORD_VS 0x80 /* vendor specific order 0x80-0xFF */ 296*0Sstevel@tonic-gate 297*0Sstevel@tonic-gate #define TPLBYTEMAP_LOW 0x00 /* byte zero is least significant byte */ 298*0Sstevel@tonic-gate #define TPLBYTEMAP_HIGH 0x01 /* byte zero is most significant byte */ 299*0Sstevel@tonic-gate #define TPLBYTEMAP_VS 0x80 /* vendor specific mapping */ 300*0Sstevel@tonic-gate 301*0Sstevel@tonic-gate /* 302*0Sstevel@tonic-gate * CISTPL_DATE 303*0Sstevel@tonic-gate */ 304*0Sstevel@tonic-gate typedef struct cistpl_date_t { 305*0Sstevel@tonic-gate uint32_t time; 306*0Sstevel@tonic-gate uint32_t day; 307*0Sstevel@tonic-gate } cistpl_date_t; 308*0Sstevel@tonic-gate 309*0Sstevel@tonic-gate /* 310*0Sstevel@tonic-gate * CISTPL_BATTERY 311*0Sstevel@tonic-gate */ 312*0Sstevel@tonic-gate typedef struct cistpl_battery_t { 313*0Sstevel@tonic-gate uint32_t rday; /* replacement date */ 314*0Sstevel@tonic-gate uint32_t xday; /* expiration date */ 315*0Sstevel@tonic-gate } cistpl_battery_t; 316*0Sstevel@tonic-gate 317*0Sstevel@tonic-gate /* 318*0Sstevel@tonic-gate * CISTPL_ORG 319*0Sstevel@tonic-gate */ 320*0Sstevel@tonic-gate typedef struct cistpl_org_t { 321*0Sstevel@tonic-gate uint32_t type; /* data organization code */ 322*0Sstevel@tonic-gate char desc[CIS_MAX_TUPLE_DATA_LEN]; /* text description of */ 323*0Sstevel@tonic-gate /* this organization */ 324*0Sstevel@tonic-gate } cistpl_org_t; 325*0Sstevel@tonic-gate 326*0Sstevel@tonic-gate /* 327*0Sstevel@tonic-gate * CISTPL_MANFID 328*0Sstevel@tonic-gate */ 329*0Sstevel@tonic-gate typedef struct cistpl_manfid_t { 330*0Sstevel@tonic-gate uint32_t manf; /* PCMCIA PC Card manufacturer code */ 331*0Sstevel@tonic-gate uint32_t card; /* manufacturer information */ 332*0Sstevel@tonic-gate } cistpl_manfid_t; 333*0Sstevel@tonic-gate 334*0Sstevel@tonic-gate /* 335*0Sstevel@tonic-gate * CISTPL_FUNCID 336*0Sstevel@tonic-gate */ 337*0Sstevel@tonic-gate typedef struct cistpl_funcid_t { 338*0Sstevel@tonic-gate uint32_t function; /* PC Card function code */ 339*0Sstevel@tonic-gate uint32_t sysinit; /* system initialization mask */ 340*0Sstevel@tonic-gate } cistpl_funcid_t; 341*0Sstevel@tonic-gate 342*0Sstevel@tonic-gate /* 343*0Sstevel@tonic-gate * Function types for CISTPL_FUNCID; note that the TPLFUNC_UNKNOWN is 344*0Sstevel@tonic-gate * not defined by the PCMCIA standard. 345*0Sstevel@tonic-gate * 346*0Sstevel@tonic-gate * Definitions for cistpl_funcid_t->function 347*0Sstevel@tonic-gate */ 348*0Sstevel@tonic-gate #define TPLFUNC_MULTI 0x000 /* vendor-specific multifunction card */ 349*0Sstevel@tonic-gate #define TPLFUNC_MEMORY 0x001 /* memory card */ 350*0Sstevel@tonic-gate #define TPLFUNC_SERIAL 0x002 /* serial I/O port */ 351*0Sstevel@tonic-gate #define TPLFUNC_PARALLEL 0x003 /* parallel printer port */ 352*0Sstevel@tonic-gate #define TPLFUNC_FIXED 0x004 /* fixed disk, silicon or removeable */ 353*0Sstevel@tonic-gate #define TPLFUNC_VIDEO 0x005 /* video interface */ 354*0Sstevel@tonic-gate #define TPLFUNC_LAN 0x006 /* Local Area Network adapter */ 355*0Sstevel@tonic-gate #define TPLFUNC_AIMS 0x007 /* Auto Incrementing Mass Storage */ 356*0Sstevel@tonic-gate #define TPLFUNC_SCSI 0x008 /* SCSI bridge */ 357*0Sstevel@tonic-gate #define TPLFUNC_SECURITY 0x009 /* Security Cards */ 358*0Sstevel@tonic-gate #define TPLFUNC_VENDOR_SPECIFIC 0x0fe /* Vendor Specific */ 359*0Sstevel@tonic-gate #define TPLFUNC_UNKNOWN 0x0ff /* unknown function(s) */ 360*0Sstevel@tonic-gate /* 361*0Sstevel@tonic-gate * Definitions for cistpl_funcid_t->sysinit 362*0Sstevel@tonic-gate */ 363*0Sstevel@tonic-gate #define TPLINIT_POST 0x01 /* POST should attempt configure */ 364*0Sstevel@tonic-gate #define TPLINIT_ROM 0x02 /* map ROM during sys init */ 365*0Sstevel@tonic-gate 366*0Sstevel@tonic-gate /* 367*0Sstevel@tonic-gate * CISTPL_FUNCE 368*0Sstevel@tonic-gate */ 369*0Sstevel@tonic-gate typedef struct cistpl_funce_t { 370*0Sstevel@tonic-gate uint32_t function; /* type of extended data */ 371*0Sstevel@tonic-gate uint32_t subfunction; 372*0Sstevel@tonic-gate union { 373*0Sstevel@tonic-gate struct serial { 374*0Sstevel@tonic-gate uint32_t ua; /* UART in use */ 375*0Sstevel@tonic-gate uint32_t uc; /* UART capabilities */ 376*0Sstevel@tonic-gate } serial; 377*0Sstevel@tonic-gate struct modem { 378*0Sstevel@tonic-gate uint32_t fc; /* supported flow control methods */ 379*0Sstevel@tonic-gate uint32_t cb; /* size of DCE command buffer */ 380*0Sstevel@tonic-gate uint32_t eb; /* size of DCE to DCE buffer */ 381*0Sstevel@tonic-gate uint32_t tb; /* size of DTE to DCE buffer */ 382*0Sstevel@tonic-gate } modem; 383*0Sstevel@tonic-gate struct data_modem { 384*0Sstevel@tonic-gate uint32_t ud; /* highest data rate */ 385*0Sstevel@tonic-gate uint32_t ms; /* modulation standards */ 386*0Sstevel@tonic-gate /* err correct proto and non-CCITT modulation */ 387*0Sstevel@tonic-gate uint32_t em; 388*0Sstevel@tonic-gate uint32_t dc; /* data compression protocols */ 389*0Sstevel@tonic-gate uint32_t cm; /* command protocols */ 390*0Sstevel@tonic-gate uint32_t ex; /* escape mechanisms */ 391*0Sstevel@tonic-gate uint32_t dy; /* standardized data encryption */ 392*0Sstevel@tonic-gate uint32_t ef; /* misc. end user features */ 393*0Sstevel@tonic-gate uint32_t ncd; /* number of country codes */ 394*0Sstevel@tonic-gate uchar_t cd[16]; /* CCITT country code */ 395*0Sstevel@tonic-gate } data_modem; 396*0Sstevel@tonic-gate struct fax { 397*0Sstevel@tonic-gate uint32_t uf; /* highest data rate in DTE/UART */ 398*0Sstevel@tonic-gate uint32_t fm; /* CCITT modulation standards */ 399*0Sstevel@tonic-gate uint32_t fy; /* standardized data encryption */ 400*0Sstevel@tonic-gate uint32_t fs; /* feature selection */ 401*0Sstevel@tonic-gate uint32_t ncf; /* number of country codes */ 402*0Sstevel@tonic-gate uchar_t cf[16]; /* CCITT country codes */ 403*0Sstevel@tonic-gate } fax; 404*0Sstevel@tonic-gate struct voice { 405*0Sstevel@tonic-gate uint32_t uv; /* highest data rate */ 406*0Sstevel@tonic-gate uint32_t nsr; 407*0Sstevel@tonic-gate uint32_t sr[16]; /* voice sampling rates (*100) */ 408*0Sstevel@tonic-gate uint32_t nss; 409*0Sstevel@tonic-gate uint32_t ss[16]; /* voice sample sizes (*10) */ 410*0Sstevel@tonic-gate uint32_t nsc; 411*0Sstevel@tonic-gate uint32_t sc[16]; /* voice compression methods */ 412*0Sstevel@tonic-gate } voice; 413*0Sstevel@tonic-gate struct lan { 414*0Sstevel@tonic-gate uint32_t tech; /* network technology */ 415*0Sstevel@tonic-gate uint32_t speed; /* media bit or baud rate */ 416*0Sstevel@tonic-gate uint32_t media; /* network media supported */ 417*0Sstevel@tonic-gate uint32_t con; /* open/closed connector standard */ 418*0Sstevel@tonic-gate uint32_t id_sz; /* length of lan station id */ 419*0Sstevel@tonic-gate uchar_t id[16]; /* station ID */ 420*0Sstevel@tonic-gate } lan; 421*0Sstevel@tonic-gate } data; 422*0Sstevel@tonic-gate } cistpl_funce_t; 423*0Sstevel@tonic-gate 424*0Sstevel@tonic-gate /* serial port subfunctions */ 425*0Sstevel@tonic-gate #define TPLFE_SUB_SERIAL 0 /* serial port */ 426*0Sstevel@tonic-gate #define TPLFE_SUB_MODEM_COMMON 1 /* common modem interface */ 427*0Sstevel@tonic-gate #define TPLFE_SUB_MODEM_DATA 2 /* data modem services */ 428*0Sstevel@tonic-gate #define TPLFE_SUB_MODEM_FAX 3 /* fax modem services */ 429*0Sstevel@tonic-gate #define TPLFE_SUB_VOICE 4 /* voice services */ 430*0Sstevel@tonic-gate /* modem subfunctions for description of capabilities */ 431*0Sstevel@tonic-gate #define TPLFE_CAP_MODEM_DATA 5 /* data modem capabilities */ 432*0Sstevel@tonic-gate #define TPLFE_CAP_MODEM_FAX 6 /* fax modem capabilities */ 433*0Sstevel@tonic-gate #define TPLFE_CAP_MODEM_VOICE 7 /* voice modem capabilities */ 434*0Sstevel@tonic-gate /* serial port subfunctions for description of capabilities */ 435*0Sstevel@tonic-gate #define TPLFE_CAP_SERIAL_DATA 8 /* serial port capabilities - data modem */ 436*0Sstevel@tonic-gate #define TPLFE_CAP_SERIAL_FAX 9 /* serial port capabilities - fax modem */ 437*0Sstevel@tonic-gate #define TPLFE_CAP_SERIAL_VOICE 10 /* serial port capabilities - voice */ 438*0Sstevel@tonic-gate 439*0Sstevel@tonic-gate /* serial port UART definitions */ 440*0Sstevel@tonic-gate #define TPLFE_UA_8250 0 /* Intel 8250 */ 441*0Sstevel@tonic-gate #define TPLFE_UA_16450 1 /* NS 16450 */ 442*0Sstevel@tonic-gate #define TPLFE_UA_16550 2 /* NS 16550 */ 443*0Sstevel@tonic-gate 444*0Sstevel@tonic-gate /* serial port capabilities definitions */ 445*0Sstevel@tonic-gate #define TPLFE_UC_PARITY_SPACE 0x0001 /* space parity supported */ 446*0Sstevel@tonic-gate #define TPLFE_UC_PARITY_MARK 0x0002 /* mark parity supported */ 447*0Sstevel@tonic-gate #define TPLFE_UC_PARITY_ODD 0x0004 /* odd parity supported */ 448*0Sstevel@tonic-gate #define TPLFE_UC_PARITY_EVEN 0x0008 /* even parity supported */ 449*0Sstevel@tonic-gate #define TPLFE_UC_CS5 0x0100 /* 5 bit characters supported */ 450*0Sstevel@tonic-gate #define TPLFE_UC_CS6 0x0200 /* 6 bit characters supported */ 451*0Sstevel@tonic-gate #define TPLFE_UC_CS7 0x0400 /* 7 bit characters supported */ 452*0Sstevel@tonic-gate #define TPLFE_UC_CS8 0x0800 /* 8 bit characters supported */ 453*0Sstevel@tonic-gate #define TPLFE_UC_STOP_1 0x1000 /* 1 stop bit supported */ 454*0Sstevel@tonic-gate #define TPLFE_UC_STOP_15 0x2000 /* 1.5 stop bits supported */ 455*0Sstevel@tonic-gate #define TPLFE_UC_STOP_2 0x4000 /* 2 stop bits supported */ 456*0Sstevel@tonic-gate 457*0Sstevel@tonic-gate /* modem flow control methods */ 458*0Sstevel@tonic-gate #define TPLFE_FC_TX_XONOFF 0x01 /* transmit XON/XOFF */ 459*0Sstevel@tonic-gate #define TPLFE_FC_RX_XONOFF 0x02 /* receiver XON/XOFF */ 460*0Sstevel@tonic-gate #define TPLFE_FC_TX_HW 0x04 /* transmit hardware flow control (CTS) */ 461*0Sstevel@tonic-gate #define TPLFE_FC_RX_HW 0x08 /* receiver hardware flow control (RTS) */ 462*0Sstevel@tonic-gate #define TPLFE_FC_TRANS 0x10 /* tranparent flow control */ 463*0Sstevel@tonic-gate 464*0Sstevel@tonic-gate /* modem modulation standards */ 465*0Sstevel@tonic-gate #define TPLFE_MS_BELL103 0x0001 /* 300bps */ 466*0Sstevel@tonic-gate #define TPLFE_MS_V21 0x0002 /* 300bps (V.21) */ 467*0Sstevel@tonic-gate #define TPLFE_MS_V23 0x0004 /* 600/1200bps (V.23) */ 468*0Sstevel@tonic-gate #define TPLFE_MS_V22AB 0x0008 /* 1200bps (V.22A V.22B) */ 469*0Sstevel@tonic-gate #define TPLFE_MS_BELL212 0x0010 /* 2400bsp (US Bell 212) */ 470*0Sstevel@tonic-gate #define TPLFE_MS_V22BIS 0x0020 /* 2400bps (V.22bis) */ 471*0Sstevel@tonic-gate #define TPLFE_MS_V26 0x0040 /* 2400bps leased line (V.26) */ 472*0Sstevel@tonic-gate #define TPLFE_MS_V26BIS 0x0080 /* 2400bps (V.26bis) */ 473*0Sstevel@tonic-gate #define TPLFE_MS_V27BIS 0x0100 /* 4800/2400bps leased line (V.27bis) */ 474*0Sstevel@tonic-gate #define TPLFE_MS_V29 0x0200 /* 9600/7200/4800 leased line (V.29) */ 475*0Sstevel@tonic-gate #define TPLFE_MS_V32 0x0400 /* up to 9600bps (V.32) */ 476*0Sstevel@tonic-gate #define TPLFE_MS_V32BIS 0x0800 /* up to 14400bps (V.32bis) */ 477*0Sstevel@tonic-gate #define TPLFE_MS_VFAST 0x1000 /* up to 28800 V.FAST */ 478*0Sstevel@tonic-gate 479*0Sstevel@tonic-gate /* modem error correction/detection protocols */ 480*0Sstevel@tonic-gate #define TPLFE_EM_MNP 0x01 /* MNP levels 2-4 */ 481*0Sstevel@tonic-gate #define TPLFE_EM_V42 0x02 /* CCITT LAPM (V.42) */ 482*0Sstevel@tonic-gate 483*0Sstevel@tonic-gate /* modem data compression protocols */ 484*0Sstevel@tonic-gate #define TPLFE_DC_V42BIS 0x01 /* CCITT compression V.42 */ 485*0Sstevel@tonic-gate #define TPLFE_DC_MNP5 0x02 /* MNP compression (uses MNP 2, 3 or 4) */ 486*0Sstevel@tonic-gate 487*0Sstevel@tonic-gate /* modem command protocols */ 488*0Sstevel@tonic-gate #define TPLFE_CM_AT1 0x01 /* ANSI/EIA/TIA 602 "Action" commands */ 489*0Sstevel@tonic-gate #define TPLFE_CM_AT2 0x02 /* ANSI/EIA/TIA 602 "ACE/DCE IF Params" */ 490*0Sstevel@tonic-gate #define TPLFE_CM_AT3 0x04 /* ANSI/EIA/TIA 602 "Ace Parameters" */ 491*0Sstevel@tonic-gate #define TPLFE_CM_MNP_AT 0x08 /* MNP specificat AT commands */ 492*0Sstevel@tonic-gate #define TPLFE_CM_V25BIS 0x10 /* V.25bis calling commands */ 493*0Sstevel@tonic-gate #define TPLFE_CM_V25A 0x20 /* V.25bis test procedures */ 494*0Sstevel@tonic-gate #define TPLFE_CM_DMCL 0x40 /* DMCL command mode */ 495*0Sstevel@tonic-gate 496*0Sstevel@tonic-gate /* modem escape mechanism */ 497*0Sstevel@tonic-gate #define TPLFE_EX_BREAK 0x01 /* BREAK support standardized */ 498*0Sstevel@tonic-gate #define TPLFE_EX_PLUS 0x02 /* +++ returns to command mode */ 499*0Sstevel@tonic-gate #define TPLFE_EX_UD 0x04 /* user defined escape character */ 500*0Sstevel@tonic-gate 501*0Sstevel@tonic-gate /* modem miscellaneous features */ 502*0Sstevel@tonic-gate #define TPLFE_EF_CALLERID 0x01 /* Caller ID is supported */ 503*0Sstevel@tonic-gate 504*0Sstevel@tonic-gate /* fax modulation standards */ 505*0Sstevel@tonic-gate #define TPLFE_FM_V21C2 0x01 /* 300bps (V.21-C2) */ 506*0Sstevel@tonic-gate #define TPLFE_FM_V27TER 0x02 /* 4800/2400bps (V.27ter) */ 507*0Sstevel@tonic-gate #define TPLFE_FM_V29 0x04 /* 9600/7200/4800 leased line (V.29) */ 508*0Sstevel@tonic-gate #define TPLFE_FM_V17 0x08 /* 14.4K/12K/9600/7200bps (V.17) */ 509*0Sstevel@tonic-gate #define TPLFE_FM_V33 0x10 /* 14.4K/12K/9600/7200 lease line (V.33) */ 510*0Sstevel@tonic-gate 511*0Sstevel@tonic-gate /* fax feature selection */ 512*0Sstevel@tonic-gate #define TPLFE_FS_T3 0x01 /* Group 2 (T.3) service class */ 513*0Sstevel@tonic-gate #define TPLFE_FS_T4 0x02 /* Group 3 (T.4) service class */ 514*0Sstevel@tonic-gate #define TPLFE_FS_T6 0x04 /* Group 4 (T.6) service class */ 515*0Sstevel@tonic-gate #define TPLFE_FS_ECM 0x08 /* Error Correction Modeer */ 516*0Sstevel@tonic-gate #define TPLFE_FS_VOICEREQ 0x10 /* voice requests allowed */ 517*0Sstevel@tonic-gate #define TPLFE_FS_POLLING 0x20 /* polling support */ 518*0Sstevel@tonic-gate #define TPLFE_FS_FTP 0x40 /* file transfer support */ 519*0Sstevel@tonic-gate #define TPLFE_FS_PASSWORD 0x80 /* password support */ 520*0Sstevel@tonic-gate 521*0Sstevel@tonic-gate /* LAN tuple definitions */ 522*0Sstevel@tonic-gate #define TPLFE_NETWORK_INFO 0x00 523*0Sstevel@tonic-gate 524*0Sstevel@tonic-gate /* LAN technology types */ 525*0Sstevel@tonic-gate #define TPLFE_LAN_TECH_ARCNET 1 526*0Sstevel@tonic-gate #define TPLFE_LAN_TECH_ETHERNET 2 527*0Sstevel@tonic-gate #define TPLFE_LAN_TECH_TOKENRING 3 528*0Sstevel@tonic-gate #define TPLFE_LAN_TECH_LOCALTALK 4 529*0Sstevel@tonic-gate #define TPLFE_LAN_TECH_FDDI 5 530*0Sstevel@tonic-gate #define TPLFE_LAN_TECH_ATM 6 531*0Sstevel@tonic-gate #define TPLFE_LAN_TECH_WIRELESS 7 532*0Sstevel@tonic-gate 533*0Sstevel@tonic-gate /* LAN media types */ 534*0Sstevel@tonic-gate #define TPLFE_LAN_MEDIA_INHERENT 0 535*0Sstevel@tonic-gate #define TPLFE_LAN_MEDIA_UTP 1 536*0Sstevel@tonic-gate #define TPLFE_LAN_MEDIA_STP 2 537*0Sstevel@tonic-gate #define TPLFE_LAN_MEDIA_THIN_COAX 3 538*0Sstevel@tonic-gate #define TPLFE_LAN_MEDIA_THICK_COAX 4 539*0Sstevel@tonic-gate #define TPLFE_LAN_MEDIA_FIBER 5 540*0Sstevel@tonic-gate #define TPLFE_LAN_MEDIA_SSR_902 6 541*0Sstevel@tonic-gate #define TPLFE_LAN_MEDIA_SSR_2_4 7 542*0Sstevel@tonic-gate #define TPLFE_LAN_MEDIA_SSR_5_4 8 543*0Sstevel@tonic-gate #define TPLFE_LAN_MEDIA_DIFFUSE_IR 9 544*0Sstevel@tonic-gate #define TPLFE_LAN_MEDIA_PTP_IR 10 545*0Sstevel@tonic-gate 546*0Sstevel@tonic-gate /* 547*0Sstevel@tonic-gate * CISTPL_CFTABLE_ENTRY 548*0Sstevel@tonic-gate * 549*0Sstevel@tonic-gate * These flags and macros are used internally to the handler. 550*0Sstevel@tonic-gate */ 551*0Sstevel@tonic-gate /* mask to get the config entry number from TPCE_INDX */ 552*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_CFGENTRYM 0x03f 553*0Sstevel@tonic-gate /* default config bit in TPCE_INDX */ 554*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_DEFAULTM 0x040 555*0Sstevel@tonic-gate /* interface config byte follows */ 556*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IFM 0x080 557*0Sstevel@tonic-gate 558*0Sstevel@tonic-gate /* power bit mask for tpce_fs */ 559*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_PWRM 0x003 560*0Sstevel@tonic-gate /* Vcc, Vpp1 and Vpp2 descriptions */ 561*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_PWR_VPP2M 0x003 562*0Sstevel@tonic-gate /* Vcc and Vpp1=Vpp2 descriptions */ 563*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_PWR_VPP1M 0x002 564*0Sstevel@tonic-gate /* Vcc description only */ 565*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_PWR_VCCM 0x001 566*0Sstevel@tonic-gate /* no connection on sleep/power down */ 567*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_NC_SLEEPM 0x07d 568*0Sstevel@tonic-gate /* zero value required */ 569*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_ZEROM 0x07e 570*0Sstevel@tonic-gate /* no connection ever */ 571*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_NCM 0x07f 572*0Sstevel@tonic-gate 573*0Sstevel@tonic-gate /* timing data exists */ 574*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_TDM 0x004 575*0Sstevel@tonic-gate /* WAIT scale mask */ 576*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_TD_WAITM 0x003 577*0Sstevel@tonic-gate #define GET_TPCE_FS_TD_WAITS(sf) ((sf)& \ 578*0Sstevel@tonic-gate CISTPL_CFTABLE_TPCE_FS_TD_WAITM) 579*0Sstevel@tonic-gate /* RDY/BSY scale mask */ 580*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_TD_RDYM 0x01c 581*0Sstevel@tonic-gate #define GET_TPCE_FS_TD_RDYS(sf) (((sf)>>2)& \ 582*0Sstevel@tonic-gate CISTPL_CFTABLE_TPCE_FS_TD_RDYM) 583*0Sstevel@tonic-gate /* RSVD scale mask */ 584*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_TD_RSVDM 0x0e0 585*0Sstevel@tonic-gate #define GET_TPCE_FS_TD_RSVDS(sf) (((sf)>>5)& \ 586*0Sstevel@tonic-gate CISTPL_CFTABLE_TPCE_FS_TD_RSVDM) 587*0Sstevel@tonic-gate 588*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_IOM 0x008 /* I/O data exists */ 589*0Sstevel@tonic-gate /* I/O addr lines mask */ 590*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_IO_ALM 0x01f 591*0Sstevel@tonic-gate /* RANGE bit in TPCE_IO */ 592*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_IO_RANGEM 0x080 593*0Sstevel@tonic-gate /* max of 16 I/O ranges */ 594*0Sstevel@tonic-gate #define CISTPL_CFTABLE_ENTRY_MAX_IO_RANGES 16 595*0Sstevel@tonic-gate 596*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_IRQM 0x010 /* IRQ data exists */ 597*0Sstevel@tonic-gate /* extended IRQ mask exists */ 598*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_IRQ_MASKM 0x010 599*0Sstevel@tonic-gate 600*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MEMM 0x060 /* mem space mask */ 601*0Sstevel@tonic-gate /* space selection byte ... */ 602*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MEM3M 0x060 603*0Sstevel@tonic-gate /* length (2 bytes) and card address (2 bytes) */ 604*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MEM2M 0x040 605*0Sstevel@tonic-gate /* single 2-byte length */ 606*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MEM1M 0x020 607*0Sstevel@tonic-gate /* max of 8 mem space descriptors */ 608*0Sstevel@tonic-gate #define CISTPL_CFTABLE_ENTRY_MAX_MEM_WINDOWS 8 609*0Sstevel@tonic-gate /* number of bytes/page description */ 610*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MEM_PGSIZE 256 611*0Sstevel@tonic-gate /* host addr info present */ 612*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MEM_HOSTM 0x080 613*0Sstevel@tonic-gate 614*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MISCM 0x080 /* misc fields mask */ 615*0Sstevel@tonic-gate 616*0Sstevel@tonic-gate /* 617*0Sstevel@tonic-gate * Constants, macros, structures and flags used by cistpl_pd_parse() 618*0Sstevel@tonic-gate * cistpl_expd_parse() and the CISTPL_CFTABLE_ENTRY tuple handler. 619*0Sstevel@tonic-gate */ 620*0Sstevel@tonic-gate #define CISTPL_PD_MAN(m) cistpl_pd_struct.mantissa[m&15] 621*0Sstevel@tonic-gate #define CISTPL_PD_EXP(e) cistpl_pd_struct.exponent[e&7] 622*0Sstevel@tonic-gate typedef struct cistpl_pd_struct_t { 623*0Sstevel@tonic-gate uint32_t *mantissa; 624*0Sstevel@tonic-gate uint32_t *exponent; 625*0Sstevel@tonic-gate } cistpl_pd_struct_t; 626*0Sstevel@tonic-gate 627*0Sstevel@tonic-gate /* 628*0Sstevel@tonic-gate * These flags are passed to the caller in the cistpl_cftable_entry_t->flags 629*0Sstevel@tonic-gate * field and indicate what interface information is available. The low 630*0Sstevel@tonic-gate * order byte of this field is reserved and no flags should be defined 631*0Sstevel@tonic-gate * to exist there. 632*0Sstevel@tonic-gate */ 633*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_DEFAULT 0x000000100 /* this is a default conf */ 634*0Sstevel@tonic-gate 635*0Sstevel@tonic-gate /* interface config description present flags */ 636*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF 0x000000200 /* if config byte exists */ 637*0Sstevel@tonic-gate /* 638*0Sstevel@tonic-gate * When the CISTPL_CFTABLE_TPCE_IF flag is set, the following flags 639*0Sstevel@tonic-gate * are available in the ifc member of the cistpl_cftable_entry_t 640*0Sstevel@tonic-gate * structure. 641*0Sstevel@tonic-gate */ 642*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_MEMORY 0x00 /* memory interface */ 643*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_IO_MEM 0x01 /* IO and memory */ 644*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_RSVD_2 0x02 /* reserved */ 645*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_RSVD_3 0x03 /* reserved */ 646*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_CUSTOM_0 0x04 /* custom interface 0 */ 647*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_CUSTOM_1 0x05 /* custom interface 1 */ 648*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_CUSTOM_2 0x06 /* custom interface 2 */ 649*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_CUSTOM_3 0x07 /* custom interface 3 */ 650*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_RSVD_8 0x08 /* reserved */ 651*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_RSVD_9 0x09 /* reserved */ 652*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_RSVD_a 0x0a /* reserved */ 653*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_RSVD_b 0x0b /* reserved */ 654*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_RSVD_c 0x0c /* reserved */ 655*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_RSVD_d 0x0d /* reserved */ 656*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_RSVD_e 0x0e /* reserved */ 657*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_RSVD_f 0x0f /* reserved */ 658*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_MASK 0x0f /* interface type mask */ 659*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_BVD 0x10 /* BVD active in PRR */ 660*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_WP 0x20 /* WP active in PRR */ 661*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_RDY 0x40 /* RDY active in PRR */ 662*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_IF_MWAIT 0x80 /* WAIT - mem cycles */ 663*0Sstevel@tonic-gate 664*0Sstevel@tonic-gate /* power description present flags */ 665*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_PWR 0x000001000 /* power info exists */ 666*0Sstevel@tonic-gate 667*0Sstevel@tonic-gate /* timing description present flags */ 668*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_TD 0x000010000 /* timing info exists */ 669*0Sstevel@tonic-gate 670*0Sstevel@tonic-gate /* I/O description present flags */ 671*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_IO 0x000100000 /* I/O information exists */ 672*0Sstevel@tonic-gate 673*0Sstevel@tonic-gate /* IRQ description present flags */ 674*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_IRQ 0x000200000 /* IRQ information exists */ 675*0Sstevel@tonic-gate 676*0Sstevel@tonic-gate /* memory space description present flags */ 677*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MEM 0x001000000 /* MEM space info exists */ 678*0Sstevel@tonic-gate 679*0Sstevel@tonic-gate /* misc description present flags */ 680*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MISC 0x002000000 /* MISC info exists */ 681*0Sstevel@tonic-gate 682*0Sstevel@tonic-gate /* additional information tuples present flags */ 683*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_STCE_EV 0x004000000 /* STCE_EV exists */ 684*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_STCE_PD 0x008000000 /* STCE_PD exists */ 685*0Sstevel@tonic-gate 686*0Sstevel@tonic-gate /* 687*0Sstevel@tonic-gate * Power description flags and structures. 688*0Sstevel@tonic-gate * 689*0Sstevel@tonic-gate * The following eight values represent what the power description structure 690*0Sstevel@tonic-gate * parameter selection byte tells us is present. A copy of this byte 691*0Sstevel@tonic-gate * is in the low order byte of each parameter's flag field. 692*0Sstevel@tonic-gate */ 693*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_NOMV 0x001 /* nominal supply voltage */ 694*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_MINV 0x002 /* minimum supply voltage */ 695*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_MAXV 0x004 /* maximum supply voltage */ 696*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_STATICI 0x008 /* continuous supply current */ 697*0Sstevel@tonic-gate /* max current required averaged over 1 second */ 698*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_AVGI 0x010 699*0Sstevel@tonic-gate /* maximum current required averaged over 10mS */ 700*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_PEAKI 0x020 701*0Sstevel@tonic-gate /* power down supply curent required */ 702*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_PDOWNI 0x040 703*0Sstevel@tonic-gate /* power supply is about to blow up */ 704*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_RFU 0x080 705*0Sstevel@tonic-gate 706*0Sstevel@tonic-gate /* 707*0Sstevel@tonic-gate * For each voltage/current parameter, there is an associated flags field. 708*0Sstevel@tonic-gate * The following flags are in this field. The low order byte of each 709*0Sstevel@tonic-gate * of these flags fields also contains a copy of the power description 710*0Sstevel@tonic-gate * structure parameter selection byte as read from the tuple, that's why 711*0Sstevel@tonic-gate * we start the flag values at 0x0100 and go up from there. 712*0Sstevel@tonic-gate */ 713*0Sstevel@tonic-gate /* this parameter exists */ 714*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_EXISTS 0x000000100 715*0Sstevel@tonic-gate /* multiply return value by 10 */ 716*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_MUL10 0x000000200 717*0Sstevel@tonic-gate /* no connection on sleep/power down */ 718*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_NC_SLEEP 0x000001000 719*0Sstevel@tonic-gate /* zero value required */ 720*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_ZERO 0x000002000 721*0Sstevel@tonic-gate /* no connection ever */ 722*0Sstevel@tonic-gate #define CISTPL_CFTABLE_PD_NC 0x000004000 723*0Sstevel@tonic-gate 724*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_pwr_t { 725*0Sstevel@tonic-gate uint32_t nomV; /* nominal supply voltage */ 726*0Sstevel@tonic-gate uint32_t nomV_flags; 727*0Sstevel@tonic-gate uint32_t minV; /* minimum supply voltage */ 728*0Sstevel@tonic-gate uint32_t minV_flags; 729*0Sstevel@tonic-gate uint32_t maxV; /* maximum supply voltage */ 730*0Sstevel@tonic-gate uint32_t maxV_flags; 731*0Sstevel@tonic-gate uint32_t staticI; /* continuous supply current */ 732*0Sstevel@tonic-gate uint32_t staticI_flags; 733*0Sstevel@tonic-gate uint32_t avgI; /* max current required */ 734*0Sstevel@tonic-gate /* averaged over 1 sec. */ 735*0Sstevel@tonic-gate uint32_t avgI_flags; 736*0Sstevel@tonic-gate uint32_t peakI; /* max current required */ 737*0Sstevel@tonic-gate /* averaged over 10mS */ 738*0Sstevel@tonic-gate uint32_t peakI_flags; 739*0Sstevel@tonic-gate uint32_t pdownI; /* power down supply curent required */ 740*0Sstevel@tonic-gate uint32_t pdownI_flags; 741*0Sstevel@tonic-gate } cistpl_cftable_entry_pwr_t; 742*0Sstevel@tonic-gate 743*0Sstevel@tonic-gate /* 744*0Sstevel@tonic-gate * Flags for the global power description structure. These show up in 745*0Sstevel@tonic-gate * the flags field of the structure. 746*0Sstevel@tonic-gate */ 747*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_PWR_VCC 0x000000001 /* Vcc description valid */ 748*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_PWR_VPP1 0x000000002 /* vpp1 description valid */ 749*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_PWR_VPP2 0x000000004 /* Vpp2 description valid */ 750*0Sstevel@tonic-gate 751*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_pd_t { 752*0Sstevel@tonic-gate uint32_t flags; /* which descriptions are valid */ 753*0Sstevel@tonic-gate struct cistpl_cftable_entry_pwr_t pd_vcc; /* VCC power description */ 754*0Sstevel@tonic-gate struct cistpl_cftable_entry_pwr_t pd_vpp1; /* Vpp1 power description */ 755*0Sstevel@tonic-gate struct cistpl_cftable_entry_pwr_t pd_vpp2; /* Vpp2 power description */ 756*0Sstevel@tonic-gate } cistpl_cftable_entry_pd_t; 757*0Sstevel@tonic-gate 758*0Sstevel@tonic-gate /* 759*0Sstevel@tonic-gate * Device speed structure. Each field is only valid if the 760*0Sstevel@tonic-gate * CISTPL_CFTABLE_TPCE_FS_TD flag is set. 761*0Sstevel@tonic-gate * 762*0Sstevel@tonic-gate * The following flags describe which timing information is available. 763*0Sstevel@tonic-gate * They appear in the flags field of the device speed structure. 764*0Sstevel@tonic-gate */ 765*0Sstevel@tonic-gate /* WAIT timing exists */ 766*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_TD_WAIT 0x000000001 767*0Sstevel@tonic-gate /* RDY/BSY timing exists */ 768*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_TD_RDY 0x000000002 769*0Sstevel@tonic-gate /* RSVD timing exists */ 770*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_TD_RSVD 0x000000004 771*0Sstevel@tonic-gate 772*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_speed_t { 773*0Sstevel@tonic-gate uint32_t flags; /* which timing information is present */ 774*0Sstevel@tonic-gate uint32_t wait; /* max WAIT time in device speed format */ 775*0Sstevel@tonic-gate uint32_t nS_wait; /* max WAIT time in nS */ 776*0Sstevel@tonic-gate uint32_t rdybsy; /* max RDY/BSY time in device speed format */ 777*0Sstevel@tonic-gate uint32_t nS_rdybsy; /* max RDY/BSY time in nS */ 778*0Sstevel@tonic-gate uint32_t rsvd; /* max RSVD time in device speed format */ 779*0Sstevel@tonic-gate uint32_t nS_rsvd; /* max RSVD time in nS */ 780*0Sstevel@tonic-gate } cistpl_cftable_entry_speed_t; 781*0Sstevel@tonic-gate 782*0Sstevel@tonic-gate /* 783*0Sstevel@tonic-gate * Device I/O range description structures. Only valid if the 784*0Sstevel@tonic-gate * CISTPL_CFTABLE_TPCE_FS_IO flag is set. 785*0Sstevel@tonic-gate * 786*0Sstevel@tonic-gate * The following flags describe the IO description information. They 787*0Sstevel@tonic-gate * appear in the flags field of the IO space description structure. 788*0Sstevel@tonic-gate */ 789*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_IO_BUS 0x060 /* bus width mask */ 790*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_IO_BUS8 0x020 /* 8-bit flag */ 791*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_IO_BUS16 0x040 /* 16-bit flag */ 792*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_IO_RANGE 0x080 /* IO address ranges exist */ 793*0Sstevel@tonic-gate 794*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_io_range_t { 795*0Sstevel@tonic-gate uint32_t addr; /* I/O start address */ 796*0Sstevel@tonic-gate uint32_t length; /* I/O register length */ 797*0Sstevel@tonic-gate } cistpl_cftable_entry_io_range_t; 798*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_io_t { 799*0Sstevel@tonic-gate uint32_t flags; /* direct copy of TPCE_IO byte in tuple */ 800*0Sstevel@tonic-gate uint32_t addr_lines; /* number of decoded I/O address lines */ 801*0Sstevel@tonic-gate uint32_t ranges; /* number of I/O ranges */ 802*0Sstevel@tonic-gate struct cistpl_cftable_entry_io_range_t 803*0Sstevel@tonic-gate range[CISTPL_CFTABLE_ENTRY_MAX_IO_RANGES]; 804*0Sstevel@tonic-gate } cistpl_cftable_entry_io_t; 805*0Sstevel@tonic-gate 806*0Sstevel@tonic-gate /* 807*0Sstevel@tonic-gate * Device IRQ description structure. Only valid if the 808*0Sstevel@tonic-gate * CISTPL_CFTABLE_TPCE_FS_IRQ flag is set. 809*0Sstevel@tonic-gate */ 810*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_irq_t { 811*0Sstevel@tonic-gate uint32_t flags; /* direct copy of TPCE_IR byte in tuple */ 812*0Sstevel@tonic-gate uint32_t irqs; /* bit mask for each allowed IRQ */ 813*0Sstevel@tonic-gate } cistpl_cftable_entry_irq_t; 814*0Sstevel@tonic-gate 815*0Sstevel@tonic-gate /* 816*0Sstevel@tonic-gate * Device memory space description structure. Only valid if the 817*0Sstevel@tonic-gate * CISTPL_CFTABLE_TPCE_FS_MEM flag is set. 818*0Sstevel@tonic-gate * 819*0Sstevel@tonic-gate * The following flags describe the memory description information. They 820*0Sstevel@tonic-gate * appear in the flags field of the memory space description structure. 821*0Sstevel@tonic-gate */ 822*0Sstevel@tonic-gate /* space descriptors */ 823*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MEM3 0x000000001 824*0Sstevel@tonic-gate /* host_addr=card_addr */ 825*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MEM2 0x000000002 826*0Sstevel@tonic-gate /* card address=0, any host address */ 827*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MEM1 0x000000004 828*0Sstevel@tonic-gate /* if host address is present in MEM3 */ 829*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MEM_HOST 0x000000008 830*0Sstevel@tonic-gate 831*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_mem_window_t { 832*0Sstevel@tonic-gate uint32_t length; /* length of this window */ 833*0Sstevel@tonic-gate uint32_t card_addr; /* card address */ 834*0Sstevel@tonic-gate uint32_t host_addr; /* host address */ 835*0Sstevel@tonic-gate } cistpl_cftable_entry_mem_window_t; 836*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_mem_t { 837*0Sstevel@tonic-gate uint32_t flags; /* memory desc type and host addr info */ 838*0Sstevel@tonic-gate uint32_t windows; /* number of memory space descriptors */ 839*0Sstevel@tonic-gate cistpl_cftable_entry_mem_window_t 840*0Sstevel@tonic-gate window[CISTPL_CFTABLE_ENTRY_MAX_MEM_WINDOWS]; 841*0Sstevel@tonic-gate } cistpl_cftable_entry_mem_t; 842*0Sstevel@tonic-gate 843*0Sstevel@tonic-gate /* 844*0Sstevel@tonic-gate * Devices misc description structure. Only valid if the 845*0Sstevel@tonic-gate * CISTPL_CFTABLE_TPCE_FS_MISC flag is set. 846*0Sstevel@tonic-gate */ 847*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_FS_MISC_MAX 2 /* # bytes we understand */ 848*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_MI_MTC_MASK 0x00000007 /* max twin cards mask */ 849*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_MI_AUDIO 0x00000008 /* audio on BVD2 */ 850*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_MI_READONLY 0x00000010 /* R/O storage */ 851*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_MI_PWRDOWN 0x00000020 /* powerdown capable */ 852*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_MI_DRQ_MASK 0x00000c00 /* DMAREQ mask */ 853*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_MI_DRQ_SPK 0x00000400 /* DMAREQ on SPKR */ 854*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_MI_DRQ_IOIS 0x00000800 /* DMAREQ on IOIS16 */ 855*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_MI_DRQ_INP 0x00000c00 /* DMAREQ on INPACK */ 856*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_MI_DMA_8 0x00000000 /* DMA width 8 bits */ 857*0Sstevel@tonic-gate #define CISTPL_CFTABLE_TPCE_MI_DMA_16 0x00001000 /* DMA width 16 bits */ 858*0Sstevel@tonic-gate 859*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_misc_t { 860*0Sstevel@tonic-gate uint32_t flags; /* misc features flags */ 861*0Sstevel@tonic-gate } cistpl_cftable_entry_misc_t; 862*0Sstevel@tonic-gate 863*0Sstevel@tonic-gate /* 864*0Sstevel@tonic-gate * Additional information sub-tuples defines and structure 865*0Sstevel@tonic-gate */ 866*0Sstevel@tonic-gate #define STCE_EV 0x0c0 /* Environment Descriptor Subtuple */ 867*0Sstevel@tonic-gate #define STCE_PD 0x0c1 /* Physical Device Name Subtuple */ 868*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_stce_ev_t { 869*0Sstevel@tonic-gate char stev_strs[CIS_MAX_TUPLE_DATA_LEN]; 870*0Sstevel@tonic-gate } cistpl_cftable_entry_stce_ev_t; 871*0Sstevel@tonic-gate 872*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_stce_pd_t { 873*0Sstevel@tonic-gate char stpd_strs[CIS_MAX_TUPLE_DATA_LEN]; 874*0Sstevel@tonic-gate } cistpl_cftable_entry_stce_pd_t; 875*0Sstevel@tonic-gate 876*0Sstevel@tonic-gate /* 877*0Sstevel@tonic-gate * cistpl_cftable_entry_t - this is the struct that the caller passes 878*0Sstevel@tonic-gate * to the CISTPL_CFTABLE_ENTRY handler 879*0Sstevel@tonic-gate */ 880*0Sstevel@tonic-gate typedef struct cistpl_cftable_entry_t { 881*0Sstevel@tonic-gate uint32_t flags; /* which descriptions are valid */ 882*0Sstevel@tonic-gate uint32_t ifc; /* interface description info */ 883*0Sstevel@tonic-gate uint32_t pin; /* values for PRR */ 884*0Sstevel@tonic-gate uint32_t index; /* configuration index number */ 885*0Sstevel@tonic-gate struct cistpl_cftable_entry_pd_t pd; /* power requirements description */ 886*0Sstevel@tonic-gate struct cistpl_cftable_entry_speed_t speed; /* device speed description */ 887*0Sstevel@tonic-gate struct cistpl_cftable_entry_io_t io; /* device I/O map */ 888*0Sstevel@tonic-gate struct cistpl_cftable_entry_irq_t irq; /* device IRQ utilization */ 889*0Sstevel@tonic-gate struct cistpl_cftable_entry_mem_t mem; /* device memory space */ 890*0Sstevel@tonic-gate struct cistpl_cftable_entry_misc_t misc; /* misc device features */ 891*0Sstevel@tonic-gate } cistpl_cftable_entry_t; 892*0Sstevel@tonic-gate 893*0Sstevel@tonic-gate /* 894*0Sstevel@tonic-gate * CISTPL_LINKTARGET 895*0Sstevel@tonic-gate * 896*0Sstevel@tonic-gate * This tuple is used to verify that tuple chains other than the primary 897*0Sstevel@tonic-gate * chain which starts at offset 0 in Attribute Memory are valid. All 898*0Sstevel@tonic-gate * secondary tuple chains are required to contain this tuple as the 899*0Sstevel@tonic-gate * first tuple of the chain. 900*0Sstevel@tonic-gate * This tuple must have a link field of at least MIN_LINKTARGET_LENGTH and 901*0Sstevel@tonic-gate * must contain the byte pattern CISTPL_LINKTARGET_MAGIC. 902*0Sstevel@tonic-gate * LINKTARGET_AC_HEADER_LENGTH is the number of bytes contained in a 903*0Sstevel@tonic-gate * valid CISTPL_LINKTARGET tuple header. 904*0Sstevel@tonic-gate */ 905*0Sstevel@tonic-gate #define MIN_LINKTARGET_LENGTH 3 906*0Sstevel@tonic-gate #define CISTPL_LINKTARGET_MAGIC "CIS" 907*0Sstevel@tonic-gate #define LINKTARGET_AC_HEADER_LENGTH 2 908*0Sstevel@tonic-gate 909*0Sstevel@tonic-gate typedef struct cistpl_linktarget_t { 910*0Sstevel@tonic-gate uint32_t length; /* number of bytes in tpltg_tag */ 911*0Sstevel@tonic-gate char tpltg_tag[CIS_MAX_TUPLE_DATA_LEN]; 912*0Sstevel@tonic-gate } cistpl_linktarget_t; 913*0Sstevel@tonic-gate 914*0Sstevel@tonic-gate /* 915*0Sstevel@tonic-gate * CISTPL_LONGLINK_A and CISTPL_LONGLINK_C 916*0Sstevel@tonic-gate * 917*0Sstevel@tonic-gate * Both of these tuples are processed the same way. The target address is 918*0Sstevel@tonic-gate * really an offset from the beginning of the specified address space 919*0Sstevel@tonic-gate * and is not a virtual address. 920*0Sstevel@tonic-gate * This tuple must have a link field of at least MIN_LONGLINK_AC_LENGTH. 921*0Sstevel@tonic-gate */ 922*0Sstevel@tonic-gate #define MIN_LONGLINK_AC_LENGTH 4 923*0Sstevel@tonic-gate 924*0Sstevel@tonic-gate typedef struct cistpl_longlink_ac_t { 925*0Sstevel@tonic-gate uint32_t flags; /* space flags */ 926*0Sstevel@tonic-gate uint32_t tpll_addr; /* target address, normalized */ 927*0Sstevel@tonic-gate } cistpl_longlink_ac_t; 928*0Sstevel@tonic-gate /* 929*0Sstevel@tonic-gate * Flags for cistpl_longlink_ac_t->flags 930*0Sstevel@tonic-gate */ 931*0Sstevel@tonic-gate #define CISTPL_LONGLINK_AC_AM 0x0001 /* longlink to AM */ 932*0Sstevel@tonic-gate #define CISTPL_LONGLINK_AC_CM 0x0002 /* longlink to CM */ 933*0Sstevel@tonic-gate 934*0Sstevel@tonic-gate /* 935*0Sstevel@tonic-gate * CISTPL_LONGLINK_MFC 936*0Sstevel@tonic-gate * 937*0Sstevel@tonic-gate * This tuple describes the start of the function-specific CIS for each 938*0Sstevel@tonic-gate * function on a multi-function card. 939*0Sstevel@tonic-gate * 940*0Sstevel@tonic-gate * This tuple must have a link field of at least MIN_LONGLINK_AC_LENGTH. 941*0Sstevel@tonic-gate */ 942*0Sstevel@tonic-gate #define MIN_LONGLINK_MFC_LENGTH 6 943*0Sstevel@tonic-gate #define MIN_LONGLINK_MFC_NREGS 1 944*0Sstevel@tonic-gate 945*0Sstevel@tonic-gate typedef struct cis_function_t { 946*0Sstevel@tonic-gate uint32_t tas; /* target address space of function */ 947*0Sstevel@tonic-gate uint32_t addr; /* target address offset */ 948*0Sstevel@tonic-gate } cis_function_t; 949*0Sstevel@tonic-gate 950*0Sstevel@tonic-gate typedef struct cistpl_longlink_mfc_t { 951*0Sstevel@tonic-gate uint32_t nfuncs; /* number of functions */ 952*0Sstevel@tonic-gate uint32_t nregs; /* number of config register sets */ 953*0Sstevel@tonic-gate cis_function_t function[CIS_MAX_FUNCTIONS]; 954*0Sstevel@tonic-gate } cistpl_longlink_mfc_t; 955*0Sstevel@tonic-gate /* 956*0Sstevel@tonic-gate * Flags for cistpl_longlink_mfc_t->function[n]->tas 957*0Sstevel@tonic-gate */ 958*0Sstevel@tonic-gate #define CISTPL_LONGLINK_MFC_TAS_AM 0x00 /* CIS in attribute memory */ 959*0Sstevel@tonic-gate #define CISTPL_LONGLINK_MFC_TAS_CM 0x01 /* CIS in common memory */ 960*0Sstevel@tonic-gate 961*0Sstevel@tonic-gate /* 962*0Sstevel@tonic-gate * CISTPL_LONGLINK_CB 963*0Sstevel@tonic-gate * 964*0Sstevel@tonic-gate * This tuple describes the start of a function's CIS chain 965*0Sstevel@tonic-gate * for CardBus cards 966*0Sstevel@tonic-gate */ 967*0Sstevel@tonic-gate typedef struct cistpl_longlink_cb_t { 968*0Sstevel@tonic-gate uint32_t flags; /* address space flags */ 969*0Sstevel@tonic-gate uint32_t addr; /* raw (unproessed) address value */ 970*0Sstevel@tonic-gate union { 971*0Sstevel@tonic-gate /* device-dependant config space info */ 972*0Sstevel@tonic-gate struct { 973*0Sstevel@tonic-gate uint32_t offset; /* offset within config space */ 974*0Sstevel@tonic-gate } cfg; 975*0Sstevel@tonic-gate /* memory space info */ 976*0Sstevel@tonic-gate struct { 977*0Sstevel@tonic-gate uint32_t asi; /* BAR */ 978*0Sstevel@tonic-gate uint32_t offset; /* offset within BAR space */ 979*0Sstevel@tonic-gate } mem; 980*0Sstevel@tonic-gate /* expansion ROM space info */ 981*0Sstevel@tonic-gate struct { 982*0Sstevel@tonic-gate uint32_t image; /* image number */ 983*0Sstevel@tonic-gate uint32_t offset; /* offset from iamge base */ 984*0Sstevel@tonic-gate } rom; 985*0Sstevel@tonic-gate } space; 986*0Sstevel@tonic-gate } cistpl_longlink_cb_t; 987*0Sstevel@tonic-gate /* 988*0Sstevel@tonic-gate * Flags for cistpl_longlink_cb_t->flags 989*0Sstevel@tonic-gate */ 990*0Sstevel@tonic-gate #define CISTPL_LONGLINK_CB_CFG 0x0001 /* config space info valid */ 991*0Sstevel@tonic-gate #define CISTPL_LONGLINK_CB_MEM 0x0002 /* memory space info valid */ 992*0Sstevel@tonic-gate #define CISTPL_LONGLINK_CB_ROM 0x0004 /* expansion ROM space info valid */ 993*0Sstevel@tonic-gate 994*0Sstevel@tonic-gate /* 995*0Sstevel@tonic-gate * CISTPL_SPCL 996*0Sstevel@tonic-gate * 997*0Sstevel@tonic-gate * This tuple is the Special Purpose tuple and it's contents are dependant 998*0Sstevel@tonic-gate * on the meaning of the header information in this tuple. 999*0Sstevel@tonic-gate */ 1000*0Sstevel@tonic-gate typedef struct cistpl_spcl_t { 1001*0Sstevel@tonic-gate uint32_t id; /* tuple contents identification */ 1002*0Sstevel@tonic-gate uint32_t seq; /* data sequence number */ 1003*0Sstevel@tonic-gate uint32_t bytes; /* number of bytes following */ 1004*0Sstevel@tonic-gate uchar_t data[CIS_MAX_TUPLE_DATA_LEN]; 1005*0Sstevel@tonic-gate } cistpl_spcl_t; 1006*0Sstevel@tonic-gate /* 1007*0Sstevel@tonic-gate * Flags for cistpl_spcl_t->seq 1008*0Sstevel@tonic-gate */ 1009*0Sstevel@tonic-gate #define CISTPL_SPCL_SEQ_END 0x080 /* last tuple in sequence */ 1010*0Sstevel@tonic-gate 1011*0Sstevel@tonic-gate /* 1012*0Sstevel@tonic-gate * CISTPL_SWIL 1013*0Sstevel@tonic-gate * 1014*0Sstevel@tonic-gate * This tuple describes the software interleaving of data within a 1015*0Sstevel@tonic-gate * partition on the card. 1016*0Sstevel@tonic-gate */ 1017*0Sstevel@tonic-gate typedef struct cistpl_swil_t { 1018*0Sstevel@tonic-gate uint32_t intrlv; /* interleave */ 1019*0Sstevel@tonic-gate } cistpl_swil_t; 1020*0Sstevel@tonic-gate 1021*0Sstevel@tonic-gate /* 1022*0Sstevel@tonic-gate * CISTPL_BAR 1023*0Sstevel@tonic-gate * 1024*0Sstevel@tonic-gate * This tuple describes the CardBus Base Address Registers 1025*0Sstevel@tonic-gate */ 1026*0Sstevel@tonic-gate typedef struct cistpl_bar_t { 1027*0Sstevel@tonic-gate uint32_t attributes; /* attributes */ 1028*0Sstevel@tonic-gate uint32_t size; /* BAR size */ 1029*0Sstevel@tonic-gate } cistpl_bar_t; 1030*0Sstevel@tonic-gate /* 1031*0Sstevel@tonic-gate * Flags for cistpl_bar_t->attributes 1032*0Sstevel@tonic-gate */ 1033*0Sstevel@tonic-gate #define CISTPL_BAR_ASI_MASK 0x007 /* Base Address Register mask */ 1034*0Sstevel@tonic-gate #define CISTPL_BAR_ASI_BAR_1 0x001 /* Base Address Register 1 */ 1035*0Sstevel@tonic-gate #define CISTPL_BAR_ASI_BAR_2 0x002 /* Base Address Register 2 */ 1036*0Sstevel@tonic-gate #define CISTPL_BAR_ASI_BAR_3 0x003 /* Base Address Register 3 */ 1037*0Sstevel@tonic-gate #define CISTPL_BAR_ASI_BAR_4 0x004 /* Base Address Register 4 */ 1038*0Sstevel@tonic-gate #define CISTPL_BAR_ASI_BAR_5 0x005 /* Base Address Register 5 */ 1039*0Sstevel@tonic-gate #define CISTPL_BAR_ASI_BAR_6 0x006 /* Base Address Register 6 */ 1040*0Sstevel@tonic-gate #define CISTPL_BAR_ASI_BAR_7 0x007 /* Base Address Register 7 */ 1041*0Sstevel@tonic-gate #define CISTPL_BAR_ASI_EXP_ROM 0x007 /* Expansion ROM BAR */ 1042*0Sstevel@tonic-gate 1043*0Sstevel@tonic-gate #define CISTPL_BAR_AS_MEM 0x000 /* BAR is of type memory */ 1044*0Sstevel@tonic-gate #define CISTPL_BAR_AS_IO 0x008 /* BAR is of type IO */ 1045*0Sstevel@tonic-gate 1046*0Sstevel@tonic-gate #define CISTPL_BAR_PREFETCH_CACHE_MASK 0x060 /* prefetch/cache mask */ 1047*0Sstevel@tonic-gate #define CISTPL_BAR_PREFETCH 0x020 /* prefetchable not cacheable */ 1048*0Sstevel@tonic-gate #define CISTPL_BAR_PREFETCH_CACHE 0x040 /* prefetchable and cacheable */ 1049*0Sstevel@tonic-gate 1050*0Sstevel@tonic-gate #define CISTPL_BAR_BELOW_1MB 0x080 /* must locate within first MB */ 1051*0Sstevel@tonic-gate 1052*0Sstevel@tonic-gate /* 1053*0Sstevel@tonic-gate * CISTPL_DEVICEGEO and CISTPL_DEVICEGEO_A 1054*0Sstevel@tonic-gate * 1055*0Sstevel@tonic-gate * These tuples describe the device geometry of memory partitions. 1056*0Sstevel@tonic-gate */ 1057*0Sstevel@tonic-gate #define CISTPL_DEVICEGEO_MAX_PARTITIONS 42 1058*0Sstevel@tonic-gate typedef struct cistpl_devicegeo_info_t { 1059*0Sstevel@tonic-gate uint32_t bus; /* card interface width in bytes */ 1060*0Sstevel@tonic-gate uint32_t ebs; /* minimum erase block size */ 1061*0Sstevel@tonic-gate uint32_t rbs; /* minimum read block size */ 1062*0Sstevel@tonic-gate uint32_t wbs; /* minimum write bock size */ 1063*0Sstevel@tonic-gate uint32_t part; /* segment partition subdivisions */ 1064*0Sstevel@tonic-gate uint32_t hwil; /* hardware interleave */ 1065*0Sstevel@tonic-gate } cistpl_devicegeo_info_t; 1066*0Sstevel@tonic-gate typedef struct cistpl_devicegeo_t { 1067*0Sstevel@tonic-gate cistpl_devicegeo_info_t info[CISTPL_DEVICEGEO_MAX_PARTITIONS]; 1068*0Sstevel@tonic-gate } cistpl_devicegeo_t; 1069*0Sstevel@tonic-gate 1070*0Sstevel@tonic-gate /* 1071*0Sstevel@tonic-gate * The cistpl_get_tuple_name_t used to support the HANDTPL_RETURN_NAME 1072*0Sstevel@tonic-gate * operation of the CIS parser. 1073*0Sstevel@tonic-gate */ 1074*0Sstevel@tonic-gate typedef struct cistpl_get_tuple_name_t { 1075*0Sstevel@tonic-gate char name[CIS_MAX_TUPLE_NAME_LEN]; 1076*0Sstevel@tonic-gate } cistpl_get_tuple_name_t; 1077*0Sstevel@tonic-gate 1078*0Sstevel@tonic-gate /* 1079*0Sstevel@tonic-gate * cisparse_t - the structure that unifies all tuple parsing structures 1080*0Sstevel@tonic-gate */ 1081*0Sstevel@tonic-gate typedef union cisparse_t { 1082*0Sstevel@tonic-gate cistpl_config_t cistpl_config; 1083*0Sstevel@tonic-gate cistpl_device_t cistpl_device; 1084*0Sstevel@tonic-gate cistpl_vers_1_t cistpl_vers_1; 1085*0Sstevel@tonic-gate cistpl_vers_2_t cistpl_vers_2; 1086*0Sstevel@tonic-gate cistpl_jedec_t cistpl_jedec; 1087*0Sstevel@tonic-gate cistpl_format_t cistpl_format; 1088*0Sstevel@tonic-gate cistpl_geometry_t cistpl_geometry; 1089*0Sstevel@tonic-gate cistpl_byteorder_t cistpl_byteorder; 1090*0Sstevel@tonic-gate cistpl_date_t cistpl_date; 1091*0Sstevel@tonic-gate cistpl_battery_t cistpl_battery; 1092*0Sstevel@tonic-gate cistpl_org_t cistpl_org; 1093*0Sstevel@tonic-gate cistpl_manfid_t cistpl_manfid; 1094*0Sstevel@tonic-gate cistpl_funcid_t cistpl_funcid; 1095*0Sstevel@tonic-gate cistpl_funce_t cistpl_funce; 1096*0Sstevel@tonic-gate cistpl_cftable_entry_t cistpl_cftable_entry; 1097*0Sstevel@tonic-gate cistpl_linktarget_t cistpl_linktarget; 1098*0Sstevel@tonic-gate cistpl_longlink_ac_t cistpl_longlink_ac; 1099*0Sstevel@tonic-gate cistpl_longlink_mfc_t cistpl_longlink_mfc; 1100*0Sstevel@tonic-gate cistpl_spcl_t cistpl_spcl; 1101*0Sstevel@tonic-gate cistpl_swil_t cistpl_swil; 1102*0Sstevel@tonic-gate cistpl_bar_t cistpl_bar; 1103*0Sstevel@tonic-gate cistpl_devicegeo_t cistpl_devicegeo; 1104*0Sstevel@tonic-gate cistpl_longlink_cb_t cistpl_longlink_cb; 1105*0Sstevel@tonic-gate cistpl_get_tuple_name_t cistpl_get_tuple_name; 1106*0Sstevel@tonic-gate /* members below are for legacy support - REMOVE THEM BEFORE FCS!! */ 1107*0Sstevel@tonic-gate cistpl_config_t config; 1108*0Sstevel@tonic-gate cistpl_device_t device; 1109*0Sstevel@tonic-gate cistpl_vers_1_t version_1; 1110*0Sstevel@tonic-gate cistpl_vers_2_t version_2; 1111*0Sstevel@tonic-gate cistpl_jedec_t jedec; 1112*0Sstevel@tonic-gate cistpl_format_t format; 1113*0Sstevel@tonic-gate cistpl_geometry_t geometry; 1114*0Sstevel@tonic-gate cistpl_byteorder_t byteorder; 1115*0Sstevel@tonic-gate cistpl_date_t date; 1116*0Sstevel@tonic-gate cistpl_battery_t battery; 1117*0Sstevel@tonic-gate cistpl_org_t org; 1118*0Sstevel@tonic-gate cistpl_manfid_t manfid; 1119*0Sstevel@tonic-gate cistpl_funcid_t funcid; 1120*0Sstevel@tonic-gate cistpl_funce_t funce; 1121*0Sstevel@tonic-gate cistpl_cftable_entry_t cftable; 1122*0Sstevel@tonic-gate cistpl_linktarget_t linktarget; 1123*0Sstevel@tonic-gate cistpl_longlink_ac_t longlink_ac; 1124*0Sstevel@tonic-gate cistpl_longlink_mfc_t longlink_mfc; 1125*0Sstevel@tonic-gate cistpl_spcl_t spcl; 1126*0Sstevel@tonic-gate cistpl_swil_t swil; 1127*0Sstevel@tonic-gate cistpl_bar_t bar; 1128*0Sstevel@tonic-gate cistpl_devicegeo_t devgeo; 1129*0Sstevel@tonic-gate cistpl_longlink_cb_t longlink_cb; 1130*0Sstevel@tonic-gate cistpl_get_tuple_name_t tuple_name; 1131*0Sstevel@tonic-gate } cisparse_t; 1132*0Sstevel@tonic-gate 1133*0Sstevel@tonic-gate #ifdef __cplusplus 1134*0Sstevel@tonic-gate } 1135*0Sstevel@tonic-gate #endif 1136*0Sstevel@tonic-gate 1137*0Sstevel@tonic-gate #endif /* _CIS_HANDLERS_H */ 1138