10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7862SRichard.Bean@Sun.COM * Common Development and Distribution License (the "License"). 6*7862SRichard.Bean@Sun.COM * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*7862SRichard.Bean@Sun.COM * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23*7862SRichard.Bean@Sun.COM * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _CS_H 270Sstevel@tonic-gate #define _CS_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #ifdef __cplusplus 300Sstevel@tonic-gate extern "C" { 310Sstevel@tonic-gate #endif 320Sstevel@tonic-gate 330Sstevel@tonic-gate /* 340Sstevel@tonic-gate * PCMCIA Card Services header file 350Sstevel@tonic-gate */ 360Sstevel@tonic-gate 370Sstevel@tonic-gate /* 380Sstevel@tonic-gate * XXX - This define really should be in a global header file 390Sstevel@tonic-gate * somewhere; we do this stunt here since a lot of 400Sstevel@tonic-gate * people include this header file but not necessarily 410Sstevel@tonic-gate * the header file in which this is defined. 420Sstevel@tonic-gate */ 430Sstevel@tonic-gate #ifndef _VERSION 440Sstevel@tonic-gate #define _VERSION(major, minor) ((major)<<16|(minor)) 450Sstevel@tonic-gate #endif 460Sstevel@tonic-gate 470Sstevel@tonic-gate /* 480Sstevel@tonic-gate * Define this version of CS - this should correspond to the PCMCIA 490Sstevel@tonic-gate * version number specified in the PCMCIA standard. 500Sstevel@tonic-gate */ 510Sstevel@tonic-gate #define CS_VERSION _VERSION(5, 2) 520Sstevel@tonic-gate 530Sstevel@tonic-gate /* 540Sstevel@tonic-gate * CS_INTERNAL_REVISION_LEVEL is our internal revision level value returned 550Sstevel@tonic-gate * via GetCardServicesInfo in get_cardservices_info_t->Revision 560Sstevel@tonic-gate */ 570Sstevel@tonic-gate #define CS_INTERNAL_REVISION_LEVEL _VERSION(2, 0) 580Sstevel@tonic-gate 590Sstevel@tonic-gate #define CS_GET_CARDSERVICES_INFO_VENDOR_STRING "Solaris UNIX Card Services\n" \ 60*7862SRichard.Bean@Sun.COM "Copyright 2008 Sun Microsystems, Inc. All rights reserved.\n" \ 61*7862SRichard.Bean@Sun.COM "Use is subject to license terms.\n" \ 62*7862SRichard.Bean@Sun.COM "@(#)cs.h 1.69 08/10/17 SMI\n" \ 63*7862SRichard.Bean@Sun.COM "Based on the PC Card Standard, February 1995\n" 640Sstevel@tonic-gate 650Sstevel@tonic-gate /* 660Sstevel@tonic-gate * typedef for function pointers to quiet lint and cc -v 670Sstevel@tonic-gate */ 680Sstevel@tonic-gate typedef int32_t (csfunction_t)(int32_t, ...); /* for lint - cc -v quieting */ 690Sstevel@tonic-gate 700Sstevel@tonic-gate /* 710Sstevel@tonic-gate * CS_SUN_VENDOR_DESCRIPTION - can be returned by clients handling 720Sstevel@tonic-gate * the CS_EVENT_CLIENT_INFO event in the 730Sstevel@tonic-gate * client_info_t->VendorName member. 740Sstevel@tonic-gate */ 750Sstevel@tonic-gate #define CS_SUN_VENDOR_DESCRIPTION "Sun Microsystems, Inc. (c) 1996" 760Sstevel@tonic-gate 770Sstevel@tonic-gate /* 780Sstevel@tonic-gate * Return codes from Card Services - these correspond to the PCMCIA 790Sstevel@tonic-gate * standard and also include some implementation-specific return 800Sstevel@tonic-gate * codes. 810Sstevel@tonic-gate */ 820Sstevel@tonic-gate #define CS_SUCCESS 0x00 /* Request succeeded */ 830Sstevel@tonic-gate #define CS_BAD_ADAPTER 0x01 /* Specified adapter is invalid */ 840Sstevel@tonic-gate #define CS_BAD_ATTRIBUTE 0x02 /* Bad attribute value */ 850Sstevel@tonic-gate #define CS_BAD_BASE 0x03 /* System base address invalid */ 860Sstevel@tonic-gate #define CS_BAD_EDC 0x04 /* EDC generator is invalid */ 870Sstevel@tonic-gate /* RESERVED - 0x05 */ 880Sstevel@tonic-gate #define CS_BAD_IRQ 0x06 /* Invalid IRQ */ 890Sstevel@tonic-gate #define CS_BAD_OFFSET 0x07 /* Card offset invalid */ 900Sstevel@tonic-gate #define CS_BAD_PAGE 0x08 /* Card page invalid */ 910Sstevel@tonic-gate #define CS_READ_FAILURE 0x09 /* Unable to complete read request */ 920Sstevel@tonic-gate #define CS_BAD_SIZE 0x0a /* Size is invalid */ 930Sstevel@tonic-gate #define CS_BAD_SOCKET 0x0b /* Specified socket is invalid */ 940Sstevel@tonic-gate /* RESERVED - 0x0c */ 950Sstevel@tonic-gate #define CS_BAD_TYPE 0x0d /* Window/interface type invalid */ 960Sstevel@tonic-gate #define CS_BAD_VCC 0x0e /* Vcc value/index invalid */ 970Sstevel@tonic-gate #define CS_BAD_VPP 0x0f /* Vpp value/index invalid */ 980Sstevel@tonic-gate #define CS_BAD_WINDOW 0x11 /* Specified window is invalid */ 990Sstevel@tonic-gate #define CS_WRITE_FAILURE 0x12 /* Unable to complete write request */ 1000Sstevel@tonic-gate /* RESERVED - 0x13 */ 1010Sstevel@tonic-gate #define CS_NO_CARD 0x14 /* No PC card in socket */ 1020Sstevel@tonic-gate #define CS_UNSUPPORTED_FUNCTION 0x15 /* Unsupported function */ 1030Sstevel@tonic-gate #define CS_UNSUPPORTED_MODE 0x16 /* Unsupported processor mode */ 1040Sstevel@tonic-gate #define CS_BAD_SPEED 0x17 /* Specified speed is unavailable */ 1050Sstevel@tonic-gate #define CS_BUSY 0x18 /* CS is busy - try again later */ 1060Sstevel@tonic-gate #define CS_GENERAL_FAILURE 0x19 /* Undefined error */ 1070Sstevel@tonic-gate #define CS_WRITE_PROTECTED 0x1a /* Media is write protected */ 1080Sstevel@tonic-gate #define CS_BAD_ARG_LENGTH 0x1b /* Arg length invalid */ 1090Sstevel@tonic-gate #define CS_BAD_ARGS 0x1c /* Arg values invalid */ 1100Sstevel@tonic-gate #define CS_CONFIGURATION_LOCKED 0x1d /* This configuration is locked */ 1110Sstevel@tonic-gate #define CS_IN_USE 0x1e /* Requested resource in use */ 1120Sstevel@tonic-gate #define CS_NO_MORE_ITEMS 0x1f /* No more of requested item */ 1130Sstevel@tonic-gate #define CS_OUT_OF_RESOURCE 0x20 /* Internal CS resources exhausted */ 1140Sstevel@tonic-gate #define CS_BAD_HANDLE 0x21 /* client or window handle invalid */ 1150Sstevel@tonic-gate 1160Sstevel@tonic-gate /* 1170Sstevel@tonic-gate * The following are Solaris-specific extended return codes 1180Sstevel@tonic-gate */ 1190Sstevel@tonic-gate #define CS_NO_CIS 0x80 /* No CIS on card */ 1200Sstevel@tonic-gate #define CS_BAD_CIS 0x81 /* Bad CIS on card */ 1210Sstevel@tonic-gate #define CS_UNKNOWN_TUPLE 0x82 /* unknown tuple */ 1220Sstevel@tonic-gate #define CS_BAD_VERSION 0x83 /* bad CS version */ 1230Sstevel@tonic-gate #define CS_UNSUPPORTED_EVENT 0x84 /* Unsupported event in client */ 1240Sstevel@tonic-gate #define CS_CSI_ERROR 0x85 /* error in csi driver protocol */ 1250Sstevel@tonic-gate #define CS_CSI_NOT_INIT 0x86 /* csi library/driver not initialized */ 1260Sstevel@tonic-gate #define CS_NO_TUPLE_PARSER 0x87 /* no tuple parser for this tuple */ 1270Sstevel@tonic-gate #define CS_CARD_NOT_READY 0x88 /* card not ready */ 1280Sstevel@tonic-gate #define CS_ERRORLIST_END 0x8000 /* end of error list */ 1290Sstevel@tonic-gate 1300Sstevel@tonic-gate /* 1310Sstevel@tonic-gate * Card Services event codes - these do NOT correspond to the PCMCIA 1320Sstevel@tonic-gate * standard event codes for CS since these events are encoded as 1330Sstevel@tonic-gate * bit flags, while the PCMCIA standard event codes are encoded 1340Sstevel@tonic-gate * as numerical values. In practice, this shouldn't be a problem 1350Sstevel@tonic-gate * since no one should be looking at the absolute value of the 1360Sstevel@tonic-gate * event codes; these defines should be used. 1370Sstevel@tonic-gate * 1380Sstevel@tonic-gate * The numerical value of an event code determines in what order a client 1390Sstevel@tonic-gate * will receive the event if other events are also pending for that 1400Sstevel@tonic-gate * client. XXX - need to make event_t a 64-bit field. 1410Sstevel@tonic-gate * 1420Sstevel@tonic-gate * Card Services receives these events from Socket Services or by reading 1430Sstevel@tonic-gate * the card's Pin Replacement Register. In either case, the client 1440Sstevel@tonic-gate * always gets the same type of notification. 1450Sstevel@tonic-gate */ 1460Sstevel@tonic-gate #define CS_EVENT_REGISTRATION_COMPLETE 0x00000001 /* 0x82 */ 1470Sstevel@tonic-gate #define CS_EVENT_PM_RESUME 0x00000002 /* 0x05 */ 1480Sstevel@tonic-gate #define CS_EVENT_CARD_INSERTION 0x00000004 /* 0x0c */ 1490Sstevel@tonic-gate #define CS_EVENT_CARD_READY 0x00000008 /* 0x01 */ 1500Sstevel@tonic-gate #define CS_EVENT_BATTERY_LOW 0x00000010 /* 0x02 is also BVD2 */ 1510Sstevel@tonic-gate #define CS_EVENT_BATTERY_DEAD 0x00000020 /* 0x40 is also BVD1 */ 1520Sstevel@tonic-gate #define CS_EVENT_CARD_LOCK 0x00000040 /* 0x03 */ 1530Sstevel@tonic-gate #define CS_EVENT_PM_SUSPEND 0x00000080 /* 0x04 */ 1540Sstevel@tonic-gate #define CS_EVENT_CARD_RESET 0x00000100 /* 0x11 */ 1550Sstevel@tonic-gate #define CS_EVENT_CARD_UNLOCK 0x00000200 /* 0x06 */ 1560Sstevel@tonic-gate #define CS_EVENT_EJECTION_COMPLETE 0x00000400 /* 0x07 */ 1570Sstevel@tonic-gate #define CS_EVENT_EJECTION_REQUEST 0x00000800 /* 0x08 */ 1580Sstevel@tonic-gate #define CS_EVENT_ERASE_COMPLETE 0x00001000 /* 0x81 */ 1590Sstevel@tonic-gate #define CS_EVENT_EXCLUSIVE_COMPLETE 0x00002000 /* 0x0d */ 1600Sstevel@tonic-gate #define CS_EVENT_EXCLUSIVE_REQUEST 0x00004000 /* 0x0e */ 1610Sstevel@tonic-gate #define CS_EVENT_INSERTION_COMPLETE 0x00008000 /* 0x09 */ 1620Sstevel@tonic-gate #define CS_EVENT_INSERTION_REQUEST 0x00010000 /* 0x0a */ 1630Sstevel@tonic-gate #define CS_EVENT_RESET_COMPLETE 0x00020000 /* 0x80 */ 1640Sstevel@tonic-gate #define CS_EVENT_RESET_PHYSICAL 0x00040000 /* 0x0f */ 1650Sstevel@tonic-gate #define CS_EVENT_RESET_REQUEST 0x00080000 /* 0x10 */ 1660Sstevel@tonic-gate #define CS_EVENT_MTD_REQUEST 0x00100000 /* 0x12 */ 1670Sstevel@tonic-gate #define CS_EVENT_CLIENT_INFO 0x00200000 /* 0x14 */ 1680Sstevel@tonic-gate #define CS_EVENT_TIMER_EXPIRED 0x00400000 /* 0x15 */ 1690Sstevel@tonic-gate #define CS_EVENT_WRITE_PROTECT 0x01000000 /* 0x17 */ 1700Sstevel@tonic-gate 1710Sstevel@tonic-gate /* 1720Sstevel@tonic-gate * The CS_EVENT_SS_UPDATED event is generated when Socket Services 1730Sstevel@tonic-gate * has completed parsing the CIS and has done any necessary 1740Sstevel@tonic-gate * work to get the client driver loaded and attached. 1750Sstevel@tonic-gate */ 1760Sstevel@tonic-gate #define CS_EVENT_SS_UPDATED 0x00800000 /* 0x16 */ 1770Sstevel@tonic-gate 1780Sstevel@tonic-gate /* 1790Sstevel@tonic-gate * The CS_EVENT_STATUS_CHANGE event is generated by a Socket Services 1800Sstevel@tonic-gate * PCE_CARD_STATUS_CHANGE event; this event gets converted to 1810Sstevel@tonic-gate * the appropriate Card Services events when Card Services 1820Sstevel@tonic-gate * reads the PRR. 1830Sstevel@tonic-gate */ 1840Sstevel@tonic-gate #define CS_EVENT_STATUS_CHANGE 0x02000000 /* ?? */ 1850Sstevel@tonic-gate 1860Sstevel@tonic-gate /* 1870Sstevel@tonic-gate * The CS_EVENT_CARD_REMOVAL is the last "real" CS event and must 1880Sstevel@tonic-gate * have the highest value of all "real" CS events so that this 1890Sstevel@tonic-gate * event is handed to the client after all other queued events 1900Sstevel@tonic-gate * have been processed. 1910Sstevel@tonic-gate * If the client has set the CS_EVENT_CARD_REMOVAL_LOWP flag in 1920Sstevel@tonic-gate * either of their event masks, then they will also receive 1930Sstevel@tonic-gate * a CS_EVENT_CARD_REMOVAL at low (cs_event_thread) priority; 1940Sstevel@tonic-gate * in this low priority removal event, the client can call 1950Sstevel@tonic-gate * many CS functions that they can't call when they recieve 1960Sstevel@tonic-gate * the high priority removal event. 1970Sstevel@tonic-gate */ 1980Sstevel@tonic-gate #define CS_EVENT_CARD_REMOVAL 0x10000000 /* 0x0b */ 1990Sstevel@tonic-gate #define CS_EVENT_CARD_REMOVAL_LOWP 0x20000000 /* ?? */ 2000Sstevel@tonic-gate /* 2010Sstevel@tonic-gate * The following are not events but they share the event flags field 2020Sstevel@tonic-gate * and are used internally by CS. These bit patterns will never 2030Sstevel@tonic-gate * be seen by clients. 2040Sstevel@tonic-gate * CS_EVENT_ALL_CLIENTS can only be set by the super-client and by 2050Sstevel@tonic-gate * the CSI clients; setting this bit causes the driver to 2060Sstevel@tonic-gate * receive any events specified in their event masks whenever 2070Sstevel@tonic-gate * any such events occur on the socket. 2080Sstevel@tonic-gate * CS_EVENT_READY_TIMEOUT is a CS-private flag and should never be 2090Sstevel@tonic-gate * set by clients. 2100Sstevel@tonic-gate */ 2110Sstevel@tonic-gate #define CS_EVENT_ALL_CLIENTS 0x40000000 /* ?? */ 2120Sstevel@tonic-gate #define CS_EVENT_READY_TIMEOUT 0x80000000 /* ?? */ 2130Sstevel@tonic-gate 2140Sstevel@tonic-gate /* 2150Sstevel@tonic-gate * CS_EVENT_CLIENT_EVENTS_MASK is a msk of events that only the framework 2160Sstevel@tonic-gate * is allowed to manipulate. 2170Sstevel@tonic-gate */ 2180Sstevel@tonic-gate #define CS_EVENT_CLIENT_EVENTS_MASK ~(CS_EVENT_SS_UPDATED | \ 2190Sstevel@tonic-gate CS_EVENT_ALL_CLIENTS | \ 2200Sstevel@tonic-gate CS_EVENT_CARD_REMOVAL_LOWP) 2210Sstevel@tonic-gate 2220Sstevel@tonic-gate /* 2230Sstevel@tonic-gate * client_info_t structure used by clients for a CS_EVENT_CLIENT_INFO 2240Sstevel@tonic-gate * event and for the GetClientInfo function. 2250Sstevel@tonic-gate */ 2260Sstevel@tonic-gate #define CS_CLIENT_INFO_MAX_NAME_LEN 80 2270Sstevel@tonic-gate typedef struct client_info_t { 2280Sstevel@tonic-gate uint32_t Attributes; 2290Sstevel@tonic-gate uint32_t Revision; /* BCD value of client revision */ 2300Sstevel@tonic-gate uint32_t CSLevel; /* BCD value of CS release */ 2310Sstevel@tonic-gate uint32_t RevDate; /* revision date */ 2320Sstevel@tonic-gate char ClientName[CS_CLIENT_INFO_MAX_NAME_LEN]; 2330Sstevel@tonic-gate char VendorName[CS_CLIENT_INFO_MAX_NAME_LEN]; 2340Sstevel@tonic-gate char DriverName[MODMAXNAMELEN]; 2350Sstevel@tonic-gate } client_info_t; 2360Sstevel@tonic-gate 2370Sstevel@tonic-gate /* 2380Sstevel@tonic-gate * Flags for client_info_t->Attributes 2390Sstevel@tonic-gate * 2400Sstevel@tonic-gate * The low order byte bit values are used to return the data passed 2410Sstevel@tonic-gate * in to RegisterClient in the client_reg_t->Attributes member. 2420Sstevel@tonic-gate */ 2430Sstevel@tonic-gate #define CS_CLIENT_INFO_SOCKET_SERVICES INFO_SOCKET_SERVICES 2440Sstevel@tonic-gate #define CS_CLIENT_INFO_IO_CLIENT INFO_IO_CLIENT 2450Sstevel@tonic-gate #define CS_CLIENT_INFO_MTD_CLIENT INFO_MTD_CLIENT 2460Sstevel@tonic-gate #define CS_CLIENT_INFO_MEM_CLIENT INFO_MEM_CLIENT 2470Sstevel@tonic-gate #define CS_CLIENT_INFO_CSI_CLIENT INFO_CSI_CLIENT 2480Sstevel@tonic-gate #define CS_CLIENT_INFO_CARD_SHARE INFO_CARD_SHARE 2490Sstevel@tonic-gate #define CS_CLIENT_INFO_CARD_EXCL INFO_CARD_EXCL 2500Sstevel@tonic-gate #define CS_CLIENT_INFO_CLIENT_MASK 0x000000ff 2510Sstevel@tonic-gate /* 2520Sstevel@tonic-gate * Control and status flags. 2530Sstevel@tonic-gate */ 2540Sstevel@tonic-gate #define CS_CLIENT_INFO_VALID 0x00010000 /* client info valid */ 2550Sstevel@tonic-gate #define CS_CLIENT_INFO_CLIENT_ACTIVE 0x00020000 /* client is for card */ 2560Sstevel@tonic-gate #define CS_CLIENT_INFO_FLAGS_MASK 0xffff0000 2570Sstevel@tonic-gate /* 2580Sstevel@tonic-gate * Client Info subservice flags and types. 2590Sstevel@tonic-gate */ 2600Sstevel@tonic-gate #define CS_CLIENT_INFO_SUBSVC_CS 0x00000000 /* CS client data */ 2610Sstevel@tonic-gate #define CS_CLIENT_INFO_SUBSVC_MASK 0x0000ff00 /* sub-service mask */ 2620Sstevel@tonic-gate #define GET_CLIENT_INFO_SUBSVC(s) (((s) & CS_CLIENT_INFO_SUBSVC_MASK)>>8) 2630Sstevel@tonic-gate #define SET_CLIENT_INFO_SUBSVC(s) (((s)<<8) & CS_CLIENT_INFO_SUBSVC_MASK) 2640Sstevel@tonic-gate 2650Sstevel@tonic-gate /* 2660Sstevel@tonic-gate * CS_CLIENT_INFO_MAKE_DATE - Macro to make constructing the 2670Sstevel@tonic-gate * client_info_t->RevDate member easier. Parameters are: 2680Sstevel@tonic-gate * 2690Sstevel@tonic-gate * day - from 1 to 31 2700Sstevel@tonic-gate * month - from 1 to 12 2710Sstevel@tonic-gate * year - year relative to 1980 2720Sstevel@tonic-gate * 00 - 1980 2730Sstevel@tonic-gate * 06 - 1986 2740Sstevel@tonic-gate * 12 = 1992 2750Sstevel@tonic-gate * 16 - 1996, etc... 2760Sstevel@tonic-gate */ 2770Sstevel@tonic-gate #define CS_CLIENT_INFO_MAKE_DATE(d, m, y) (((d) & 0x01f) | \ 2780Sstevel@tonic-gate (((m) & 0x0f) << 5) | \ 2790Sstevel@tonic-gate (((y) & 0x7f) << 9)) 2800Sstevel@tonic-gate #define CS_CLIENT_INFO_GET_DAY(d) ((d) & 0x1f) 2810Sstevel@tonic-gate #define CS_CLIENT_INFO_GET_MONTH(m) (((m) >> 5) & 0x0f) 2820Sstevel@tonic-gate #define CS_CLIENT_INFO_GET_YEAR(y) ((((y) >> 9) & 0x7f) + 1980) 2830Sstevel@tonic-gate #define CS_CLIENT_INFO_GET_YEAR_OFFSET(y) (((y) >> 9) & 0x7f) 2840Sstevel@tonic-gate 2850Sstevel@tonic-gate /* 2860Sstevel@tonic-gate * get_firstnext_client_t_t structure used for GetFirstClient and GetNextClient 2870Sstevel@tonic-gate */ 2880Sstevel@tonic-gate typedef struct get_firstnext_client_t { 2890Sstevel@tonic-gate uint32_t Socket; 2900Sstevel@tonic-gate uint32_t Attributes; 2910Sstevel@tonic-gate client_handle_t client_handle; /* returned client handle */ 2920Sstevel@tonic-gate uint32_t num_clients; 2930Sstevel@tonic-gate } get_firstnext_client_t; 2940Sstevel@tonic-gate 2950Sstevel@tonic-gate /* 2960Sstevel@tonic-gate * Flags for get_firstnext_client_t->Attributes 2970Sstevel@tonic-gate */ 2980Sstevel@tonic-gate #define CS_GET_FIRSTNEXT_CLIENT_ALL_CLIENTS 0x00000001 2990Sstevel@tonic-gate #define CS_GET_FIRSTNEXT_CLIENT_SOCKET_ONLY 0x00000002 3000Sstevel@tonic-gate 3010Sstevel@tonic-gate /* 3020Sstevel@tonic-gate * The client event callback argument structure - this is passed in to 3030Sstevel@tonic-gate * the client event handler. Most of these arguments are identical 3040Sstevel@tonic-gate * to the PCMCIA-specified arguments. 3050Sstevel@tonic-gate */ 3060Sstevel@tonic-gate typedef struct event_callback_args_t { 3070Sstevel@tonic-gate client_handle_t client_handle; 3080Sstevel@tonic-gate void *info; 3090Sstevel@tonic-gate void *mtdrequest; 3100Sstevel@tonic-gate void *buffer; 3110Sstevel@tonic-gate void *misc; 3120Sstevel@tonic-gate void *client_data; 3130Sstevel@tonic-gate client_info_t client_info; 3140Sstevel@tonic-gate } event_callback_args_t; 3150Sstevel@tonic-gate 3160Sstevel@tonic-gate /* 3170Sstevel@tonic-gate * Event priority flag passed to the client's event handler; the client 3180Sstevel@tonic-gate * uses this priority to determine which mutex to use. 3190Sstevel@tonic-gate */ 3200Sstevel@tonic-gate #define CS_EVENT_PRI_LOW 0x0001 3210Sstevel@tonic-gate #define CS_EVENT_PRI_HIGH 0x0002 3220Sstevel@tonic-gate #define CS_EVENT_PRI_NONE 0x0004 3230Sstevel@tonic-gate 3240Sstevel@tonic-gate /* 3250Sstevel@tonic-gate * Event-specific event_callback_args_t->info values 3260Sstevel@tonic-gate * 3270Sstevel@tonic-gate * CS_EVENT_WRITE_PROTECT 3280Sstevel@tonic-gate * CS_EVENT_WRITE_PROTECT_WPOFF - card is not write protected 3290Sstevel@tonic-gate * CS_EVENT_WRITE_PROTECT_WPON - card is write protected 3300Sstevel@tonic-gate */ 3310Sstevel@tonic-gate #define CS_EVENT_WRITE_PROTECT_WPOFF 0x0000 3320Sstevel@tonic-gate #define CS_EVENT_WRITE_PROTECT_WPON 0xffff 3330Sstevel@tonic-gate 3340Sstevel@tonic-gate /* 3350Sstevel@tonic-gate * Endinanness and data ordering Attribute bits common to both R2 and 3360Sstevel@tonic-gate * CardBus windows and common to RequestIO, RequestWindow and 3370Sstevel@tonic-gate * DupHandle. 3380Sstevel@tonic-gate */ 3390Sstevel@tonic-gate #define WIN_ACC_ENDIAN_MASK 0x00300000 /* endian mask */ 3400Sstevel@tonic-gate #define WIN_ACC_NEVER_SWAP 0x00000000 /* i/o access: no swap */ 3410Sstevel@tonic-gate #define WIN_ACC_BIG_ENDIAN 0x00100000 /* big endian */ 3420Sstevel@tonic-gate #define WIN_ACC_LITTLE_ENDIAN 0x00200000 /* little endian */ 3430Sstevel@tonic-gate 3440Sstevel@tonic-gate #define WIN_ACC_ORDER_MASK 0x00700000 /* order mask */ 3450Sstevel@tonic-gate #define WIN_ACC_STRICT_ORDER 0x00000000 /* strict order */ 3460Sstevel@tonic-gate #define WIN_ACC_UNORDERED_OK 0x00100000 /* may be re-ordered */ 3470Sstevel@tonic-gate #define WIN_ACC_MERGING_OK 0x00200000 /* may merge i/o */ 3480Sstevel@tonic-gate #define WIN_ACC_LOADCACHING_OK 0x00300000 /* may cache reads */ 3490Sstevel@tonic-gate #define WIN_ACC_STORECACHING_OK 0x00400000 /* may cache all i/o */ 3500Sstevel@tonic-gate 3510Sstevel@tonic-gate /* 3520Sstevel@tonic-gate * io_req_t structure used for RequestIO and ReleaseIO 3530Sstevel@tonic-gate */ 3540Sstevel@tonic-gate typedef struct io_req_t { 3550Sstevel@tonic-gate uint32_t Socket; 3560Sstevel@tonic-gate baseaddru_t BasePort1; 3570Sstevel@tonic-gate uint32_t NumPorts1; /* 1st IO range no. contiguous ports */ 3580Sstevel@tonic-gate uint32_t Attributes1; /* 1st IO range attributes */ 3590Sstevel@tonic-gate baseaddru_t BasePort2; 3600Sstevel@tonic-gate uint32_t NumPorts2; /* 2nd IO range no. contiguous ports */ 3610Sstevel@tonic-gate uint32_t Attributes2; /* 2nd IO range attributes */ 3620Sstevel@tonic-gate uint32_t IOAddrLines; /* number of IO address lines decoded */ 3630Sstevel@tonic-gate } io_req_t; 3640Sstevel@tonic-gate 3650Sstevel@tonic-gate /* 3660Sstevel@tonic-gate * Flags for RequestIO and ReleaseIO 3670Sstevel@tonic-gate */ 3680Sstevel@tonic-gate #define IO_DATA_WIDTH_MASK 0x00000001 /* data path width mask */ 3690Sstevel@tonic-gate #define IO_DATA_WIDTH_8 0x00000000 /* 8 bit data path */ 3700Sstevel@tonic-gate #define IO_DATA_WIDTH_16 0x00000001 /* 16 bit data path */ 3710Sstevel@tonic-gate 3720Sstevel@tonic-gate /* 3730Sstevel@tonic-gate * The following flags are included for compatability with other versions of 3740Sstevel@tonic-gate * Card Services, but they are not implemented in this version. They 3750Sstevel@tonic-gate * are assigned values as placeholders only. If any of these flags 3760Sstevel@tonic-gate * are set on a call to RequestIO, CS_BAD_ATTRIBUTE is returned. 3770Sstevel@tonic-gate */ 3780Sstevel@tonic-gate #define IO_SHARED 0x00010000 /* for compatability only */ 3790Sstevel@tonic-gate #define IO_FIRST_SHARED 0x00020000 /* for compatability only */ 3800Sstevel@tonic-gate #define IO_FORCE_ALIAS_ACCESS 0x00040000 /* for compatability only */ 3810Sstevel@tonic-gate 3820Sstevel@tonic-gate /* 3830Sstevel@tonic-gate * The following flags are private to Card Services and should never be set 3840Sstevel@tonic-gate * by a client. Doing so will cause the system to take a supervisor 3850Sstevel@tonic-gate * trap at level twenty-nine. 3860Sstevel@tonic-gate */ 3870Sstevel@tonic-gate #define IO_DEALLOCATE_WINDOW 0x10000000 /* CS private */ 3880Sstevel@tonic-gate #define IO_DISABLE_WINDOW 0x20000000 /* CS private */ 3890Sstevel@tonic-gate 3900Sstevel@tonic-gate /* 3910Sstevel@tonic-gate * win_req_t structure used for RequestWindow 3920Sstevel@tonic-gate * 3930Sstevel@tonic-gate * Note that the ReqOffset member is not defined in the current PCMCIA 3940Sstevel@tonic-gate * spec but is included here to aid clients in determining the 3950Sstevel@tonic-gate * optimum offset to give to MapMemPage. 3960Sstevel@tonic-gate */ 3970Sstevel@tonic-gate typedef struct win_req_t { 3980Sstevel@tonic-gate uint32_t Socket; 3990Sstevel@tonic-gate uint32_t Attributes; /* window flags */ 4000Sstevel@tonic-gate union { 4010Sstevel@tonic-gate uint32_t base; /* requested window base address */ 4020Sstevel@tonic-gate acc_handle_t handle; /* access handle for base of window */ 4030Sstevel@tonic-gate } Base; 4040Sstevel@tonic-gate uint32_t Size; /* window size requested/granted */ 4050Sstevel@tonic-gate union { 4060Sstevel@tonic-gate uint32_t AccessSpeed; /* window access speed */ 4070Sstevel@tonic-gate uint32_t IOAddrLines; /* for I/O windows only */ 4080Sstevel@tonic-gate } win_params; 4090Sstevel@tonic-gate uint32_t ReqOffset; /* required window offest */ 4100Sstevel@tonic-gate } win_req_t; 4110Sstevel@tonic-gate 4120Sstevel@tonic-gate /* 4130Sstevel@tonic-gate * modify_win_t structure used for ModifyWindow 4140Sstevel@tonic-gate */ 4150Sstevel@tonic-gate typedef struct modify_win_t { 4160Sstevel@tonic-gate uint32_t Attributes; /* window flags */ 4170Sstevel@tonic-gate uint32_t AccessSpeed; /* window access speed */ 4180Sstevel@tonic-gate } modify_win_t; 4190Sstevel@tonic-gate 4200Sstevel@tonic-gate /* 4210Sstevel@tonic-gate * Flags for RequestWindow and ModifyWindow 4220Sstevel@tonic-gate */ 4230Sstevel@tonic-gate #define WIN_MEMORY_TYPE_MASK 0x00000021 /* window type mask */ 4240Sstevel@tonic-gate #define WIN_MEMORY_TYPE_CM 0x00000000 /* window points to CM */ 4250Sstevel@tonic-gate #define WIN_MEMORY_TYPE_AM 0x00000001 /* window points to AM */ 4260Sstevel@tonic-gate #define WIN_MEMORY_TYPE_IO 0x00000020 /* window points to IO */ 4270Sstevel@tonic-gate 4280Sstevel@tonic-gate #define WIN_DATA_WIDTH_MASK 0x00000042 /* data path width mask */ 4290Sstevel@tonic-gate #define WIN_DATA_WIDTH_8 0x00000000 /* 8-bit data path */ 4300Sstevel@tonic-gate #define WIN_DATA_WIDTH_16 0x00000002 /* 16-bit data path */ 4310Sstevel@tonic-gate #define WIN_DATA_WIDTH_32 0x00000040 /* 32-bit data path */ 4320Sstevel@tonic-gate 4330Sstevel@tonic-gate #define WIN_ENABLE 0x00000004 /* enable/disable window */ 4340Sstevel@tonic-gate #define WIN_OFFSET_SIZE 0x00000008 /* card offsets window sized */ 4350Sstevel@tonic-gate #define WIN_ACCESS_SPEED_VALID 0x00000010 /* speed valid (ModifyWindow) */ 4360Sstevel@tonic-gate 4370Sstevel@tonic-gate #define WIN_PREFETCH_CACHE_MASK 0x00000300 /* prefetch/cache mask */ 4380Sstevel@tonic-gate #define WIN_PREFETCH 0x00000100 /* prefetchable not cacheable */ 4390Sstevel@tonic-gate #define WIN_PREFETCH_CACHE 0x00000200 /* prefetchable and cacheable */ 4400Sstevel@tonic-gate 4410Sstevel@tonic-gate #define WIN_BAR_MASK 0x00007000 /* Base Address Register mask */ 4420Sstevel@tonic-gate #define WIN_BAR_1 0x00001000 /* Base Address Register 1 */ 4430Sstevel@tonic-gate #define WIN_BAR_2 0x00002000 /* Base Address Register 2 */ 4440Sstevel@tonic-gate #define WIN_BAR_3 0x00003000 /* Base Address Register 3 */ 4450Sstevel@tonic-gate #define WIN_BAR_4 0x00004000 /* Base Address Register 4 */ 4460Sstevel@tonic-gate #define WIN_BAR_5 0x00005000 /* Base Address Register 5 */ 4470Sstevel@tonic-gate #define WIN_BAR_6 0x00006000 /* Base Address Register 6 */ 4480Sstevel@tonic-gate #define WIN_BAR_7 0x00007000 /* Base Address Register 7 */ 4490Sstevel@tonic-gate 4500Sstevel@tonic-gate /* 4510Sstevel@tonic-gate * The following flag is used internally by Card Services and should never 4520Sstevel@tonic-gate * be set by the caller. 4530Sstevel@tonic-gate */ 4540Sstevel@tonic-gate #define WIN_DATA_WIDTH_VALID 0x00008000 /* CS internal */ 4550Sstevel@tonic-gate 4560Sstevel@tonic-gate /* 4570Sstevel@tonic-gate * The following flags are included for compatability with other versions of 4580Sstevel@tonic-gate * Card Services, but they are not implemented in this version. They 4590Sstevel@tonic-gate * are assigned values as placeholders only. If any of these flags 4600Sstevel@tonic-gate * are set on a call to RequestWindow, CS_BAD_ATTRIBUTE is returned. 4610Sstevel@tonic-gate */ 4620Sstevel@tonic-gate #define WIN_PAGED 0x00010000 /* for compatability only */ 4630Sstevel@tonic-gate #define WIN_SHARED 0x00020000 /* for compatability only */ 4640Sstevel@tonic-gate #define WIN_FIRST_SHARED 0x00040000 /* for compatability only */ 4650Sstevel@tonic-gate #define WIN_BINDING_SPECIFIC 0x00080000 /* for compatability only */ 4660Sstevel@tonic-gate 4670Sstevel@tonic-gate /* 4680Sstevel@tonic-gate * The following flag is actually part of the AccessSpeed member 4690Sstevel@tonic-gate */ 4700Sstevel@tonic-gate #define WIN_USE_WAIT 0x80 /* use window that supports WAIT */ 4710Sstevel@tonic-gate 4720Sstevel@tonic-gate /* 4730Sstevel@tonic-gate * client_reg_t structure for RegisterClient 4740Sstevel@tonic-gate */ 4750Sstevel@tonic-gate typedef struct client_reg_t { 4760Sstevel@tonic-gate uint32_t Attributes; 4770Sstevel@tonic-gate uint32_t EventMask; 4780Sstevel@tonic-gate event_callback_args_t event_callback_args; 4790Sstevel@tonic-gate uint32_t Version; /* CS version to expect */ 4800Sstevel@tonic-gate csfunction_t *event_handler; 4810Sstevel@tonic-gate /* DDI support */ 4820Sstevel@tonic-gate ddi_iblock_cookie_t *iblk_cookie; /* event iblk cookie */ 4830Sstevel@tonic-gate ddi_idevice_cookie_t *idev_cookie; /* event idev cookie */ 4840Sstevel@tonic-gate dev_info_t *dip; /* client's dip */ 4850Sstevel@tonic-gate char driver_name[MODMAXNAMELEN]; 4860Sstevel@tonic-gate /* CS private */ 4870Sstevel@tonic-gate void *priv; /* CS private data */ 4880Sstevel@tonic-gate } client_reg_t; 4890Sstevel@tonic-gate 4900Sstevel@tonic-gate /* 4910Sstevel@tonic-gate * Flags for RegisterClient - some of these flags are also used internally 4920Sstevel@tonic-gate * by CS to sequence the order of event callbacks and to allow Socket 4930Sstevel@tonic-gate * Services to register as a "super" client. 4940Sstevel@tonic-gate * 4950Sstevel@tonic-gate * The client_reg_t->Attributes structure member uses these flags. 4960Sstevel@tonic-gate * 4970Sstevel@tonic-gate * The client_info_t->Attributes, client_types_t->type and client_t->flags 4980Sstevel@tonic-gate * tructure members use these flags as well. 4990Sstevel@tonic-gate * 5000Sstevel@tonic-gate * Client types - mutually exclusive. 5010Sstevel@tonic-gate */ 5020Sstevel@tonic-gate #define INFO_SOCKET_SERVICES 0x00000001 5030Sstevel@tonic-gate #define INFO_IO_CLIENT 0x00000002 5040Sstevel@tonic-gate #define INFO_MTD_CLIENT 0x00000004 5050Sstevel@tonic-gate #define INFO_MEM_CLIENT 0x00000008 5060Sstevel@tonic-gate #define INFO_CSI_CLIENT 0x00000010 5070Sstevel@tonic-gate #define INFO_CLIENT_TYPE_MASK (INFO_SOCKET_SERVICES | \ 5080Sstevel@tonic-gate INFO_IO_CLIENT | \ 5090Sstevel@tonic-gate INFO_MTD_CLIENT | \ 5100Sstevel@tonic-gate INFO_MEM_CLIENT | \ 5110Sstevel@tonic-gate INFO_CSI_CLIENT) 5120Sstevel@tonic-gate #define MAX_CLIENT_TYPES 3 /* doesn't include SS or CSI clients */ 5130Sstevel@tonic-gate 5140Sstevel@tonic-gate /* 5150Sstevel@tonic-gate * The following two are for backwards-compatability with the PCMCIA spec. 5160Sstevel@tonic-gate * We will give the client CARD_INSERTION and REGISTRATION_COMPLETE 5170Sstevel@tonic-gate * if either of these two bits are set. Normally, all IO and MEM 5180Sstevel@tonic-gate * clients should set both of these bits. 5190Sstevel@tonic-gate */ 5200Sstevel@tonic-gate #define INFO_CARD_SHARE 0x00000020 5210Sstevel@tonic-gate #define INFO_CARD_EXCL 0x00000040 5220Sstevel@tonic-gate #define INFO_CARD_FLAGS_MASK (INFO_CARD_SHARE | INFO_CARD_EXCL) 5230Sstevel@tonic-gate 5240Sstevel@tonic-gate /* 5250Sstevel@tonic-gate * tuple_t struct used for GetFirstTuple, GetNextTuple, GetTupleData 5260Sstevel@tonic-gate * and ParseTuple 5270Sstevel@tonic-gate * 5280Sstevel@tonic-gate * Note that the values for DesiredTuple are defined in the cis.h header 5290Sstevel@tonic-gate * file. 5300Sstevel@tonic-gate */ 5310Sstevel@tonic-gate typedef struct tuple_t { 5320Sstevel@tonic-gate uint32_t Socket; /* socket number to get tuple from */ 5330Sstevel@tonic-gate uint32_t Attributes; /* tuple return attributes */ 5340Sstevel@tonic-gate cisdata_t DesiredTuple; /* tuple to search for or flags */ 5350Sstevel@tonic-gate cisdata_t TupleOffset; /* offset in tuple data body */ 5360Sstevel@tonic-gate uint32_t Flags; /* CS private */ 5370Sstevel@tonic-gate cistpl_t *LinkOffset; /* CS private */ 5380Sstevel@tonic-gate cistpl_t *CISOffset; /* CS private */ 5390Sstevel@tonic-gate cisdata_t TupleDataMax; /* max size of tuple data area */ 5400Sstevel@tonic-gate cisdata_t TupleDataLen; /* actual size of tuple data area */ 5410Sstevel@tonic-gate /* tuple body data buffer */ 5420Sstevel@tonic-gate cisdata_t TupleData[CIS_MAX_TUPLE_DATA_LEN]; 5430Sstevel@tonic-gate cisdata_t TupleCode; /* tuple type code */ 5440Sstevel@tonic-gate cisdata_t TupleLink; /* tuple data body size */ 5450Sstevel@tonic-gate } tuple_t; 5460Sstevel@tonic-gate 5470Sstevel@tonic-gate /* 5480Sstevel@tonic-gate * Attribute flags definitions for CS tuple functions. 5490Sstevel@tonic-gate * 5500Sstevel@tonic-gate */ 5510Sstevel@tonic-gate #define TUPLE_RETURN_LINK 0x00000002 /* return link tuples */ 5520Sstevel@tonic-gate #define TUPLE_RETURN_IGNORED_TUPLES 0x00010000 /* return ignored tuples */ 5530Sstevel@tonic-gate #define TUPLE_RETURN_NAME 0x00020000 /* return tuple name */ 5540Sstevel@tonic-gate 5550Sstevel@tonic-gate /* 5560Sstevel@tonic-gate * cisinfo_t structure used for ValidateCIS 5570Sstevel@tonic-gate */ 5580Sstevel@tonic-gate typedef struct cisinfo_t { 5590Sstevel@tonic-gate uint32_t Socket; /* socket number to validate CIS on */ 5600Sstevel@tonic-gate uint32_t Chains; /* number of tuple chains in CIS */ 5610Sstevel@tonic-gate uint32_t Tuples; /* total number of tuples in CIS */ 5620Sstevel@tonic-gate } cisinfo_t; 5630Sstevel@tonic-gate 5640Sstevel@tonic-gate /* 5650Sstevel@tonic-gate * map_mem_page_t structure used for MapMemPage 5660Sstevel@tonic-gate */ 5670Sstevel@tonic-gate typedef struct map_mem_page_t { 5680Sstevel@tonic-gate uint32_t CardOffset; /* card offset */ 5690Sstevel@tonic-gate uint32_t Page; /* page number */ 5700Sstevel@tonic-gate } map_mem_page_t; 5710Sstevel@tonic-gate 5720Sstevel@tonic-gate /* 5730Sstevel@tonic-gate * sockevent_t structure used for GetEventMask and SetEventMask 5740Sstevel@tonic-gate */ 5750Sstevel@tonic-gate typedef struct sockevent_t { 5760Sstevel@tonic-gate uint32_t Attributes; /* attribute flags for call */ 5770Sstevel@tonic-gate uint32_t EventMask; /* event mask to set or return */ 5780Sstevel@tonic-gate uint32_t Socket; /* socket number if necessary */ 5790Sstevel@tonic-gate } sockevent_t; 5800Sstevel@tonic-gate 5810Sstevel@tonic-gate /* 5820Sstevel@tonic-gate * request_socket_mask_t structure used for RequestSocketMask 5830Sstevel@tonic-gate */ 5840Sstevel@tonic-gate typedef struct request_socket_mask_t { 5850Sstevel@tonic-gate uint32_t Socket; /* socket number if necessary */ 5860Sstevel@tonic-gate uint32_t EventMask; /* event mask to set or return */ 5870Sstevel@tonic-gate } request_socket_mask_t; 5880Sstevel@tonic-gate 5890Sstevel@tonic-gate /* 5900Sstevel@tonic-gate * release_socket_mask_t structure used for ReleaseSocketMask 5910Sstevel@tonic-gate */ 5920Sstevel@tonic-gate typedef struct release_socket_mask_t { 5930Sstevel@tonic-gate uint32_t Socket; 5940Sstevel@tonic-gate } release_socket_mask_t; 5950Sstevel@tonic-gate 5960Sstevel@tonic-gate /* 5970Sstevel@tonic-gate * Flags for GetEventMask and SetEventMask 5980Sstevel@tonic-gate */ 5990Sstevel@tonic-gate #define CONF_EVENT_MASK_GLOBAL 0x00000000 /* global event mask */ 6000Sstevel@tonic-gate #define CONF_EVENT_MASK_CLIENT 0x00000001 /* client event mask */ 6010Sstevel@tonic-gate #define CONF_EVENT_MASK_VALID 0x00000001 /* client event mask */ 6020Sstevel@tonic-gate 6030Sstevel@tonic-gate /* 6040Sstevel@tonic-gate * convert_speed_t structure used for ConvertSpeed 6050Sstevel@tonic-gate */ 6060Sstevel@tonic-gate typedef struct convert_speed_t { 6070Sstevel@tonic-gate uint32_t Attributes; 6080Sstevel@tonic-gate uint32_t nS; 6090Sstevel@tonic-gate uint32_t devspeed; 6100Sstevel@tonic-gate } convert_speed_t; 6110Sstevel@tonic-gate 6120Sstevel@tonic-gate /* 6130Sstevel@tonic-gate * Flags for ConvertSpeed 6140Sstevel@tonic-gate */ 6150Sstevel@tonic-gate #define CONVERT_NS_TO_DEVSPEED 0x00000001 6160Sstevel@tonic-gate #define CONVERT_DEVSPEED_TO_NS 0x00000002 6170Sstevel@tonic-gate 6180Sstevel@tonic-gate /* 6190Sstevel@tonic-gate * convert_size_t structure used for ConvertSize 6200Sstevel@tonic-gate */ 6210Sstevel@tonic-gate typedef struct convert_size_t { 6220Sstevel@tonic-gate uint32_t Attributes; 6230Sstevel@tonic-gate uint32_t bytes; 6240Sstevel@tonic-gate uint32_t devsize; 6250Sstevel@tonic-gate } convert_size_t; 6260Sstevel@tonic-gate 6270Sstevel@tonic-gate /* 6280Sstevel@tonic-gate * Flags for ConvertSize 6290Sstevel@tonic-gate */ 6300Sstevel@tonic-gate #define CONVERT_BYTES_TO_DEVSIZE 0x00000001 6310Sstevel@tonic-gate #define CONVERT_DEVSIZE_TO_BYTES 0x00000002 6320Sstevel@tonic-gate 6330Sstevel@tonic-gate #define MAX_CS_EVENT_BUFSIZE 64 /* single event */ 6340Sstevel@tonic-gate #define MAX_MULTI_EVENT_BUFSIZE 512 /* all events */ 6350Sstevel@tonic-gate 6360Sstevel@tonic-gate #define CS_EVENT_MAX_BUFSIZE MAX_MULTI_EVENT_BUFSIZE 6370Sstevel@tonic-gate #define CS_ERROR_MAX_BUFSIZE MAX_CS_EVENT_BUFSIZE 6380Sstevel@tonic-gate 6390Sstevel@tonic-gate /* 6400Sstevel@tonic-gate * event2text_t structure used for Event2Text 6410Sstevel@tonic-gate */ 6420Sstevel@tonic-gate typedef struct event2text_t { 6430Sstevel@tonic-gate event_t event; /* events */ 6440Sstevel@tonic-gate /* buffer to return text strings */ 6450Sstevel@tonic-gate char text[CS_EVENT_MAX_BUFSIZE]; 6460Sstevel@tonic-gate } event2text_t; 6470Sstevel@tonic-gate 6480Sstevel@tonic-gate /* 6490Sstevel@tonic-gate * error2text_t structure used for Error2Text 6500Sstevel@tonic-gate */ 6510Sstevel@tonic-gate typedef struct error2text_t { 6520Sstevel@tonic-gate uint32_t item; 6530Sstevel@tonic-gate char text[CS_ERROR_MAX_BUFSIZE]; 6540Sstevel@tonic-gate } error2text_t; 6550Sstevel@tonic-gate 6560Sstevel@tonic-gate /* 6570Sstevel@tonic-gate * get_status_t structure used for GetStatus 6580Sstevel@tonic-gate * 6590Sstevel@tonic-gate * The values in the status members are the same as the CS_EVENT_XXX values. 6600Sstevel@tonic-gate */ 6610Sstevel@tonic-gate typedef struct get_status_t { 6620Sstevel@tonic-gate uint32_t Socket; 6630Sstevel@tonic-gate uint32_t CardState; /* "live" card status for this client */ 6640Sstevel@tonic-gate uint32_t SocketState; /* latched socket values */ 6650Sstevel@tonic-gate uint32_t raw_CardState; /* raw live card status */ 6660Sstevel@tonic-gate } get_status_t; 6670Sstevel@tonic-gate 6680Sstevel@tonic-gate /* 6690Sstevel@tonic-gate * GetStatus returns card state using the same bit definitions 6700Sstevel@tonic-gate * as the CS_EVENT_XXX bits. Some of the CS_EVENT_XXX bits 6710Sstevel@tonic-gate * are not meaningful for GetStatus and are reused here for 6720Sstevel@tonic-gate * status definitions. 6730Sstevel@tonic-gate * 6740Sstevel@tonic-gate * get_status_t->CardState and get_status_t->raw_CardState bits 6750Sstevel@tonic-gate */ 6760Sstevel@tonic-gate #define CS_STATUS_WRITE_PROTECTED CS_EVENT_WRITE_PROTECT 6770Sstevel@tonic-gate #define CS_STATUS_CARD_LOCKED CS_EVENT_CARD_LOCK 6780Sstevel@tonic-gate #define CS_STATUS_EJECTION_REQUEST CS_EVENT_EJECTION_REQUEST 6790Sstevel@tonic-gate #define CS_STATUS_INSERTION_REQUEST CS_EVENT_INSERTION_REQUEST 6800Sstevel@tonic-gate #define CS_STATUS_BATTERY_DEAD CS_EVENT_BATTERY_DEAD 6810Sstevel@tonic-gate #define CS_STATUS_BATTERY_LOW CS_EVENT_BATTERY_LOW 6820Sstevel@tonic-gate #define CS_STATUS_CARD_READY CS_EVENT_CARD_READY 6830Sstevel@tonic-gate #define CS_STATUS_CARD_INSERTED CS_EVENT_CARD_INSERTION 6840Sstevel@tonic-gate #define CS_STATUS_RES_EVT1 0x00100000 6850Sstevel@tonic-gate #define CS_STATUS_RES_EVT2 0x00200000 6860Sstevel@tonic-gate #define CS_STATUS_RES_EVT3 0x00400000 6870Sstevel@tonic-gate #define CS_STATUS_VCC_50 0x10000000 6880Sstevel@tonic-gate #define CS_STATUS_VCC_33 0x20000000 6890Sstevel@tonic-gate #define CS_STATUS_VCC_XX 0x40000000 6900Sstevel@tonic-gate #define CS_STATUS_REQ_ATTN 0x80000000 6910Sstevel@tonic-gate /* 6920Sstevel@tonic-gate * get_status_t->SocketState bits 6930Sstevel@tonic-gate */ 6940Sstevel@tonic-gate #define CS_SOCK_STATUS_WRITE_PROTECT_CHANGE CS_EVENT_WRITE_PROTECT 6950Sstevel@tonic-gate #define CS_SOCK_STATUS_CARD_LOCK_CHNAGE CS_EVENT_CARD_LOCK 6960Sstevel@tonic-gate #define CS_SOCK_STATUS_EJECTION_PENDING CS_EVENT_EJECTION_REQUEST 6970Sstevel@tonic-gate #define CS_SOCK_STATUS_INSERTION_PENDING CS_EVENT_INSERTION_REQUEST 6980Sstevel@tonic-gate #define CS_SOCK_STATUS_BATTERY_DEAD_CHNAGE CS_EVENT_BATTERY_DEAD 6990Sstevel@tonic-gate #define CS_SOCK_STATUS_BATTERY_LOW_CHNAGE CS_EVENT_BATTERY_LOW 7000Sstevel@tonic-gate #define CS_SOCK_STATUS_CARD_READY_CHANGE CS_EVENT_CARD_READY 7010Sstevel@tonic-gate #define CS_SOCK_STATUS_CARD_DETECT_CHNAGE CS_EVENT_CARD_INSERTION 7020Sstevel@tonic-gate 7030Sstevel@tonic-gate /* 7040Sstevel@tonic-gate * map_log_socket_t structure used for MapLogSocket 7050Sstevel@tonic-gate */ 7060Sstevel@tonic-gate typedef struct map_log_socket_t { 7070Sstevel@tonic-gate uint32_t LogSocket; /* logical socket */ 7080Sstevel@tonic-gate uint32_t PhyAdapter; /* physical adapter */ 7090Sstevel@tonic-gate uint32_t PhySocket; /* physical socket */ 7100Sstevel@tonic-gate } map_log_socket_t; 7110Sstevel@tonic-gate 7120Sstevel@tonic-gate /* 7130Sstevel@tonic-gate * get_physical_adapter_info_t structure used for GetPhysicalAdapterInfo 7140Sstevel@tonic-gate */ 7150Sstevel@tonic-gate typedef struct get_physical_adapter_info_t { 7160Sstevel@tonic-gate uint32_t LogSocket; /* logical socket */ 7170Sstevel@tonic-gate uint32_t PhySocket; /* physical socket */ 7180Sstevel@tonic-gate uint32_t flags; /* adapter flags */ 7190Sstevel@tonic-gate char name[MODMAXNAMELEN]; /* adapter module name */ 7200Sstevel@tonic-gate uint32_t major; /* adapter major number */ 7210Sstevel@tonic-gate uint32_t minor; /* adapter minor number */ 7220Sstevel@tonic-gate uint32_t instance; /* instance number of this adapter */ 7230Sstevel@tonic-gate uint32_t number; /* canonical adapter number */ 7240Sstevel@tonic-gate uint32_t num_sockets; /* # sockets on this adapter */ 7250Sstevel@tonic-gate uint32_t first_socket; /* first socket # on this adapter */ 7260Sstevel@tonic-gate } get_physical_adapter_info_t; 7270Sstevel@tonic-gate 7280Sstevel@tonic-gate /* 7290Sstevel@tonic-gate * irq_req_t structure used for RequestIRQ and ReleaseIRQ 7300Sstevel@tonic-gate */ 7310Sstevel@tonic-gate typedef struct irq_req_t { 7320Sstevel@tonic-gate uint32_t Socket; 7330Sstevel@tonic-gate uint32_t Attributes; /* IRQ attribute flags */ 7340Sstevel@tonic-gate csfunction_t *irq_handler; 7350Sstevel@tonic-gate void *irq_handler_arg; 7360Sstevel@tonic-gate ddi_iblock_cookie_t *iblk_cookie; /* IRQ iblk cookie */ 7370Sstevel@tonic-gate ddi_idevice_cookie_t *idev_cookie; /* IRQ idev cookie */ 7380Sstevel@tonic-gate } irq_req_t; 7390Sstevel@tonic-gate 7400Sstevel@tonic-gate /* 7410Sstevel@tonic-gate * Flags for RequestIRQ and ReleaseIRQ 7420Sstevel@tonic-gate */ 7430Sstevel@tonic-gate #define IRQ_TYPE_EXCLUSIVE 0x00000002 7440Sstevel@tonic-gate /* 7450Sstevel@tonic-gate * The following flags are included for compatability with other versions of 7460Sstevel@tonic-gate * Card Services, but they are not implemented in this version. They 7470Sstevel@tonic-gate * are assigned values as placeholders only. If any of these flags 7480Sstevel@tonic-gate * are set on a call to RequestIRQ, CS_BAD_ATTRIBUTE is returned. 7490Sstevel@tonic-gate */ 7500Sstevel@tonic-gate #define IRQ_FORCED_PULSE 0x00010000 7510Sstevel@tonic-gate #define IRQ_TYPE_TIME 0x00020000 7520Sstevel@tonic-gate #define IRQ_TYPE_DYNAMIC_SHARING 0x00040000 7530Sstevel@tonic-gate #define IRQ_FIRST_SHARED 0x00080000 7540Sstevel@tonic-gate #define IRQ_PULSE_ALLOCATED 0x00100000 7550Sstevel@tonic-gate 7560Sstevel@tonic-gate /* 7570Sstevel@tonic-gate * release_config_t structure used for ReleaseConfiguration 7580Sstevel@tonic-gate */ 7590Sstevel@tonic-gate typedef struct release_config_t { 7600Sstevel@tonic-gate uint32_t Socket; 7610Sstevel@tonic-gate } release_config_t; 7620Sstevel@tonic-gate 7630Sstevel@tonic-gate /* 7640Sstevel@tonic-gate * config_req_t structure used for RequestConfiguration 7650Sstevel@tonic-gate */ 7660Sstevel@tonic-gate typedef struct config_req_t { 7670Sstevel@tonic-gate uint32_t Socket; 7680Sstevel@tonic-gate uint32_t Attributes; /* configuration attributes */ 7690Sstevel@tonic-gate uint32_t Vcc; /* Vcc value */ 7700Sstevel@tonic-gate uint32_t Vpp1; /* Vpp1 value */ 7710Sstevel@tonic-gate uint32_t Vpp2; /* Vpp2 value */ 7720Sstevel@tonic-gate uint32_t IntType; /* socket interface type - mem or IO */ 7730Sstevel@tonic-gate uint32_t ConfigBase; /* offset from start of AM space */ 7740Sstevel@tonic-gate uint32_t Status; /* value to write to STATUS register */ 7750Sstevel@tonic-gate uint32_t Pin; /* value to write to PRR */ 7760Sstevel@tonic-gate uint32_t Copy; /* value to write to COPY register */ 7770Sstevel@tonic-gate uint32_t ConfigIndex; /* value to write to COR */ 7780Sstevel@tonic-gate uint32_t Present; /* which config registers present */ 7790Sstevel@tonic-gate uint32_t ExtendedStatus; /* value to write to EXSTAT register */ 7800Sstevel@tonic-gate } config_req_t; 7810Sstevel@tonic-gate 7820Sstevel@tonic-gate /* 7830Sstevel@tonic-gate * Flags for RequestConfiguration - note that the CONF_ENABLE_IRQ_STEERING 7840Sstevel@tonic-gate * flag shares the same bit field as the Attributes flags for 7850Sstevel@tonic-gate * ModifyConfiguration. 7860Sstevel@tonic-gate */ 7870Sstevel@tonic-gate #define CONF_ENABLE_IRQ_STEERING 0x00010000 7880Sstevel@tonic-gate /* 7890Sstevel@tonic-gate * The following flags are used for the IntType member to specify which 7900Sstevel@tonic-gate * type of socket interface the client wants. 7910Sstevel@tonic-gate */ 7920Sstevel@tonic-gate #define SOCKET_INTERFACE_MEMORY 0x00000001 7930Sstevel@tonic-gate #define SOCKET_INTERFACE_MEMORY_AND_IO 0x00000002 7940Sstevel@tonic-gate /* 7950Sstevel@tonic-gate * The following flags are used for the Present member to specify which 7960Sstevel@tonic-gate * configuration registers are present. They may also be used by 7970Sstevel@tonic-gate * clients for their internal state. 7980Sstevel@tonic-gate */ 7990Sstevel@tonic-gate #define CONFIG_OPTION_REG_PRESENT 0x00000001 /* COR present */ 8000Sstevel@tonic-gate #define CONFIG_STATUS_REG_PRESENT 0x00000002 /* STAT reg present */ 8010Sstevel@tonic-gate #define CONFIG_PINREPL_REG_PRESENT 0x00000004 /* PRR present */ 8020Sstevel@tonic-gate #define CONFIG_COPY_REG_PRESENT 0x00000008 /* COPY reg present */ 8030Sstevel@tonic-gate #define CONFIG_EXSTAT_REG_PRESENT 0x00000010 /* EXSTAT reg present */ 8040Sstevel@tonic-gate #define CONFIG_IOBASE0_REG_PRESENT 0x00000020 /* IOBASE0 reg present */ 8050Sstevel@tonic-gate #define CONFIG_IOBASE1_REG_PRESENT 0x00000040 /* IOBASE1 reg present */ 8060Sstevel@tonic-gate #define CONFIG_IOBASE2_REG_PRESENT 0x00000080 /* IOBASE2 reg present */ 8070Sstevel@tonic-gate #define CONFIG_IOBASE3_REG_PRESENT 0x00000100 /* IOBASE3 reg present */ 8080Sstevel@tonic-gate #define CONFIG_IOLIMIT_REG_PRESENT 0x00000200 /* IOLIMIT reg present */ 8090Sstevel@tonic-gate 8100Sstevel@tonic-gate /* 8110Sstevel@tonic-gate * CONFIG_IOBASE_REG_MASK - mask of IO Base Port register present bits 8120Sstevel@tonic-gate * CONFIG_IOBASE_REG_SHIFT - shifts IO Base Port register present bits 8130Sstevel@tonic-gate */ 8140Sstevel@tonic-gate #define CONFIG_IOBASE_REG_MASK 0x000001e0 /* IOBASEn present mask */ 8150Sstevel@tonic-gate #define CONFIG_IOBASE_REG_SHIFT 5 8160Sstevel@tonic-gate 8170Sstevel@tonic-gate /* 8180Sstevel@tonic-gate * Bit definitions for configuration registers. 8190Sstevel@tonic-gate * 8200Sstevel@tonic-gate * Pin Replacement Register (PRR) bits - these are used for calls to 8210Sstevel@tonic-gate * RequestConfiguration, AccessConfigurationRegister and 8220Sstevel@tonic-gate * GetConfigurationInfo, as well as internally by clients 8230Sstevel@tonic-gate * and Card Services. 8240Sstevel@tonic-gate * To inform Card Services that a particular bit in the PRR is valid on 8250Sstevel@tonic-gate * a call to RequestConfiguration, both the XXX_STATUS and the 8260Sstevel@tonic-gate * XXX_EVENT bits must be set. 8270Sstevel@tonic-gate */ 8280Sstevel@tonic-gate #define PRR_WP_STATUS 0x01 /* R-WP state W-write WP Cbit */ 8290Sstevel@tonic-gate #define PRR_READY_STATUS 0x02 /* R-READY state W-write READY Cbit */ 8300Sstevel@tonic-gate #define PRR_BVD2_STATUS 0x04 /* R-BVD2 state W-write BVD2 Cbit */ 8310Sstevel@tonic-gate #define PRR_BVD1_STATUS 0x08 /* R-BVD1 state W-write BVD1 Cbit */ 8320Sstevel@tonic-gate #define PRR_WP_EVENT 0x10 /* WP changed */ 8330Sstevel@tonic-gate #define PRR_READY_EVENT 0x20 /* READY changed */ 8340Sstevel@tonic-gate #define PRR_BVD2_EVENT 0x40 /* BVD2 changed */ 8350Sstevel@tonic-gate #define PRR_BVD1_EVENT 0x80 /* BVD1 changed */ 8360Sstevel@tonic-gate /* 8370Sstevel@tonic-gate * Configuration Option Register (COR) bits 8380Sstevel@tonic-gate */ 8390Sstevel@tonic-gate #define COR_ENABLE_FUNCTION 0x01 /* enable function */ 8400Sstevel@tonic-gate #define COR_ENABLE_BASE_LIMIT 0x02 /* enable base and limit registers */ 8410Sstevel@tonic-gate #define COR_ENABLE_IREQ_ROUTING 0x04 /* enable IREQ routing */ 8420Sstevel@tonic-gate #define COR_STATUS_CHANGE_MODE 0x08 /* status change mode */ 8430Sstevel@tonic-gate #define COR_LEVEL_IRQ 0x40 /* set to enable level interrupts */ 8440Sstevel@tonic-gate #define COR_SOFT_RESET 0x80 /* soft reset bit */ 8450Sstevel@tonic-gate /* 8460Sstevel@tonic-gate * Card Configuration Status Register (CCSR) 8470Sstevel@tonic-gate */ 8480Sstevel@tonic-gate #define CCSR_INTR_ACK 0x01 /* interrupt acknowledge */ 8490Sstevel@tonic-gate #define CCSR_INTR 0x02 /* interrupt pending */ 8500Sstevel@tonic-gate #define CCSR_POWER_DOWN 0x04 /* power down card */ 8510Sstevel@tonic-gate #define CCSR_AUDIO 0x08 /* enable Audio signal */ 8520Sstevel@tonic-gate #define CCSR_IO_IS_8 0x20 /* only 8-bit IO data path */ 8530Sstevel@tonic-gate #define CCSR_SIG_CHG 0x40 /* enable status changes */ 8540Sstevel@tonic-gate #define CCSR_CHANGED 0x80 /* one of the PRR bits has changed */ 8550Sstevel@tonic-gate /* 8560Sstevel@tonic-gate * Macros to manipulate the Socket and Copy Register (SCR) values 8570Sstevel@tonic-gate */ 8580Sstevel@tonic-gate #define SCR_GET_SOCKET(r) ((r)&0x0f) 8590Sstevel@tonic-gate #define SCR_GET_COPY(r) (((r)>>4)&7) 8600Sstevel@tonic-gate #define SCR_SET_SOCKET(s) ((s)&0x0f) 8610Sstevel@tonic-gate #define SCR_SET_COPY(c) (((c)&7)<<4) 8620Sstevel@tonic-gate #define SCR_SET_SOCKET_COPY(s, c) (((s)&0x0f) | (((c)&7)<<4)) 8630Sstevel@tonic-gate 8640Sstevel@tonic-gate /* 8650Sstevel@tonic-gate * modify_config_t structure used for ModifyConfiguration 8660Sstevel@tonic-gate */ 8670Sstevel@tonic-gate typedef struct modify_config_t { 8680Sstevel@tonic-gate uint32_t Socket; 8690Sstevel@tonic-gate uint32_t Attributes; /* attributes to modify */ 8700Sstevel@tonic-gate uint32_t Vpp1; /* Vpp1 value */ 8710Sstevel@tonic-gate uint32_t Vpp2; /* Vpp2 value */ 8720Sstevel@tonic-gate } modify_config_t; 8730Sstevel@tonic-gate 8740Sstevel@tonic-gate /* 8750Sstevel@tonic-gate * Flags for ModifyConfiguration - note that the CONF_ENABLE_IRQ_STEERING 8760Sstevel@tonic-gate * flag used with RequestConfiguration shares this bit field. 8770Sstevel@tonic-gate */ 8780Sstevel@tonic-gate #define CONF_VPP1_CHANGE_VALID 0x00000002 /* Vpp1 is valid */ 8790Sstevel@tonic-gate #define CONF_VPP2_CHANGE_VALID 0x00000004 /* Vpp2 is valid */ 8800Sstevel@tonic-gate #define CONF_IRQ_CHANGE_VALID 0x00000008 /* IRQ is valid */ 8810Sstevel@tonic-gate 8820Sstevel@tonic-gate /* 8830Sstevel@tonic-gate * access_config_reg_t structure used for AccessConfigurationRegister 8840Sstevel@tonic-gate */ 8850Sstevel@tonic-gate typedef struct access_config_reg_t { 8860Sstevel@tonic-gate uint32_t Socket; 8870Sstevel@tonic-gate uint32_t Action; /* register access operation */ 8880Sstevel@tonic-gate uint32_t Offset; /* config register offset */ 8890Sstevel@tonic-gate uint32_t Value; /* value read or written */ 8900Sstevel@tonic-gate } access_config_reg_t; 8910Sstevel@tonic-gate /* 8920Sstevel@tonic-gate * Flags for AccessConfigurationRegister 8930Sstevel@tonic-gate */ 8940Sstevel@tonic-gate #define CONFIG_REG_READ 0x00000001 /* read config register */ 8950Sstevel@tonic-gate #define CONFIG_REG_WRITE 0x00000002 /* write config register */ 8960Sstevel@tonic-gate /* 8970Sstevel@tonic-gate * The following offsets are used to specify the configuration register 8980Sstevel@tonic-gate * offset to AccessConfigurationRegister 8990Sstevel@tonic-gate */ 9000Sstevel@tonic-gate #define CONFIG_OPTION_REG_OFFSET 0x00 /* COR offset */ 9010Sstevel@tonic-gate #define CONFIG_STATUS_REG_OFFSET 0x02 /* STAT reg offset */ 9020Sstevel@tonic-gate #define CONFIG_PINREPL_REG_OFFSET 0x04 /* PRR offset */ 9030Sstevel@tonic-gate #define CONFIG_COPY_REG_OFFSET 0x06 /* COPY reg offset */ 9040Sstevel@tonic-gate #define CONFIG_EXSTAT_REG_OFFSET 0x08 /* EXSTAT reg offset */ 9050Sstevel@tonic-gate #define CONFIG_IOBASE0_REG_OFFSET 0x0a /* IOBASE0 reg offset */ 9060Sstevel@tonic-gate #define CONFIG_IOBASE1_REG_OFFSET 0x0c /* IOBASE1 reg offset */ 9070Sstevel@tonic-gate #define CONFIG_IOBASE2_REG_OFFSET 0x0e /* IOBASE2 reg offset */ 9080Sstevel@tonic-gate #define CONFIG_IOBASE3_REG_OFFSET 0x10 /* IOBASE3 reg offset */ 9090Sstevel@tonic-gate #define CONFIG_IOLIMIT_REG_OFFSET 0x12 /* IOLIMIT reg offset */ 9100Sstevel@tonic-gate 9110Sstevel@tonic-gate /* 9120Sstevel@tonic-gate * reset_function_t structure used for ResetFunction 9130Sstevel@tonic-gate */ 9140Sstevel@tonic-gate typedef struct reset_function_t { 9150Sstevel@tonic-gate uint32_t Socket; 9160Sstevel@tonic-gate uint32_t Attributes; 9170Sstevel@tonic-gate } reset_function_t; 9180Sstevel@tonic-gate 9190Sstevel@tonic-gate /* 9200Sstevel@tonic-gate * get_cardservices_info_t structure used for GetCardServicesInfo 9210Sstevel@tonic-gate */ 9220Sstevel@tonic-gate #define CS_GET_CARDSERVICES_INFO_MAX_VS_LEN 512 9230Sstevel@tonic-gate typedef struct get_cardservices_info_t { 9240Sstevel@tonic-gate char Signature[2]; /* CS signature bytes */ 9250Sstevel@tonic-gate uint32_t NumSockets; /* number of sockets */ 9260Sstevel@tonic-gate uint32_t Revision; /* BCD value of CS revision */ 9270Sstevel@tonic-gate uint32_t CSLevel; /* BCD value of CS release */ 9280Sstevel@tonic-gate uint32_t FuncsPerSocket; /* max number of functions per socket */ 9290Sstevel@tonic-gate char VendorString[CS_GET_CARDSERVICES_INFO_MAX_VS_LEN]; 9300Sstevel@tonic-gate } get_cardservices_info_t; 9310Sstevel@tonic-gate 9320Sstevel@tonic-gate /* 9330Sstevel@tonic-gate * get_configuration_info_t structure used by GetConfigurationInfo 9340Sstevel@tonic-gate */ 9350Sstevel@tonic-gate typedef struct get_configuration_info_t { 9360Sstevel@tonic-gate uint32_t Socket; /* Socket/function to get info for */ 9370Sstevel@tonic-gate uint32_t Attributes; /* configuration attributes */ 9380Sstevel@tonic-gate uint32_t Vcc; /* Vcc value */ 9390Sstevel@tonic-gate uint32_t Vpp1; /* Vpp1 value */ 9400Sstevel@tonic-gate uint32_t Vpp2; /* Vpp2 value */ 9410Sstevel@tonic-gate uint32_t IntType; /* memory only or memory and IO ifc */ 9420Sstevel@tonic-gate uint32_t ConfigBase; /* offset from start of AM space */ 9430Sstevel@tonic-gate uint32_t Status; /* value written to STATUS register */ 9440Sstevel@tonic-gate uint32_t Pin; /* value written to PRR */ 9450Sstevel@tonic-gate uint32_t Copy; /* value to written COPY register */ 9460Sstevel@tonic-gate uint32_t Option; /* which written to COR */ 9470Sstevel@tonic-gate uint32_t Present; /* which config registers present */ 9480Sstevel@tonic-gate uint32_t FirstDevType; /* from CISTPL_DEVICE */ 9490Sstevel@tonic-gate uint32_t FuncCode; /* from CISTPL_FUNCID */ 9500Sstevel@tonic-gate uint32_t SysInitMask; /* from CISTPL_FUNCID */ 9510Sstevel@tonic-gate uint32_t ManufCode; /* from CISTPL_MANFID */ 9520Sstevel@tonic-gate uint32_t ManufInfo; /* from CISTPL_MANFID */ 9530Sstevel@tonic-gate uint32_t CardValues; /* which config registers written */ 9540Sstevel@tonic-gate uint32_t AssignedIRQ; /* IRQ assigned to card */ 9550Sstevel@tonic-gate uint32_t IRQ_Attributes; /* IRQ attributes */ 9560Sstevel@tonic-gate uint32_t BasePort1; /* address of 1st IO range */ 9570Sstevel@tonic-gate uint32_t NumPorts1; /* 1st IO range no. contiguous ports */ 9580Sstevel@tonic-gate uint32_t Attributes1; /* 1st IO range attributes */ 9590Sstevel@tonic-gate uint32_t BasePort2; /* address of 2nd IO range */ 9600Sstevel@tonic-gate uint32_t NumPorts2; /* 2nd IO range no. contiguous ports */ 9610Sstevel@tonic-gate uint32_t Attributes2; /* 2nd IO range attributes */ 9620Sstevel@tonic-gate uint32_t IOAddrLines; /* number of IO address lines decoded */ 9630Sstevel@tonic-gate uint32_t ExStat; /* value written to EXSTAT register */ 9640Sstevel@tonic-gate uint32_t DMA_Attributes; /* signals used for DMA */ 9650Sstevel@tonic-gate uint32_t DMA_Assign_Chan; /* assigned DMA channel */ 9660Sstevel@tonic-gate uint32_t NumIOWindows; /* number of IO windows in use */ 9670Sstevel@tonic-gate uint32_t NumMemWindows; /* number of memory windows in use */ 9680Sstevel@tonic-gate } get_configuration_info_t; 9690Sstevel@tonic-gate 9700Sstevel@tonic-gate /* 9710Sstevel@tonic-gate * devnode_desc_t structure used in make_device_node_t and remove_device_node_t 9720Sstevel@tonic-gate * for MakeDeviceNode and RemoveDeviceNode 9730Sstevel@tonic-gate */ 9740Sstevel@tonic-gate typedef struct devnode_desc_t { 9750Sstevel@tonic-gate char *name; /* device node path and name */ 9760Sstevel@tonic-gate int32_t spec_type; /* dev special type (block or char) */ 9770Sstevel@tonic-gate int32_t minor_num; /* device node minor number */ 9780Sstevel@tonic-gate char *node_type; /* device node type */ 9790Sstevel@tonic-gate } devnode_desc_t; 9800Sstevel@tonic-gate 9810Sstevel@tonic-gate /* 9820Sstevel@tonic-gate * make_device_node_t structure used for MakeDeviceNode 9830Sstevel@tonic-gate */ 9840Sstevel@tonic-gate typedef struct make_device_node_t { 9850Sstevel@tonic-gate uint32_t Action; /* device operation */ 9860Sstevel@tonic-gate uint32_t NumDevNodes; /* number of nodes to create */ 9870Sstevel@tonic-gate devnode_desc_t *devnode_desc; /* description of device nodes */ 9880Sstevel@tonic-gate } make_device_node_t; 9890Sstevel@tonic-gate /* 9900Sstevel@tonic-gate * Action values for MakeDeviceNode 9910Sstevel@tonic-gate */ 9920Sstevel@tonic-gate #define CREATE_DEVICE_NODE 0x01 /* create device node */ 9930Sstevel@tonic-gate 9940Sstevel@tonic-gate /* 9950Sstevel@tonic-gate * remove_device_node_t structure used for RemoveDeviceNode 9960Sstevel@tonic-gate */ 9970Sstevel@tonic-gate typedef struct remove_device_node_t { 9980Sstevel@tonic-gate uint32_t Action; /* device operation */ 9990Sstevel@tonic-gate uint32_t NumDevNodes; /* number of nodes to remove */ 10000Sstevel@tonic-gate devnode_desc_t *devnode_desc; /* description of device nodes */ 10010Sstevel@tonic-gate } remove_device_node_t; 10020Sstevel@tonic-gate /* 10030Sstevel@tonic-gate * Action values for RemoveDeviceNode 10040Sstevel@tonic-gate * 10050Sstevel@tonic-gate * Note: The "Action" member for make_device_node_t and remove_device_node_t 10060Sstevel@tonic-gate * share the same set of values. 10070Sstevel@tonic-gate */ 10080Sstevel@tonic-gate #define REMOVE_DEVICE_NODE 0x02 /* remove device node */ 10090Sstevel@tonic-gate #define REMOVE_ALL_DEVICE_NODES 0x03 /* remove all device nodes */ 10100Sstevel@tonic-gate 10110Sstevel@tonic-gate /* 10120Sstevel@tonic-gate * cs_ddi_info_t for CS_DDI_Info 10130Sstevel@tonic-gate */ 10140Sstevel@tonic-gate typedef struct cs_ddi_info_t { 10150Sstevel@tonic-gate uint32_t Socket; /* socket number */ 10160Sstevel@tonic-gate char *driver_name; /* unique driver name */ 10170Sstevel@tonic-gate dev_info_t *dip; /* dip */ 10180Sstevel@tonic-gate int32_t instance; /* instance */ 10190Sstevel@tonic-gate } cs_ddi_info_t; 10200Sstevel@tonic-gate 10210Sstevel@tonic-gate /* 10220Sstevel@tonic-gate * cs_sys_ctl_t for CS_Sys_Ctl 10230Sstevel@tonic-gate */ 10240Sstevel@tonic-gate typedef struct cs_sys_ctl_t { 10250Sstevel@tonic-gate uint32_t Socket; 10260Sstevel@tonic-gate uint32_t Action; 10270Sstevel@tonic-gate uint32_t Flags; 10280Sstevel@tonic-gate uint32_t Events; 10290Sstevel@tonic-gate client_handle_t client_handle; 10300Sstevel@tonic-gate } cs_sys_ctl_t; 10310Sstevel@tonic-gate /* 10320Sstevel@tonic-gate * cs_sys_ctl_t->Action defines 10330Sstevel@tonic-gate * 10340Sstevel@tonic-gate * CS_SYS_CTL_SEND_EVENT - send events in cs_sys_ctl_t->Events to clients 10350Sstevel@tonic-gate */ 10360Sstevel@tonic-gate #define CS_SYS_CTL_SEND_EVENT 0x0001 /* simulate events */ 10370Sstevel@tonic-gate /* 10380Sstevel@tonic-gate * cs_sys_ctl_t->Flags defines 10390Sstevel@tonic-gate * 10400Sstevel@tonic-gate * CS_SYS_CTL_WAIT_SYNC - wait for operation to complete, otherwise 10410Sstevel@tonic-gate * return immediately 10420Sstevel@tonic-gate * CS_SYS_CTL_EVENT_SOCKET - send events to all clients on specified 10430Sstevel@tonic-gate * socket 10440Sstevel@tonic-gate * CS_SYS_CTL_EVENT_CLIENT - send events to client specified by 10450Sstevel@tonic-gate * cs_sys_ctl_t->client_handle 10460Sstevel@tonic-gate */ 10470Sstevel@tonic-gate #define CS_SYS_CTL_WAIT_SYNC 0x00000001 /* synchornize with thread */ 10480Sstevel@tonic-gate #define CS_SYS_CTL_EVENT_SOCKET 0x00000002 /* to all clients on socket */ 10490Sstevel@tonic-gate #define CS_SYS_CTL_EVENT_CLIENT 0x00000004 /* to client specified */ 10500Sstevel@tonic-gate 10510Sstevel@tonic-gate /* 10520Sstevel@tonic-gate * Autoincrement control flags for RepPut8, RepPut16, RepPut32, RepPut32, 10530Sstevel@tonic-gate * RepGet8, RepGet16, RepGet32, RepGet64 10540Sstevel@tonic-gate */ 10550Sstevel@tonic-gate #define CS_DEV_AUTOINCR DDI_DEV_AUTOINCR 10560Sstevel@tonic-gate #define CS_DEV_NO_AUTOINCR DDI_DEV_NO_AUTOINCR 10570Sstevel@tonic-gate 10580Sstevel@tonic-gate /* 10590Sstevel@tonic-gate * Card Services function prototypes 10600Sstevel@tonic-gate */ 10610Sstevel@tonic-gate int32_t csx_RegisterClient(client_handle_t *, client_reg_t *); 10620Sstevel@tonic-gate int32_t csx_DeregisterClient(client_handle_t); 10630Sstevel@tonic-gate int32_t csx_GetStatus(client_handle_t, get_status_t *); 10640Sstevel@tonic-gate int32_t csx_SetEventMask(client_handle_t, sockevent_t *); 10650Sstevel@tonic-gate int32_t csx_GetEventMask(client_handle_t, sockevent_t *); 10660Sstevel@tonic-gate int32_t csx_RequestIO(client_handle_t, io_req_t *); 10670Sstevel@tonic-gate int32_t csx_ReleaseIO(client_handle_t, io_req_t *); 10680Sstevel@tonic-gate int32_t csx_RequestIRQ(client_handle_t, irq_req_t *); 10690Sstevel@tonic-gate int32_t csx_ReleaseIRQ(client_handle_t, irq_req_t *); 10700Sstevel@tonic-gate int32_t csx_RequestWindow(client_handle_t, window_handle_t *, win_req_t *); 10710Sstevel@tonic-gate int32_t csx_ReleaseWindow(window_handle_t); 10720Sstevel@tonic-gate int32_t csx_ModifyWindow(window_handle_t, modify_win_t *); 10730Sstevel@tonic-gate int32_t csx_MapMemPage(window_handle_t, map_mem_page_t *); 10740Sstevel@tonic-gate int32_t csx_RequestSocketMask(client_handle_t, request_socket_mask_t *); 10750Sstevel@tonic-gate int32_t csx_ReleaseSocketMask(client_handle_t, release_socket_mask_t *); 10760Sstevel@tonic-gate int32_t csx_RequestConfiguration(client_handle_t, config_req_t *); 10770Sstevel@tonic-gate int32_t csx_ModifyConfiguration(client_handle_t, modify_config_t *); 10780Sstevel@tonic-gate int32_t csx_ReleaseConfiguration(client_handle_t, release_config_t *); 10790Sstevel@tonic-gate int32_t csx_AccessConfigurationRegister(client_handle_t, access_config_reg_t *); 10800Sstevel@tonic-gate int32_t csx_GetFirstTuple(client_handle_t, tuple_t *); 10810Sstevel@tonic-gate int32_t csx_GetNextTuple(client_handle_t, tuple_t *); 10820Sstevel@tonic-gate int32_t csx_GetTupleData(client_handle_t, tuple_t *); 10830Sstevel@tonic-gate int32_t csx_MapLogSocket(client_handle_t, map_log_socket_t *); 10840Sstevel@tonic-gate int32_t csx_ValidateCIS(client_handle_t, cisinfo_t *); 10850Sstevel@tonic-gate int32_t csx_MakeDeviceNode(client_handle_t, make_device_node_t *); 10860Sstevel@tonic-gate int32_t csx_RemoveDeviceNode(client_handle_t, remove_device_node_t *); 10870Sstevel@tonic-gate int32_t csx_ConvertSpeed(convert_speed_t *); 10880Sstevel@tonic-gate int32_t csx_ConvertSize(convert_size_t *); 10890Sstevel@tonic-gate int32_t csx_Event2Text(event2text_t *); 10900Sstevel@tonic-gate int32_t csx_Error2Text(error2text_t *); 10910Sstevel@tonic-gate int32_t csx_CS_DDI_Info(cs_ddi_info_t *); 10920Sstevel@tonic-gate int32_t csx_CS_Sys_Ctl(cs_sys_ctl_t *); 10930Sstevel@tonic-gate int32_t csx_ResetFunction(client_handle_t, reset_function_t *); 10940Sstevel@tonic-gate int32_t csx_GetFirstClient(get_firstnext_client_t *); 10950Sstevel@tonic-gate int32_t csx_GetNextClient(get_firstnext_client_t *); 10960Sstevel@tonic-gate int32_t csx_GetClientInfo(client_handle_t, client_info_t *); 10970Sstevel@tonic-gate int32_t csx_GetCardServicesInfo(client_handle_t, get_cardservices_info_t *); 10980Sstevel@tonic-gate int32_t csx_GetConfigurationInfo(client_handle_t *, get_configuration_info_t *); 10990Sstevel@tonic-gate int32_t csx_GetPhysicalAdapterInfo(client_handle_t, 11000Sstevel@tonic-gate get_physical_adapter_info_t *); 11010Sstevel@tonic-gate 11020Sstevel@tonic-gate /* 11030Sstevel@tonic-gate * CIS tuple parsing functions 11040Sstevel@tonic-gate */ 11050Sstevel@tonic-gate int32_t csx_Parse_CISTPL_CONFIG(client_handle_t, tuple_t *, cistpl_config_t *); 11060Sstevel@tonic-gate int32_t csx_Parse_CISTPL_DEVICE(client_handle_t, tuple_t *, cistpl_device_t *); 11070Sstevel@tonic-gate int32_t csx_Parse_CISTPL_DEVICE_A(client_handle_t, tuple_t *, 11080Sstevel@tonic-gate cistpl_device_t *); 11090Sstevel@tonic-gate int32_t csx_Parse_CISTPL_DEVICE_OA(client_handle_t, tuple_t *, 11100Sstevel@tonic-gate cistpl_device_t *); 11110Sstevel@tonic-gate int32_t csx_Parse_CISTPL_DEVICE_OC(client_handle_t, tuple_t *, 11120Sstevel@tonic-gate cistpl_device_t *); 11130Sstevel@tonic-gate int32_t csx_Parse_CISTPL_VERS_1(client_handle_t, tuple_t *, cistpl_vers_1_t *); 11140Sstevel@tonic-gate int32_t csx_Parse_CISTPL_VERS_2(client_handle_t, tuple_t *, cistpl_vers_2_t *); 11150Sstevel@tonic-gate int32_t csx_Parse_CISTPL_JEDEC_A(client_handle_t, tuple_t *, cistpl_jedec_t *); 11160Sstevel@tonic-gate int32_t csx_Parse_CISTPL_JEDEC_C(client_handle_t, tuple_t *, cistpl_jedec_t *); 11170Sstevel@tonic-gate int32_t csx_Parse_CISTPL_FORMAT(client_handle_t, tuple_t *, cistpl_format_t *); 11180Sstevel@tonic-gate int32_t csx_Parse_CISTPL_FORMAT_A(client_handle_t, tuple_t *, 11190Sstevel@tonic-gate cistpl_format_t *); 11200Sstevel@tonic-gate int32_t csx_Parse_CISTPL_GEOMETRY(client_handle_t, tuple_t *, 11210Sstevel@tonic-gate cistpl_geometry_t *); 11220Sstevel@tonic-gate int32_t csx_Parse_CISTPL_BYTEORDER(client_handle_t, tuple_t *, 11230Sstevel@tonic-gate cistpl_byteorder_t *); 11240Sstevel@tonic-gate int32_t csx_Parse_CISTPL_DATE(client_handle_t, tuple_t *, cistpl_date_t *); 11250Sstevel@tonic-gate int32_t csx_Parse_CISTPL_BATTERY(client_handle_t, tuple_t *, 11260Sstevel@tonic-gate cistpl_battery_t *); 11270Sstevel@tonic-gate int32_t csx_Parse_CISTPL_ORG(client_handle_t, tuple_t *, cistpl_org_t *); 11280Sstevel@tonic-gate int32_t csx_Parse_CISTPL_MANFID(client_handle_t, tuple_t *, cistpl_manfid_t *); 11290Sstevel@tonic-gate int32_t csx_Parse_CISTPL_FUNCID(client_handle_t, tuple_t *, cistpl_funcid_t *); 11300Sstevel@tonic-gate int32_t csx_Parse_CISTPL_FUNCE(client_handle_t, tuple_t *, cistpl_funce_t *, 11310Sstevel@tonic-gate uint32_t); 11320Sstevel@tonic-gate int32_t csx_Parse_CISTPL_CFTABLE_ENTRY(client_handle_t, tuple_t *, 11330Sstevel@tonic-gate cistpl_cftable_entry_t *); 11340Sstevel@tonic-gate int32_t csx_Parse_CISTPL_LINKTARGET(client_handle_t, tuple_t *, 11350Sstevel@tonic-gate cistpl_linktarget_t *); 11360Sstevel@tonic-gate int32_t csx_Parse_CISTPL_LONGLINK_A(client_handle_t, tuple_t *, 11370Sstevel@tonic-gate cistpl_longlink_ac_t *); 11380Sstevel@tonic-gate int32_t csx_Parse_CISTPL_LONGLINK_C(client_handle_t, tuple_t *, 11390Sstevel@tonic-gate cistpl_longlink_ac_t *); 11400Sstevel@tonic-gate int32_t csx_Parse_CISTPL_LONGLINK_MFC(client_handle_t, tuple_t *, 11410Sstevel@tonic-gate cistpl_longlink_mfc_t *); 11420Sstevel@tonic-gate int32_t csx_Parse_CISTPL_SPCL(client_handle_t, tuple_t *, 11430Sstevel@tonic-gate cistpl_spcl_t *); 11440Sstevel@tonic-gate int32_t csx_Parse_CISTPL_SWIL(client_handle_t, tuple_t *, 11450Sstevel@tonic-gate cistpl_swil_t *); 11460Sstevel@tonic-gate int32_t csx_Parse_CISTPL_BAR(client_handle_t, tuple_t *, 11470Sstevel@tonic-gate cistpl_bar_t *); 11480Sstevel@tonic-gate int32_t csx_Parse_CISTPL_DEVICEGEO(client_handle_t, tuple_t *, 11490Sstevel@tonic-gate cistpl_devicegeo_t *); 11500Sstevel@tonic-gate int32_t csx_Parse_CISTPL_DEVICEGEO_A(client_handle_t, tuple_t *, 11510Sstevel@tonic-gate cistpl_devicegeo_t *); 11520Sstevel@tonic-gate int32_t csx_Parse_CISTPL_LONGLINK_CB(client_handle_t, tuple_t *, 11530Sstevel@tonic-gate cistpl_longlink_cb_t *); 11540Sstevel@tonic-gate int32_t csx_ParseTuple(client_handle_t, tuple_t *, cisparse_t *, uint32_t); 11550Sstevel@tonic-gate 11560Sstevel@tonic-gate /* 11570Sstevel@tonic-gate * Data access functions 11580Sstevel@tonic-gate */ 11590Sstevel@tonic-gate void csx_Put8(acc_handle_t, uint32_t, uint8_t); 11600Sstevel@tonic-gate void csx_Put16(acc_handle_t, uint32_t, uint16_t); 11610Sstevel@tonic-gate void csx_Put32(acc_handle_t, uint32_t, uint32_t); 11620Sstevel@tonic-gate void csx_Put64(acc_handle_t, uint32_t, uint64_t); 11630Sstevel@tonic-gate uint8_t csx_Get8(acc_handle_t, uint32_t); 11640Sstevel@tonic-gate uint16_t csx_Get16(acc_handle_t, uint32_t); 11650Sstevel@tonic-gate uint32_t csx_Get32(acc_handle_t, uint32_t); 11660Sstevel@tonic-gate uint64_t csx_Get64(acc_handle_t, uint32_t); 11670Sstevel@tonic-gate void csx_RepPut8(acc_handle_t, uint8_t *, uint32_t, uint32_t, uint32_t); 11680Sstevel@tonic-gate void csx_RepPut16(acc_handle_t, uint16_t *, uint32_t, uint32_t, uint32_t); 11690Sstevel@tonic-gate void csx_RepPut32(acc_handle_t, uint32_t *, uint32_t, uint32_t, uint32_t); 11700Sstevel@tonic-gate void csx_RepPut64(acc_handle_t, uint64_t *, uint32_t, uint32_t, uint32_t); 11710Sstevel@tonic-gate void csx_RepGet8(acc_handle_t, uint8_t *, uint32_t, uint32_t, uint32_t); 11720Sstevel@tonic-gate void csx_RepGet16(acc_handle_t, uint16_t *, uint32_t, uint32_t, uint32_t); 11730Sstevel@tonic-gate void csx_RepGet32(acc_handle_t, uint32_t *, uint32_t, uint32_t, uint32_t); 11740Sstevel@tonic-gate void csx_RepGet64(acc_handle_t, uint64_t *, uint32_t, uint32_t, uint32_t); 11750Sstevel@tonic-gate 11760Sstevel@tonic-gate /* 11770Sstevel@tonic-gate * Data access handle manipulation functions 11780Sstevel@tonic-gate */ 11790Sstevel@tonic-gate int32_t csx_GetMappedAddr(acc_handle_t, void **); 11800Sstevel@tonic-gate int32_t csx_GetPhysAddr(acc_handle_t, void **); 11810Sstevel@tonic-gate int32_t csx_DupHandle(acc_handle_t, acc_handle_t *, uint32_t); 11820Sstevel@tonic-gate int32_t csx_FreeHandle(acc_handle_t *); 11830Sstevel@tonic-gate int32_t csx_GetHandleOffset(acc_handle_t, uint32_t *); 11840Sstevel@tonic-gate int32_t csx_SetHandleOffset(acc_handle_t, uint32_t); 11850Sstevel@tonic-gate 11860Sstevel@tonic-gate /* 11870Sstevel@tonic-gate * XXX - PCMCIA Shady Meadows Retirement Community 11880Sstevel@tonic-gate * 11890Sstevel@tonic-gate * The defines in this section should be retired once the PS drivers 11900Sstevel@tonic-gate * get updated. 11910Sstevel@tonic-gate * 11920Sstevel@tonic-gate * XXX This is an old version of WIN_DATA_WIDTH_MASK and should be 11930Sstevel@tonic-gate * retired soon. RETIRE 11940Sstevel@tonic-gate */ 11950Sstevel@tonic-gate #define WIN_DATA_WIDTH 0x00000002 /* 16-bit data path */ 11960Sstevel@tonic-gate /* 11970Sstevel@tonic-gate * XXX The following are old versions of the IO_DATA_WIDTH_XXX names and 11980Sstevel@tonic-gate * should be retured soon. RETIRE 11990Sstevel@tonic-gate */ 12000Sstevel@tonic-gate #define IO_DATA_PATH_WIDTH 0x00000001 /* 16 bit data path */ 12010Sstevel@tonic-gate #define IO_DATA_PATH_WIDTH_8 0x00000000 /* 8 bit data path */ 12020Sstevel@tonic-gate #define IO_DATA_PATH_WIDTH_16 0x00000001 /* 16 bit data path */ 12030Sstevel@tonic-gate /* 12040Sstevel@tonic-gate * XXX - REMOVAL_ALL_DEVICE_NODES typo, remove soon. RETIRE 12050Sstevel@tonic-gate */ 12060Sstevel@tonic-gate #define REMOVAL_ALL_DEVICE_NODES 0x03 /* remove all device nodes */ 12070Sstevel@tonic-gate 12080Sstevel@tonic-gate /* 12090Sstevel@tonic-gate * The old name of the csx_RequestSocketMask structure was 12100Sstevel@tonic-gate * sockmask_t for some bizzare reason. This typedef 12110Sstevel@tonic-gate * keeps that old name around until we can fix 12120Sstevel@tonic-gate * the drivers. 12130Sstevel@tonic-gate */ 12140Sstevel@tonic-gate typedef struct request_socket_mask_t sockmask_t; /* RETIRE */ 12150Sstevel@tonic-gate 12160Sstevel@tonic-gate /* XXX - RETIRE and change to a typedef XXX */ 12170Sstevel@tonic-gate struct devnode_desc { 12180Sstevel@tonic-gate char *name; /* device node path and name */ 12190Sstevel@tonic-gate int32_t spec_type; /* dev special type (block or char) */ 12200Sstevel@tonic-gate int32_t minor_num; /* device node minor number */ 12210Sstevel@tonic-gate char *node_type; /* device node type */ 12220Sstevel@tonic-gate }; 12230Sstevel@tonic-gate 12240Sstevel@tonic-gate #ifdef __cplusplus 12250Sstevel@tonic-gate } 12260Sstevel@tonic-gate #endif 12270Sstevel@tonic-gate 12280Sstevel@tonic-gate #endif /* _CS_H */ 1229