xref: /onnv-gate/usr/src/uts/common/pcmcia/sys/cs_stubs.h (revision 0:68f95e015346)
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) 1996 by Sun Microsystems, Inc.
24*0Sstevel@tonic-gate  * All rights reserved.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef _CS_STUBS_H
28*0Sstevel@tonic-gate #define	_CS_STUBS_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%W%	%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 /*
38*0Sstevel@tonic-gate  * Magic number for Card Services to use when registering it's entry
39*0Sstevel@tonic-gate  *	point with the Card Services stubs module.
40*0Sstevel@tonic-gate  */
41*0Sstevel@tonic-gate #define	CS_STUBS_MAGIC	0x19960300
42*0Sstevel@tonic-gate 
43*0Sstevel@tonic-gate /*
44*0Sstevel@tonic-gate  * Card Services function identifiers - these correspond to the PCMCIA
45*0Sstevel@tonic-gate  *	standard function codes for CS with the exception of a few
46*0Sstevel@tonic-gate  *	private and implementation-specific function identifiers.
47*0Sstevel@tonic-gate  *
48*0Sstevel@tonic-gate  * client services functions
49*0Sstevel@tonic-gate  */
50*0Sstevel@tonic-gate #define	GetCardServicesInfo		0x000b
51*0Sstevel@tonic-gate #define	RegisterClient			0x0010
52*0Sstevel@tonic-gate #define	DeregisterClient		0x0002
53*0Sstevel@tonic-gate #define	GetStatus			0x000c
54*0Sstevel@tonic-gate #define	ResetFunction			0x0011
55*0Sstevel@tonic-gate #define	SetEventMask			0x0031
56*0Sstevel@tonic-gate #define	GetEventMask			0x002e
57*0Sstevel@tonic-gate /*
58*0Sstevel@tonic-gate  * reource management functions
59*0Sstevel@tonic-gate  */
60*0Sstevel@tonic-gate #define	RequestIO			0x001f
61*0Sstevel@tonic-gate #define	ReleaseIO			0x001b
62*0Sstevel@tonic-gate #define	RequestIRQ			0x0020
63*0Sstevel@tonic-gate #define	ReleaseIRQ			0x001c
64*0Sstevel@tonic-gate #define	RequestWindow			0x0021
65*0Sstevel@tonic-gate #define	ReleaseWindow			0x001d
66*0Sstevel@tonic-gate #define	ModifyWindow			0x0017
67*0Sstevel@tonic-gate #define	MapMemPage			0x0014
68*0Sstevel@tonic-gate #define	RequestSocketMask		0x0022
69*0Sstevel@tonic-gate #define	ReleaseSocketMask		0x002f
70*0Sstevel@tonic-gate #define	RequestConfiguration		0x0030
71*0Sstevel@tonic-gate #define	GetConfigurationInfo		0x0004
72*0Sstevel@tonic-gate #define	ModifyConfiguration		0x0027
73*0Sstevel@tonic-gate #define	ReleaseConfiguration		0x001e
74*0Sstevel@tonic-gate #define	AccessConfigurationRegister	0x0036
75*0Sstevel@tonic-gate /*
76*0Sstevel@tonic-gate  * bulk memory service functions
77*0Sstevel@tonic-gate  */
78*0Sstevel@tonic-gate #define	OpenMemory			0x0018
79*0Sstevel@tonic-gate #define	ReadMemory			0x0019
80*0Sstevel@tonic-gate #define	WriteMemory			0x0024
81*0Sstevel@tonic-gate #define	CopyMemory			0x0001
82*0Sstevel@tonic-gate #define	RegisterEraseQueue		0x000f
83*0Sstevel@tonic-gate #define	CheckEraseQueue			0x0026
84*0Sstevel@tonic-gate #define	DeregisterEraseQueue		0x0025
85*0Sstevel@tonic-gate #define	CloseMemory			0x0000
86*0Sstevel@tonic-gate /*
87*0Sstevel@tonic-gate  * client utility functions
88*0Sstevel@tonic-gate  */
89*0Sstevel@tonic-gate #define	GetFirstTuple			0x0007
90*0Sstevel@tonic-gate #define	GetNextTuple			0x000a
91*0Sstevel@tonic-gate #define	GetTupleData			0x000d
92*0Sstevel@tonic-gate #define	GetFirstRegion			0x0006
93*0Sstevel@tonic-gate #define	GetNextRegion			0x0009
94*0Sstevel@tonic-gate #define	GetFirstPartition		0x0005
95*0Sstevel@tonic-gate #define	GetNextPartition		0x0008
96*0Sstevel@tonic-gate /*
97*0Sstevel@tonic-gate  * advanced client services functions
98*0Sstevel@tonic-gate  */
99*0Sstevel@tonic-gate #define	ReturnSSEntry			0x0023
100*0Sstevel@tonic-gate #define	MapLogSocket			0x0012
101*0Sstevel@tonic-gate #define	MapPhySocket			0x0015
102*0Sstevel@tonic-gate #define	MapLogWindow			0x0013
103*0Sstevel@tonic-gate #define	MapPhyWindow			0x0016
104*0Sstevel@tonic-gate #define	RegisterMTD			0x001a
105*0Sstevel@tonic-gate #define	RegisterTimer			0x0028
106*0Sstevel@tonic-gate #define	SetRegion			0x0029
107*0Sstevel@tonic-gate #define	ValidateCIS			0x002b
108*0Sstevel@tonic-gate #define	RequestExclusive		0x002c
109*0Sstevel@tonic-gate #define	ReleaseExclusive		0x002d
110*0Sstevel@tonic-gate #define	GetFirstClient			0x000e
111*0Sstevel@tonic-gate #define	GetNextClient			0x002a
112*0Sstevel@tonic-gate #define	GetClientInfo			0x0003
113*0Sstevel@tonic-gate #define	AddSocketServices		0x0032
114*0Sstevel@tonic-gate #define	ReplaceSocketServices		0x0033
115*0Sstevel@tonic-gate #define	VendorSpecific			0x0034
116*0Sstevel@tonic-gate #define	AdjustResourceInfo		0x0035
117*0Sstevel@tonic-gate /*
118*0Sstevel@tonic-gate  * private functions - clients should never call these; if they do,
119*0Sstevel@tonic-gate  *	the system will esplode.
120*0Sstevel@tonic-gate  */
121*0Sstevel@tonic-gate #define	CISRegister			0x1000
122*0Sstevel@tonic-gate #define	CISUnregister			0x1001
123*0Sstevel@tonic-gate #define	InitCISWindow			0x1002
124*0Sstevel@tonic-gate /*
125*0Sstevel@tonic-gate  * Card Services functions specific to this implementation
126*0Sstevel@tonic-gate  */
127*0Sstevel@tonic-gate #define	ParseTuple		0x2000	/* parses contents of tuples */
128*0Sstevel@tonic-gate #define	MakeDeviceNode		0x2001	/* makes device nodes in fs */
129*0Sstevel@tonic-gate #define	ConvertSpeed		0x2002	/* converts device speeds */
130*0Sstevel@tonic-gate #define	ConvertSize		0x2003	/* converts device sizes */
131*0Sstevel@tonic-gate #define	Event2Text		0x2004	/* return string of event type */
132*0Sstevel@tonic-gate #define	Error2Text		0x2005	/* function or ret code string */
133*0Sstevel@tonic-gate #define	CS_DDI_Info		0x2006	/* set/get DDI info */
134*0Sstevel@tonic-gate #define	CS_Sys_Ctl		0x2007  /* CS system control */
135*0Sstevel@tonic-gate #define	RemoveDeviceNode	0x2008	/* removes device nodes in fs */
136*0Sstevel@tonic-gate #define	GetPhysicalAdapterInfo	0x2009	/* returns physical adapter info */
137*0Sstevel@tonic-gate #define	CSFuncListEnd		0x8000	/* end of CS function list */
138*0Sstevel@tonic-gate 
139*0Sstevel@tonic-gate /*
140*0Sstevel@tonic-gate  * Structure used when Card Services registers it's entry point with
141*0Sstevel@tonic-gate  *	the Card Services stubs module
142*0Sstevel@tonic-gate  */
143*0Sstevel@tonic-gate typedef struct cs_register_cardservices_t {
144*0Sstevel@tonic-gate 	uint32_t	function;
145*0Sstevel@tonic-gate 	uint32_t	magic;
146*0Sstevel@tonic-gate 	csfunction_t	*cardservices;
147*0Sstevel@tonic-gate 	csfunction_t	*socketservices;
148*0Sstevel@tonic-gate } cs_register_cardservices_t;
149*0Sstevel@tonic-gate 
150*0Sstevel@tonic-gate /*
151*0Sstevel@tonic-gate  * Functions for cs_register_cardservices_t
152*0Sstevel@tonic-gate  */
153*0Sstevel@tonic-gate #define	CS_ENTRY_REGISTER	0x0001
154*0Sstevel@tonic-gate #define	CS_ENTRY_DEREGISTER	0x0002
155*0Sstevel@tonic-gate #define	CS_ENTRY_INQUIRE	0x0003
156*0Sstevel@tonic-gate 
157*0Sstevel@tonic-gate /*
158*0Sstevel@tonic-gate  * Function prototypes
159*0Sstevel@tonic-gate  */
160*0Sstevel@tonic-gate int32_t csx_register_cardservices(cs_register_cardservices_t *);
161*0Sstevel@tonic-gate 
162*0Sstevel@tonic-gate #ifdef	__cplusplus
163*0Sstevel@tonic-gate }
164*0Sstevel@tonic-gate #endif
165*0Sstevel@tonic-gate 
166*0Sstevel@tonic-gate #endif	/* _CS_STUBS_H */
167