1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright (c) 1996 by Sun Microsystems, Inc. 24 * All rights reserved. 25 */ 26 27 #ifndef _CS_STUBS_H 28 #define _CS_STUBS_H 29 30 #pragma ident "%W% %E% SMI" 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 37 /* 38 * Magic number for Card Services to use when registering it's entry 39 * point with the Card Services stubs module. 40 */ 41 #define CS_STUBS_MAGIC 0x19960300 42 43 /* 44 * Card Services function identifiers - these correspond to the PCMCIA 45 * standard function codes for CS with the exception of a few 46 * private and implementation-specific function identifiers. 47 * 48 * client services functions 49 */ 50 #define GetCardServicesInfo 0x000b 51 #define RegisterClient 0x0010 52 #define DeregisterClient 0x0002 53 #define GetStatus 0x000c 54 #define ResetFunction 0x0011 55 #define SetEventMask 0x0031 56 #define GetEventMask 0x002e 57 /* 58 * reource management functions 59 */ 60 #define RequestIO 0x001f 61 #define ReleaseIO 0x001b 62 #define RequestIRQ 0x0020 63 #define ReleaseIRQ 0x001c 64 #define RequestWindow 0x0021 65 #define ReleaseWindow 0x001d 66 #define ModifyWindow 0x0017 67 #define MapMemPage 0x0014 68 #define RequestSocketMask 0x0022 69 #define ReleaseSocketMask 0x002f 70 #define RequestConfiguration 0x0030 71 #define GetConfigurationInfo 0x0004 72 #define ModifyConfiguration 0x0027 73 #define ReleaseConfiguration 0x001e 74 #define AccessConfigurationRegister 0x0036 75 /* 76 * bulk memory service functions 77 */ 78 #define OpenMemory 0x0018 79 #define ReadMemory 0x0019 80 #define WriteMemory 0x0024 81 #define CopyMemory 0x0001 82 #define RegisterEraseQueue 0x000f 83 #define CheckEraseQueue 0x0026 84 #define DeregisterEraseQueue 0x0025 85 #define CloseMemory 0x0000 86 /* 87 * client utility functions 88 */ 89 #define GetFirstTuple 0x0007 90 #define GetNextTuple 0x000a 91 #define GetTupleData 0x000d 92 #define GetFirstRegion 0x0006 93 #define GetNextRegion 0x0009 94 #define GetFirstPartition 0x0005 95 #define GetNextPartition 0x0008 96 /* 97 * advanced client services functions 98 */ 99 #define ReturnSSEntry 0x0023 100 #define MapLogSocket 0x0012 101 #define MapPhySocket 0x0015 102 #define MapLogWindow 0x0013 103 #define MapPhyWindow 0x0016 104 #define RegisterMTD 0x001a 105 #define RegisterTimer 0x0028 106 #define SetRegion 0x0029 107 #define ValidateCIS 0x002b 108 #define RequestExclusive 0x002c 109 #define ReleaseExclusive 0x002d 110 #define GetFirstClient 0x000e 111 #define GetNextClient 0x002a 112 #define GetClientInfo 0x0003 113 #define AddSocketServices 0x0032 114 #define ReplaceSocketServices 0x0033 115 #define VendorSpecific 0x0034 116 #define AdjustResourceInfo 0x0035 117 /* 118 * private functions - clients should never call these; if they do, 119 * the system will esplode. 120 */ 121 #define CISRegister 0x1000 122 #define CISUnregister 0x1001 123 #define InitCISWindow 0x1002 124 /* 125 * Card Services functions specific to this implementation 126 */ 127 #define ParseTuple 0x2000 /* parses contents of tuples */ 128 #define MakeDeviceNode 0x2001 /* makes device nodes in fs */ 129 #define ConvertSpeed 0x2002 /* converts device speeds */ 130 #define ConvertSize 0x2003 /* converts device sizes */ 131 #define Event2Text 0x2004 /* return string of event type */ 132 #define Error2Text 0x2005 /* function or ret code string */ 133 #define CS_DDI_Info 0x2006 /* set/get DDI info */ 134 #define CS_Sys_Ctl 0x2007 /* CS system control */ 135 #define RemoveDeviceNode 0x2008 /* removes device nodes in fs */ 136 #define GetPhysicalAdapterInfo 0x2009 /* returns physical adapter info */ 137 #define CSFuncListEnd 0x8000 /* end of CS function list */ 138 139 /* 140 * Structure used when Card Services registers it's entry point with 141 * the Card Services stubs module 142 */ 143 typedef struct cs_register_cardservices_t { 144 uint32_t function; 145 uint32_t magic; 146 csfunction_t *cardservices; 147 csfunction_t *socketservices; 148 } cs_register_cardservices_t; 149 150 /* 151 * Functions for cs_register_cardservices_t 152 */ 153 #define CS_ENTRY_REGISTER 0x0001 154 #define CS_ENTRY_DEREGISTER 0x0002 155 #define CS_ENTRY_INQUIRE 0x0003 156 157 /* 158 * Function prototypes 159 */ 160 int32_t csx_register_cardservices(cs_register_cardservices_t *); 161 162 #ifdef __cplusplus 163 } 164 #endif 165 166 #endif /* _CS_STUBS_H */ 167