xref: /titanic_52/usr/src/uts/common/sys/sservice.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef	_SSERVICE_H
28*7c478bd9Sstevel@tonic-gate #define	_SSERVICE_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
33*7c478bd9Sstevel@tonic-gate extern "C" {
34*7c478bd9Sstevel@tonic-gate #endif
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate typedef int(f_tt)(int, ...);	/* for lint - cc -v quieting */
37*7c478bd9Sstevel@tonic-gate 
38*7c478bd9Sstevel@tonic-gate /*
39*7c478bd9Sstevel@tonic-gate  * identifiers for all SS functions implemented
40*7c478bd9Sstevel@tonic-gate  */
41*7c478bd9Sstevel@tonic-gate #define	SS_GetAdapter		0
42*7c478bd9Sstevel@tonic-gate #define	SS_GetPage		1
43*7c478bd9Sstevel@tonic-gate #define	SS_GetSocket		2
44*7c478bd9Sstevel@tonic-gate #define	SS_GetStatus		3
45*7c478bd9Sstevel@tonic-gate #define	SS_GetWindow		4
46*7c478bd9Sstevel@tonic-gate #define	SS_InquireAdapter	5
47*7c478bd9Sstevel@tonic-gate #define	SS_InquireSocket	6
48*7c478bd9Sstevel@tonic-gate #define	SS_InquireWindow	7
49*7c478bd9Sstevel@tonic-gate #define	SS_ResetSocket		8
50*7c478bd9Sstevel@tonic-gate #define	SS_SetPage		9
51*7c478bd9Sstevel@tonic-gate #define	SS_SetAdapter		10
52*7c478bd9Sstevel@tonic-gate #define	SS_SetSocket		11
53*7c478bd9Sstevel@tonic-gate #define	SS_SetWindow		12
54*7c478bd9Sstevel@tonic-gate #define	SS_SetIRQHandler	13
55*7c478bd9Sstevel@tonic-gate #define	SS_ClearIRQHandler	14
56*7c478bd9Sstevel@tonic-gate #define	CSGetActiveDip		98
57*7c478bd9Sstevel@tonic-gate #define	CSInitDev		99
58*7c478bd9Sstevel@tonic-gate #define	CSRegister		100
59*7c478bd9Sstevel@tonic-gate #define	CSCISInit		101
60*7c478bd9Sstevel@tonic-gate #define	CSUnregister		102
61*7c478bd9Sstevel@tonic-gate 
62*7c478bd9Sstevel@tonic-gate /*
63*7c478bd9Sstevel@tonic-gate  * XXX
64*7c478bd9Sstevel@tonic-gate  */
65*7c478bd9Sstevel@tonic-gate #define	CISGetAddress		103
66*7c478bd9Sstevel@tonic-gate #define	CISSetAddress		104
67*7c478bd9Sstevel@tonic-gate #define	CSCardRemoved		105
68*7c478bd9Sstevel@tonic-gate #define	CSGetCookiesAndDip	106
69*7c478bd9Sstevel@tonic-gate 
70*7c478bd9Sstevel@tonic-gate /*
71*7c478bd9Sstevel@tonic-gate  * returns a la Socket Services
72*7c478bd9Sstevel@tonic-gate  */
73*7c478bd9Sstevel@tonic-gate 
74*7c478bd9Sstevel@tonic-gate #define	SUCCESS		0x00
75*7c478bd9Sstevel@tonic-gate #define	BAD_ADAPTER		0x01
76*7c478bd9Sstevel@tonic-gate #define	BAD_ATTRIBUTE	0x02
77*7c478bd9Sstevel@tonic-gate #define	BAD_BASE		0x03
78*7c478bd9Sstevel@tonic-gate #define	BAD_EDC		0x04
79*7c478bd9Sstevel@tonic-gate #define	BAD_IRQ		0x06
80*7c478bd9Sstevel@tonic-gate #define	BAD_OFFSET		0x07
81*7c478bd9Sstevel@tonic-gate #define	BAD_PAGE		0x08
82*7c478bd9Sstevel@tonic-gate #define	READ_FAILURE		0x09
83*7c478bd9Sstevel@tonic-gate #define	BAD_SIZE		0x0a
84*7c478bd9Sstevel@tonic-gate #define	BAD_SOCKET		0x0b
85*7c478bd9Sstevel@tonic-gate #define	BAD_TYPE		0x0d
86*7c478bd9Sstevel@tonic-gate #define	BAD_VCC		0x0e
87*7c478bd9Sstevel@tonic-gate #define	BAD_VPP		0x0f
88*7c478bd9Sstevel@tonic-gate #define	BAD_WINDOW		0x11
89*7c478bd9Sstevel@tonic-gate #define	WRITE_FAILURE	0x12
90*7c478bd9Sstevel@tonic-gate #define	NO_CARD		0x14
91*7c478bd9Sstevel@tonic-gate #define	BAD_FUNCTION		0x15
92*7c478bd9Sstevel@tonic-gate #define	BAD_MODE		0x16
93*7c478bd9Sstevel@tonic-gate #define	BAD_SPEED		0x17
94*7c478bd9Sstevel@tonic-gate #define	BUSY			0x18
95*7c478bd9Sstevel@tonic-gate #define	NO_RESOURCE		0x20
96*7c478bd9Sstevel@tonic-gate 
97*7c478bd9Sstevel@tonic-gate /* events for callback */
98*7c478bd9Sstevel@tonic-gate 				/* card related events */
99*7c478bd9Sstevel@tonic-gate #define	PCE_CARD_REMOVAL	0 /* card removed */
100*7c478bd9Sstevel@tonic-gate #define	PCE_CARD_INSERT		1 /* card inserted */
101*7c478bd9Sstevel@tonic-gate #define	PCE_CARD_READY		2 /* ready state changed */
102*7c478bd9Sstevel@tonic-gate #define	PCE_CARD_BATTERY_WARN	3 /* battery is getting low */
103*7c478bd9Sstevel@tonic-gate #define	PCE_CARD_BATTERY_DEAD	4 /* battery is dead */
104*7c478bd9Sstevel@tonic-gate #define	PCE_CARD_STATUS_CHANGE	5 /* card status change for I/O card */
105*7c478bd9Sstevel@tonic-gate #define	PCE_CARD_WRITE_PROTECT	6 /* card write protect status change */
106*7c478bd9Sstevel@tonic-gate #define	PCE_CARD_RESET		7 /* client requested reset complete */
107*7c478bd9Sstevel@tonic-gate #define	PCE_CARD_UNLOCK		8 /* lock has been unlocked (opt) */
108*7c478bd9Sstevel@tonic-gate #define	PCE_CLIENT_INFO		9 /* someone wants client information */
109*7c478bd9Sstevel@tonic-gate #define	PCE_EJECTION_COMPLETE	10 /* Motor has finished ejecting card */
110*7c478bd9Sstevel@tonic-gate #define	PCE_EJECTION_REQUEST	11 /* request to eject card */
111*7c478bd9Sstevel@tonic-gate #define	PCE_ERASE_COMPLETE	12 /* a Flash Erase request completed */
112*7c478bd9Sstevel@tonic-gate #define	PCE_EXCLUSIVE_COMPLETE	13
113*7c478bd9Sstevel@tonic-gate #define	PCE_EXCLUSIVE_REQUEST	14
114*7c478bd9Sstevel@tonic-gate #define	PCE_INSERTION_COMPLETE	15
115*7c478bd9Sstevel@tonic-gate #define	PCE_INSERTION_REQUEST	16
116*7c478bd9Sstevel@tonic-gate #define	PCE_REGISTRATION_COMPLETE	17
117*7c478bd9Sstevel@tonic-gate #define	PCE_RESET_COMPLETE	18
118*7c478bd9Sstevel@tonic-gate #define	PCE_RESET_PHYSICAL	19
119*7c478bd9Sstevel@tonic-gate #define	PCE_RESET_REQUEST	20
120*7c478bd9Sstevel@tonic-gate #define	PCE_TIMER_EXPIRED	21
121*7c478bd9Sstevel@tonic-gate 
122*7c478bd9Sstevel@tonic-gate /* added for SPARC CPR support */
123*7c478bd9Sstevel@tonic-gate #define	PCE_PM_RESUME		22
124*7c478bd9Sstevel@tonic-gate #define	PCE_PM_SUSPEND		23
125*7c478bd9Sstevel@tonic-gate 
126*7c478bd9Sstevel@tonic-gate /* added for dynamic nexus registration */
127*7c478bd9Sstevel@tonic-gate #define	PCE_SS_INIT_STATE	24 /* SS init state */
128*7c478bd9Sstevel@tonic-gate #define	PCE_ADD_SOCKET		25 /* add a new socket */
129*7c478bd9Sstevel@tonic-gate #define	PCE_DROP_SOCKET		26 /* drop an existing socket */
130*7c478bd9Sstevel@tonic-gate 
131*7c478bd9Sstevel@tonic-gate #define	PCE_DEV_IDENT		30 /* The nexus has identified the device */
132*7c478bd9Sstevel@tonic-gate #define	PCE_INIT_DEV		31 /* asking for a device */
133*7c478bd9Sstevel@tonic-gate 
134*7c478bd9Sstevel@tonic-gate #define	PCE_E2M(event)		(1 << (event))
135*7c478bd9Sstevel@tonic-gate 
136*7c478bd9Sstevel@tonic-gate /* event callback uses an indirect call -- make it look like a function */
137*7c478bd9Sstevel@tonic-gate #define	CS_EVENT(event, socket, arg)	(*pcmcia_cs_event) (event, socket, arg)
138*7c478bd9Sstevel@tonic-gate 
139*7c478bd9Sstevel@tonic-gate /* values for "socket number" field for PCE_SS_INIT_STATE event */
140*7c478bd9Sstevel@tonic-gate #define	PCE_SS_STATE_INIT	0x0001  /* SS ready for callbacks */
141*7c478bd9Sstevel@tonic-gate #define	PCE_SS_STATE_DEINIT	0x0002  /* SS not ready for callbacks */
142*7c478bd9Sstevel@tonic-gate 
143*7c478bd9Sstevel@tonic-gate /*
144*7c478bd9Sstevel@tonic-gate  * The following structure is to support CSRegister
145*7c478bd9Sstevel@tonic-gate  */
146*7c478bd9Sstevel@tonic-gate typedef struct csregister {
147*7c478bd9Sstevel@tonic-gate 	uint32_t	cs_magic;		/* magic number */
148*7c478bd9Sstevel@tonic-gate 	uint32_t		cs_version;		/* CS version number */
149*7c478bd9Sstevel@tonic-gate 						/* CS entry point */
150*7c478bd9Sstevel@tonic-gate 	int		(*cs_card_services)(int, ...);
151*7c478bd9Sstevel@tonic-gate 						/* CS event entry point */
152*7c478bd9Sstevel@tonic-gate 	f_tt		*cs_event;
153*7c478bd9Sstevel@tonic-gate } csregister_t;
154*7c478bd9Sstevel@tonic-gate 
155*7c478bd9Sstevel@tonic-gate /* GetAdapter(get_adapter_t) */
156*7c478bd9Sstevel@tonic-gate 
157*7c478bd9Sstevel@tonic-gate typedef struct get_adapter {
158*7c478bd9Sstevel@tonic-gate 	unsigned	state;		/* adapter hardware state */
159*7c478bd9Sstevel@tonic-gate 	irq_t		SCRouting;	/* status change IRQ routing */
160*7c478bd9Sstevel@tonic-gate } get_adapter_t;
161*7c478bd9Sstevel@tonic-gate 
162*7c478bd9Sstevel@tonic-gate /* IRQ definitions */
163*7c478bd9Sstevel@tonic-gate #define	IRQ_ENABLE	0x8000
164*7c478bd9Sstevel@tonic-gate 
165*7c478bd9Sstevel@tonic-gate /* GetPage(get_page_t) */
166*7c478bd9Sstevel@tonic-gate 
167*7c478bd9Sstevel@tonic-gate typedef struct get_page {
168*7c478bd9Sstevel@tonic-gate 	unsigned	window;		/* window number */
169*7c478bd9Sstevel@tonic-gate 	unsigned	page;		/* page number within window */
170*7c478bd9Sstevel@tonic-gate 	unsigned	state;		/* page state: */
171*7c478bd9Sstevel@tonic-gate 					/*
172*7c478bd9Sstevel@tonic-gate 					 * PS_ATTRIBUTE
173*7c478bd9Sstevel@tonic-gate 					 * PS_COMMON
174*7c478bd9Sstevel@tonic-gate 					 * PS_IO (for DoRight?)
175*7c478bd9Sstevel@tonic-gate 					 * PS_ENABLED
176*7c478bd9Sstevel@tonic-gate 					 * PS_WP
177*7c478bd9Sstevel@tonic-gate 					 */
178*7c478bd9Sstevel@tonic-gate 	off_t		offset;		/* PC card's memory offset */
179*7c478bd9Sstevel@tonic-gate } get_page_t;
180*7c478bd9Sstevel@tonic-gate 
181*7c478bd9Sstevel@tonic-gate /*
182*7c478bd9Sstevel@tonic-gate  * PS flags
183*7c478bd9Sstevel@tonic-gate  */
184*7c478bd9Sstevel@tonic-gate 
185*7c478bd9Sstevel@tonic-gate #define	PS_ATTRIBUTE	0x01
186*7c478bd9Sstevel@tonic-gate #define	PS_ENABLED	0x02
187*7c478bd9Sstevel@tonic-gate #define	PS_WP		0x04
188*7c478bd9Sstevel@tonic-gate #define	PS_IO		0x08	/* needed? for DoRight */
189*7c478bd9Sstevel@tonic-gate 
190*7c478bd9Sstevel@tonic-gate /* GetSocket(get_socket_t) */
191*7c478bd9Sstevel@tonic-gate 
192*7c478bd9Sstevel@tonic-gate typedef struct get_socket {
193*7c478bd9Sstevel@tonic-gate 	unsigned	socket;		/* socket number */
194*7c478bd9Sstevel@tonic-gate 	unsigned	SCIntMask;	/* status change interrupt mask */
195*7c478bd9Sstevel@tonic-gate 	unsigned	VccLevel;	/* VCC voltage in 1/10 volt */
196*7c478bd9Sstevel@tonic-gate 	unsigned	Vpp1Level;	/* VPP1 voltage in 1/10 volt */
197*7c478bd9Sstevel@tonic-gate 	unsigned	Vpp2Level;	/* VPP2 voltage in 1/10 volt */
198*7c478bd9Sstevel@tonic-gate 	unsigned	state;		/* latched status change signals */
199*7c478bd9Sstevel@tonic-gate 	unsigned	CtlInd;		/* controls and indicators */
200*7c478bd9Sstevel@tonic-gate 	irq_t		IRQRouting;	/* I/O IRQ routing */
201*7c478bd9Sstevel@tonic-gate 	unsigned	IFType;		/* memory-only or memory & I/O */
202*7c478bd9Sstevel@tonic-gate } get_socket_t;
203*7c478bd9Sstevel@tonic-gate 
204*7c478bd9Sstevel@tonic-gate /* GetStatus(get_ss_status_t) */
205*7c478bd9Sstevel@tonic-gate 
206*7c478bd9Sstevel@tonic-gate typedef struct get_ss_status {
207*7c478bd9Sstevel@tonic-gate 	unsigned	socket;		/* socket number */
208*7c478bd9Sstevel@tonic-gate 	unsigned	CardState;	/* real-time card state */
209*7c478bd9Sstevel@tonic-gate 	unsigned	SocketState;	/* latched status change signals */
210*7c478bd9Sstevel@tonic-gate 	unsigned	CtlInd;		/* controls and indicators */
211*7c478bd9Sstevel@tonic-gate 	irq_t		IRQRouting;	/* I/O IRQ routing */
212*7c478bd9Sstevel@tonic-gate 	unsigned	IFType;		/* memory-only or memory & I/O */
213*7c478bd9Sstevel@tonic-gate } get_ss_status_t;
214*7c478bd9Sstevel@tonic-gate 
215*7c478bd9Sstevel@tonic-gate /*
216*7c478bd9Sstevel@tonic-gate  * Socket specific flags and capabilities
217*7c478bd9Sstevel@tonic-gate  */
218*7c478bd9Sstevel@tonic-gate 
219*7c478bd9Sstevel@tonic-gate #define	SBM_WP		0x01
220*7c478bd9Sstevel@tonic-gate #define	SBM_LOCKED	0x02
221*7c478bd9Sstevel@tonic-gate #define	SBM_EJECT	0x04
222*7c478bd9Sstevel@tonic-gate #define	SBM_INSERT	0x08
223*7c478bd9Sstevel@tonic-gate #define	SBM_BVD1	0x10
224*7c478bd9Sstevel@tonic-gate #define	SBM_BVD2	0x20
225*7c478bd9Sstevel@tonic-gate #define	SBM_RDYBSY	0x40
226*7c478bd9Sstevel@tonic-gate #define	SBM_CD		0x80
227*7c478bd9Sstevel@tonic-gate 
228*7c478bd9Sstevel@tonic-gate 				/* capabilities only */
229*7c478bd9Sstevel@tonic-gate #define	SBM_LOCK	0x10
230*7c478bd9Sstevel@tonic-gate #define	SBM_BATT	0x20
231*7c478bd9Sstevel@tonic-gate #define	SBM_BUSY	0x40
232*7c478bd9Sstevel@tonic-gate #define	SBM_XID		0x80
233*7c478bd9Sstevel@tonic-gate 
234*7c478bd9Sstevel@tonic-gate /* GetWindow(get_window_t) */
235*7c478bd9Sstevel@tonic-gate typedef uint32_t speed_t;	/* memory speed in nanoseconds */
236*7c478bd9Sstevel@tonic-gate 
237*7c478bd9Sstevel@tonic-gate typedef struct get_window {
238*7c478bd9Sstevel@tonic-gate 	unsigned		window;	/* window number */
239*7c478bd9Sstevel@tonic-gate 	unsigned		socket;	/* socket this window is assigned to */
240*7c478bd9Sstevel@tonic-gate 	unsigned		size;	/* size in bytes */
241*7c478bd9Sstevel@tonic-gate 	unsigned		state;	/* current state of window hardware */
242*7c478bd9Sstevel@tonic-gate 	uint_t			speed;	/* speed in nanoseconds */
243*7c478bd9Sstevel@tonic-gate 	uint_t			base;
244*7c478bd9Sstevel@tonic-gate 	ddi_acc_handle_t	handle;		/* base addr in host space */
245*7c478bd9Sstevel@tonic-gate } get_window_t;
246*7c478bd9Sstevel@tonic-gate 
247*7c478bd9Sstevel@tonic-gate /*
248*7c478bd9Sstevel@tonic-gate  * window flags (state and capabilities)
249*7c478bd9Sstevel@tonic-gate  */
250*7c478bd9Sstevel@tonic-gate #define	WS_IO		0x01
251*7c478bd9Sstevel@tonic-gate #define	WS_ENABLED	0x02
252*7c478bd9Sstevel@tonic-gate #define	WS_16BIT	0x04
253*7c478bd9Sstevel@tonic-gate #define	WS_PAGED	0x80
254*7c478bd9Sstevel@tonic-gate #define	WS_EISA		0x10
255*7c478bd9Sstevel@tonic-gate #define	WS_CENABLE	0x20
256*7c478bd9Sstevel@tonic-gate #define	WS_EXACT_MAPIN	0x40	/* map exactly what's asked for */
257*7c478bd9Sstevel@tonic-gate 
258*7c478bd9Sstevel@tonic-gate /* Inquire Adapter(inquire_adapter_t) */
259*7c478bd9Sstevel@tonic-gate 
260*7c478bd9Sstevel@tonic-gate typedef struct inquire_adapter {
261*7c478bd9Sstevel@tonic-gate 	unsigned	NumSockets;	/* number of sockets */
262*7c478bd9Sstevel@tonic-gate 	unsigned	NumWindows;	/* number of windows */
263*7c478bd9Sstevel@tonic-gate 	unsigned	NumEDCs;	/* number of EDCs */
264*7c478bd9Sstevel@tonic-gate 
265*7c478bd9Sstevel@tonic-gate 	unsigned	AdpCaps;	/* adapter power capabilities */
266*7c478bd9Sstevel@tonic-gate 	irq_t		ActiveHigh;	/* active high status change IRQ */
267*7c478bd9Sstevel@tonic-gate 	irq_t		ActiveLow;	/* active low status change IRQ */
268*7c478bd9Sstevel@tonic-gate 	int		NumPower;	/* number of power entries */
269*7c478bd9Sstevel@tonic-gate 	struct power_entry {
270*7c478bd9Sstevel@tonic-gate 		unsigned	PowerLevel;	/* voltage in 1/10 volt */
271*7c478bd9Sstevel@tonic-gate 		unsigned	ValidSignals;	/* voltage is valid for: */
272*7c478bd9Sstevel@tonic-gate 						/*
273*7c478bd9Sstevel@tonic-gate 						 * VCC
274*7c478bd9Sstevel@tonic-gate 						 * VPP1
275*7c478bd9Sstevel@tonic-gate 						 * VPP2
276*7c478bd9Sstevel@tonic-gate 						 * if none are set, this is end
277*7c478bd9Sstevel@tonic-gate 						 * of list
278*7c478bd9Sstevel@tonic-gate 						 */
279*7c478bd9Sstevel@tonic-gate 	} *power_entry;
280*7c478bd9Sstevel@tonic-gate 	int		NumInterrupts; /* number of interrupts supportable */
281*7c478bd9Sstevel@tonic-gate 	struct intr_entry {
282*7c478bd9Sstevel@tonic-gate 		int	pri;
283*7c478bd9Sstevel@tonic-gate 		int	intr;
284*7c478bd9Sstevel@tonic-gate 	}		*AvailInterrupts; /* array of intrs, one per intr */
285*7c478bd9Sstevel@tonic-gate 	uint_t		ResourceFlags; /* resource allocation requirements */
286*7c478bd9Sstevel@tonic-gate } inquire_adapter_t;
287*7c478bd9Sstevel@tonic-gate 
288*7c478bd9Sstevel@tonic-gate #define	VCC	0x80
289*7c478bd9Sstevel@tonic-gate #define	VPP1	0x40
290*7c478bd9Sstevel@tonic-gate #define	VPP2	0x20
291*7c478bd9Sstevel@tonic-gate #define	V_MASK	(VCC|VPP1|VPP2)
292*7c478bd9Sstevel@tonic-gate 
293*7c478bd9Sstevel@tonic-gate #define	RES_OWN_IRQ	0x0001	/* adapter owns own IRQ resources */
294*7c478bd9Sstevel@tonic-gate #define	RES_OWN_IO	0x0002	/* adapter owns own I/O resources */
295*7c478bd9Sstevel@tonic-gate #define	RES_OWN_MEM	0x0004	/* adapter owns own memory resources */
296*7c478bd9Sstevel@tonic-gate #define	RES_IRQ_NEXUS	0x0008	/* adapter/nexus must multiplex IRQs */
297*7c478bd9Sstevel@tonic-gate #define	RES_IRQ_SHAREABLE	0x0010 /* IRQ can be shared */
298*7c478bd9Sstevel@tonic-gate 
299*7c478bd9Sstevel@tonic-gate /* InquireSocket(inquire_socket_t) */
300*7c478bd9Sstevel@tonic-gate 
301*7c478bd9Sstevel@tonic-gate typedef struct inquire_socket {
302*7c478bd9Sstevel@tonic-gate 	unsigned	socket;		/* socket number */
303*7c478bd9Sstevel@tonic-gate 	unsigned	SCIntCaps;	/* status change interrupt events */
304*7c478bd9Sstevel@tonic-gate 	unsigned	SCRptCaps;	/* reportable status change events */
305*7c478bd9Sstevel@tonic-gate 	unsigned	CtlIndCaps;	/* controls and indicators */
306*7c478bd9Sstevel@tonic-gate 	unsigned	SocketCaps;	/* socket capabilities */
307*7c478bd9Sstevel@tonic-gate 	irq_t		ActiveHigh;	/* active high status change IRQ */
308*7c478bd9Sstevel@tonic-gate 	irq_t		ActiveLow;	/* active low status change IRQ */
309*7c478bd9Sstevel@tonic-gate } inquire_socket_t;
310*7c478bd9Sstevel@tonic-gate 
311*7c478bd9Sstevel@tonic-gate /* InquireWindow(inquire_window_t) */
312*7c478bd9Sstevel@tonic-gate 
313*7c478bd9Sstevel@tonic-gate typedef struct memwin_char {
314*7c478bd9Sstevel@tonic-gate 	unsigned	MemWndCaps;	/* memory window characteristcs */
315*7c478bd9Sstevel@tonic-gate 	baseaddr_t	FirstByte;	/* first byte in host space */
316*7c478bd9Sstevel@tonic-gate 	baseaddr_t	LastByte;	/* last byte in host space */
317*7c478bd9Sstevel@tonic-gate 	unsigned	MinSize;	/* minimum window size */
318*7c478bd9Sstevel@tonic-gate 	unsigned	MaxSize;	/* maximum window size */
319*7c478bd9Sstevel@tonic-gate 	unsigned	ReqGran;	/* window size constraints */
320*7c478bd9Sstevel@tonic-gate 	unsigned	ReqBase;	/* base address alignment boundry */
321*7c478bd9Sstevel@tonic-gate 	unsigned	ReqOffset;	/* offset alignment boundry */
322*7c478bd9Sstevel@tonic-gate 	unsigned	Slowest;	/* slowest speed in nanoseconds */
323*7c478bd9Sstevel@tonic-gate 	unsigned	Fastest;	/* fastest speed in nanoseconds */
324*7c478bd9Sstevel@tonic-gate } mem_win_char_t;
325*7c478bd9Sstevel@tonic-gate 
326*7c478bd9Sstevel@tonic-gate typedef struct iowin_char {
327*7c478bd9Sstevel@tonic-gate 	unsigned	IOWndCaps;	/* I/O window characteristcs */
328*7c478bd9Sstevel@tonic-gate 	baseaddr_t	FirstByte;	/* first byte in host space */
329*7c478bd9Sstevel@tonic-gate 	baseaddr_t	LastByte;	/* last byte in host space */
330*7c478bd9Sstevel@tonic-gate 	unsigned	MinSize;	/* minimum window size */
331*7c478bd9Sstevel@tonic-gate 	unsigned	MaxSize;	/* maximum window size */
332*7c478bd9Sstevel@tonic-gate 	unsigned	ReqGran;	/* window size constraints */
333*7c478bd9Sstevel@tonic-gate 	unsigned	AddrLines;	/* number of address lines decoded */
334*7c478bd9Sstevel@tonic-gate 	unsigned	EISASlot;	/* EISA I/O address decoding */
335*7c478bd9Sstevel@tonic-gate } iowin_char_t;
336*7c478bd9Sstevel@tonic-gate 
337*7c478bd9Sstevel@tonic-gate typedef struct inquire_window {
338*7c478bd9Sstevel@tonic-gate 	unsigned	window;		/* window number */
339*7c478bd9Sstevel@tonic-gate 	unsigned	WndCaps;	/* window capabilities */
340*7c478bd9Sstevel@tonic-gate 	socket_enum_t	Sockets;	/* window<->socket assignment mask */
341*7c478bd9Sstevel@tonic-gate 	/* note that we always declare both forms */
342*7c478bd9Sstevel@tonic-gate 	mem_win_char_t	mem_win_char;
343*7c478bd9Sstevel@tonic-gate 	iowin_char_t	iowin_char;
344*7c478bd9Sstevel@tonic-gate } inquire_window_t;
345*7c478bd9Sstevel@tonic-gate 
346*7c478bd9Sstevel@tonic-gate 
347*7c478bd9Sstevel@tonic-gate /* interface definitions */
348*7c478bd9Sstevel@tonic-gate #define	IF_CARDBUS	0x00	/* CardBus interface */
349*7c478bd9Sstevel@tonic-gate #define	IF_IO		0x01	/* IO + memory */
350*7c478bd9Sstevel@tonic-gate #define	IF_MEMORY	0x02	/* memory only */
351*7c478bd9Sstevel@tonic-gate #define	IF_TYPE_MASK	0x03
352*7c478bd9Sstevel@tonic-gate 
353*7c478bd9Sstevel@tonic-gate #define	DREQ_MASK	0x0c
354*7c478bd9Sstevel@tonic-gate #define	DREQ_NONE	0x00
355*7c478bd9Sstevel@tonic-gate #define	DREQ_SPKR	0x04
356*7c478bd9Sstevel@tonic-gate #define	DREQ_IOIS16	0x08
357*7c478bd9Sstevel@tonic-gate #define	DREQ_INPACK	0x0c
358*7c478bd9Sstevel@tonic-gate 
359*7c478bd9Sstevel@tonic-gate #define	DMA_CHAN_MASK	0xf0
360*7c478bd9Sstevel@tonic-gate #define	DMA_GET_CHAN(x) (((x) >> 4) & 0xF)
361*7c478bd9Sstevel@tonic-gate #define	DMA_SET_CHAN(x, y) (((x) & 0xF) | ((y) & ~DMA_CHAN_MASK))
362*7c478bd9Sstevel@tonic-gate 
363*7c478bd9Sstevel@tonic-gate #define	IF_CB		0x04
364*7c478bd9Sstevel@tonic-gate #define	IF_DMA		0x08
365*7c478bd9Sstevel@tonic-gate #define	IF_VSKEY	0x10
366*7c478bd9Sstevel@tonic-gate #define	IF_33VC		0x20
367*7c478bd9Sstevel@tonic-gate #define	IF_XXVCC	0x40
368*7c478bd9Sstevel@tonic-gate 
369*7c478bd9Sstevel@tonic-gate 
370*7c478bd9Sstevel@tonic-gate #define	PC_PAGESIZE	0x4000	/* 16K page size */
371*7c478bd9Sstevel@tonic-gate 
372*7c478bd9Sstevel@tonic-gate /* window capabilities */
373*7c478bd9Sstevel@tonic-gate 				/* generic */
374*7c478bd9Sstevel@tonic-gate #define	WC_IO		0x0004
375*7c478bd9Sstevel@tonic-gate #define	WC_WAIT		0x0080
376*7c478bd9Sstevel@tonic-gate #define	WC_COMMON	0x0001
377*7c478bd9Sstevel@tonic-gate #define	WC_ATTRIBUTE	0x0002
378*7c478bd9Sstevel@tonic-gate 				/* I/O and memory */
379*7c478bd9Sstevel@tonic-gate #define	WC_BASE		0x0001
380*7c478bd9Sstevel@tonic-gate #define	WC_SIZE		0x0002
381*7c478bd9Sstevel@tonic-gate #define	WC_WENABLE	0x0004
382*7c478bd9Sstevel@tonic-gate #define	WC_8BIT		0x0008
383*7c478bd9Sstevel@tonic-gate #define	WC_16BIT	0x0010
384*7c478bd9Sstevel@tonic-gate #define	WC_BALIGN	0x0020
385*7c478bd9Sstevel@tonic-gate #define	WC_POW2		0x0040
386*7c478bd9Sstevel@tonic-gate 				/* memory only */
387*7c478bd9Sstevel@tonic-gate #define	WC_CALIGN	0x0080
388*7c478bd9Sstevel@tonic-gate #define	WC_PAVAIL	0x0100
389*7c478bd9Sstevel@tonic-gate #define	WC_PSHARED	0x0200
390*7c478bd9Sstevel@tonic-gate #define	WC_PENABLE	0x0400
391*7c478bd9Sstevel@tonic-gate #define	WC_WP		0x0800
392*7c478bd9Sstevel@tonic-gate 				/* I/O only */
393*7c478bd9Sstevel@tonic-gate #define	WC_INPACK	0x0080
394*7c478bd9Sstevel@tonic-gate #define	WC_EISA		0x0100
395*7c478bd9Sstevel@tonic-gate #define	WC_CENABLE	0x0200
396*7c478bd9Sstevel@tonic-gate 				/* Solaris/SPARC */
397*7c478bd9Sstevel@tonic-gate #define	WC_IO_RANGE_PER_WINDOW	0x8000 /* I/O range unique for each window */
398*7c478bd9Sstevel@tonic-gate 
399*7c478bd9Sstevel@tonic-gate /* SetPage(set_page_t *) */
400*7c478bd9Sstevel@tonic-gate typedef struct set_page {
401*7c478bd9Sstevel@tonic-gate 	unsigned	window;	/* window number */
402*7c478bd9Sstevel@tonic-gate 	unsigned	page;	/* page number */
403*7c478bd9Sstevel@tonic-gate 	unsigned	state;	/* page state */
404*7c478bd9Sstevel@tonic-gate 	off_t		offset;	/* offset in PC card space */
405*7c478bd9Sstevel@tonic-gate } set_page_t;
406*7c478bd9Sstevel@tonic-gate 
407*7c478bd9Sstevel@tonic-gate /* SetSocket(set_socket_t) */
408*7c478bd9Sstevel@tonic-gate 
409*7c478bd9Sstevel@tonic-gate typedef struct set_socket {
410*7c478bd9Sstevel@tonic-gate 	unsigned	socket;	/* socket number */
411*7c478bd9Sstevel@tonic-gate 	unsigned	SCIntMask; /* status change enables */
412*7c478bd9Sstevel@tonic-gate 	unsigned	Vcontrol; /* power control flags */
413*7c478bd9Sstevel@tonic-gate 	unsigned	VccLevel; /* Vcc power index level */
414*7c478bd9Sstevel@tonic-gate 	unsigned	Vpp1Level; /* Vpp1 power index level */
415*7c478bd9Sstevel@tonic-gate 	unsigned	Vpp2Level; /* Vpp2 power index level */
416*7c478bd9Sstevel@tonic-gate 	unsigned	State;
417*7c478bd9Sstevel@tonic-gate 	unsigned	CtlInd;	/* control and indicator bits */
418*7c478bd9Sstevel@tonic-gate 	irq_t		IREQRouting; /* I/O IRQ routing */
419*7c478bd9Sstevel@tonic-gate 	unsigned	IFType;	/* interface type (mem/IO) */
420*7c478bd9Sstevel@tonic-gate } set_socket_t;
421*7c478bd9Sstevel@tonic-gate 
422*7c478bd9Sstevel@tonic-gate #define	VCTL_CISREAD	0x01	/* controlled by Vcc/Vpp sense pins */
423*7c478bd9Sstevel@tonic-gate #define	VCTL_OVERRIDE	0x02	/* 16-bit cards, ignore the sense pins */
424*7c478bd9Sstevel@tonic-gate 
425*7c478bd9Sstevel@tonic-gate /* SetIRQHandler(set_irq_handler_t) */
426*7c478bd9Sstevel@tonic-gate 
427*7c478bd9Sstevel@tonic-gate typedef struct set_irq_handler {
428*7c478bd9Sstevel@tonic-gate 	unsigned	socket;	/* associate with a socket for now */
429*7c478bd9Sstevel@tonic-gate 	unsigned	irq;
430*7c478bd9Sstevel@tonic-gate 	unsigned	handler_id;	/* ID of this client's handler */
431*7c478bd9Sstevel@tonic-gate 	f_tt		*handler;	/* client IO IRQ handler entry point */
432*7c478bd9Sstevel@tonic-gate 	void		*arg1;		/* arg to call client handler with */
433*7c478bd9Sstevel@tonic-gate 	void		*arg2;		/* arg to call client handler with */
434*7c478bd9Sstevel@tonic-gate 	ddi_iblock_cookie_t	*iblk_cookie;	/* iblk cookie pointer */
435*7c478bd9Sstevel@tonic-gate 	ddi_idevice_cookie_t	*idev_cookie;	/* idev cookie pointer */
436*7c478bd9Sstevel@tonic-gate } set_irq_handler_t;
437*7c478bd9Sstevel@tonic-gate 
438*7c478bd9Sstevel@tonic-gate #define	IRQ_ANY		0x0
439*7c478bd9Sstevel@tonic-gate 
440*7c478bd9Sstevel@tonic-gate /* interrupt priority levels */
441*7c478bd9Sstevel@tonic-gate #define	PRIORITY_LOW	0x00
442*7c478bd9Sstevel@tonic-gate #define	PRIORITY_HIGH	0x10
443*7c478bd9Sstevel@tonic-gate 
444*7c478bd9Sstevel@tonic-gate /* ClearIRQHandler(clear_irq_handler_t) */
445*7c478bd9Sstevel@tonic-gate 
446*7c478bd9Sstevel@tonic-gate typedef struct clear_irq_handler {
447*7c478bd9Sstevel@tonic-gate 	unsigned	socket;
448*7c478bd9Sstevel@tonic-gate 	unsigned	handler_id;	/* client handler ID to remove */
449*7c478bd9Sstevel@tonic-gate 	f_tt		*handler;	/* client IO IRQ handler entry point */
450*7c478bd9Sstevel@tonic-gate } clear_irq_handler_t;
451*7c478bd9Sstevel@tonic-gate 
452*7c478bd9Sstevel@tonic-gate /* SetWindow(set_window_t) */
453*7c478bd9Sstevel@tonic-gate 
454*7c478bd9Sstevel@tonic-gate typedef struct set_window {
455*7c478bd9Sstevel@tonic-gate 	unsigned		window;		/* window number */
456*7c478bd9Sstevel@tonic-gate 	unsigned		socket;		/* socket number */
457*7c478bd9Sstevel@tonic-gate 	unsigned		WindowSize;	/* window size in bytes */
458*7c478bd9Sstevel@tonic-gate 	unsigned		state;		/* window state */
459*7c478bd9Sstevel@tonic-gate 	unsigned		speed;		/* window speed, nanoseconds */
460*7c478bd9Sstevel@tonic-gate 	uint_t			base;
461*7c478bd9Sstevel@tonic-gate 	ddi_acc_handle_t	handle;		/* base addr in host space */
462*7c478bd9Sstevel@tonic-gate 	dev_info_t		*child;		/* child's dip */
463*7c478bd9Sstevel@tonic-gate 	ddi_device_acc_attr_t	attr;
464*7c478bd9Sstevel@tonic-gate } set_window_t;
465*7c478bd9Sstevel@tonic-gate 
466*7c478bd9Sstevel@tonic-gate /* CSInitDev */
467*7c478bd9Sstevel@tonic-gate typedef
468*7c478bd9Sstevel@tonic-gate struct ss_make_device_node {
469*7c478bd9Sstevel@tonic-gate 	uint32_t		flags;		/* operation flags */
470*7c478bd9Sstevel@tonic-gate 	dev_info_t	*dip;		/* dip for this client */
471*7c478bd9Sstevel@tonic-gate 	char		*name;		/* device node path and name */
472*7c478bd9Sstevel@tonic-gate 	char		*slot;		/* slot name string */
473*7c478bd9Sstevel@tonic-gate 	char		*busaddr;	/* bus addr name string */
474*7c478bd9Sstevel@tonic-gate 	int		spec_type;	/* dev special type (block/char) */
475*7c478bd9Sstevel@tonic-gate 	int		minor_num;	/* device node minor number */
476*7c478bd9Sstevel@tonic-gate 	char		*node_type;	/* device node type */
477*7c478bd9Sstevel@tonic-gate } ss_make_device_node_t;
478*7c478bd9Sstevel@tonic-gate 
479*7c478bd9Sstevel@tonic-gate #define	SS_CSINITDEV_CREATE_DEVICE	0x01	/* create device node */
480*7c478bd9Sstevel@tonic-gate #define	SS_CSINITDEV_REMOVE_DEVICE	0x02	/* remove device node */
481*7c478bd9Sstevel@tonic-gate #define	SS_CSINITDEV_USE_SLOT		0x04	/* use slot name from caller */
482*7c478bd9Sstevel@tonic-gate #define	SS_CSINITDEV_USE_BUSADDR	0x08	/* use bus addr from caller */
483*7c478bd9Sstevel@tonic-gate #define	SS_CSINITDEV_MORE_DEVICES	0x10	/* send PCE_INIT_DEV */
484*7c478bd9Sstevel@tonic-gate #define	SS_CSINITDEV_SEND_DEV_EVENT	0x10	/* send PCE_INIT_DEV */
485*7c478bd9Sstevel@tonic-gate 
486*7c478bd9Sstevel@tonic-gate /*
487*7c478bd9Sstevel@tonic-gate  * csss_adapter_info_t - provides additional per-socket adapter info
488*7c478bd9Sstevel@tonic-gate  */
489*7c478bd9Sstevel@tonic-gate typedef struct csss_adapter_info_t {
490*7c478bd9Sstevel@tonic-gate 	char	name[MODMAXNAMELEN];	/* adapter name */
491*7c478bd9Sstevel@tonic-gate 	int	major;			/* adapter major number */
492*7c478bd9Sstevel@tonic-gate 	int	minor;			/* adapter minor number */
493*7c478bd9Sstevel@tonic-gate 	int	number;			/* canonical adapter number */
494*7c478bd9Sstevel@tonic-gate 	int	num_sockets;		/* # sockets on this adapter */
495*7c478bd9Sstevel@tonic-gate 	int	first_socket;		/* first socket # on this adapter */
496*7c478bd9Sstevel@tonic-gate } csss_adapter_info_t;
497*7c478bd9Sstevel@tonic-gate 
498*7c478bd9Sstevel@tonic-gate /* CSGetCookiesAndDip */
499*7c478bd9Sstevel@tonic-gate typedef struct get_cookies_and_dip_t {
500*7c478bd9Sstevel@tonic-gate 	unsigned		socket;		/* socket number */
501*7c478bd9Sstevel@tonic-gate 	dev_info_t		*dip;		/* adapter instance dip */
502*7c478bd9Sstevel@tonic-gate 	ddi_iblock_cookie_t	*iblock;	/* for event handler */
503*7c478bd9Sstevel@tonic-gate 	ddi_idevice_cookie_t	*idevice;	/* for event handler */
504*7c478bd9Sstevel@tonic-gate 	csss_adapter_info_t	adapter_info;	/* adapter info for socket */
505*7c478bd9Sstevel@tonic-gate } get_cookies_and_dip_t;
506*7c478bd9Sstevel@tonic-gate 
507*7c478bd9Sstevel@tonic-gate /* ResetSocket */
508*7c478bd9Sstevel@tonic-gate #define	RESET_MODE_FULL		0 /* Reset to SocketServices Specification */
509*7c478bd9Sstevel@tonic-gate #define	RESET_MODE_CARD_ONLY	1 /* only reset the card itself */
510*7c478bd9Sstevel@tonic-gate 
511*7c478bd9Sstevel@tonic-gate /* union of all exported functions functions */
512*7c478bd9Sstevel@tonic-gate typedef
513*7c478bd9Sstevel@tonic-gate union sservice {
514*7c478bd9Sstevel@tonic-gate 	get_adapter_t	get_adapter;
515*7c478bd9Sstevel@tonic-gate 	get_page_t	get_page;
516*7c478bd9Sstevel@tonic-gate 	get_socket_t	get_socket;
517*7c478bd9Sstevel@tonic-gate 	get_window_t	get_window;
518*7c478bd9Sstevel@tonic-gate 	get_ss_status_t	get_ss_status;
519*7c478bd9Sstevel@tonic-gate 	inquire_adapter_t	inquire_adapter;
520*7c478bd9Sstevel@tonic-gate 	inquire_socket_t	inquire_socket;
521*7c478bd9Sstevel@tonic-gate 	inquire_window_t	inquire_window;
522*7c478bd9Sstevel@tonic-gate 	set_page_t	set_page;
523*7c478bd9Sstevel@tonic-gate 	set_socket_t	set_socket;
524*7c478bd9Sstevel@tonic-gate 	set_irq_handler_t	set_irq_handler;
525*7c478bd9Sstevel@tonic-gate 	set_window_t	set_window;
526*7c478bd9Sstevel@tonic-gate 	get_cookies_and_dip_t get_cookies;
527*7c478bd9Sstevel@tonic-gate 	ss_make_device_node_t make_device;
528*7c478bd9Sstevel@tonic-gate } sservice_t;
529*7c478bd9Sstevel@tonic-gate 
530*7c478bd9Sstevel@tonic-gate /* event manager structures */
531*7c478bd9Sstevel@tonic-gate struct pcm_make_dev {
532*7c478bd9Sstevel@tonic-gate 	int	socket;
533*7c478bd9Sstevel@tonic-gate 	int	flags;
534*7c478bd9Sstevel@tonic-gate 	int	op;
535*7c478bd9Sstevel@tonic-gate 	dev_t	dev;
536*7c478bd9Sstevel@tonic-gate 	int	type;
537*7c478bd9Sstevel@tonic-gate 	char	driver[MODMAXNAMELEN];
538*7c478bd9Sstevel@tonic-gate 	char	path[MAXPATHLEN];
539*7c478bd9Sstevel@tonic-gate };
540*7c478bd9Sstevel@tonic-gate 
541*7c478bd9Sstevel@tonic-gate #define	PCM_EVENT_MORE		0x0001	/* more events of this type coming */
542*7c478bd9Sstevel@tonic-gate 
543*7c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
544*7c478bd9Sstevel@tonic-gate 
545*7c478bd9Sstevel@tonic-gate #include <sys/sunndi.h>
546*7c478bd9Sstevel@tonic-gate 
547*7c478bd9Sstevel@tonic-gate /*
548*7c478bd9Sstevel@tonic-gate  * prototypes for nexi
549*7c478bd9Sstevel@tonic-gate  */
550*7c478bd9Sstevel@tonic-gate 
551*7c478bd9Sstevel@tonic-gate int pcmcia_attach(dev_info_t *, struct pcmcia_adapter_nexus_private *);
552*7c478bd9Sstevel@tonic-gate int pcmcia_ctlops(dev_info_t *, dev_info_t *, ddi_ctl_enum_t, void *, void *);
553*7c478bd9Sstevel@tonic-gate int pcmcia_prop_op(dev_t, dev_info_t *, dev_info_t *, ddi_prop_op_t,
554*7c478bd9Sstevel@tonic-gate 			int, char *, caddr_t, int *);
555*7c478bd9Sstevel@tonic-gate int pcmcia_intr_ops(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op,
556*7c478bd9Sstevel@tonic-gate     ddi_intr_handle_impl_t *hdlp, void *result);
557*7c478bd9Sstevel@tonic-gate 
558*7c478bd9Sstevel@tonic-gate int pcmcia_open(dev_t *, int, int, cred_t *);
559*7c478bd9Sstevel@tonic-gate int pcmcia_close(dev_t, int, int, cred_t *);
560*7c478bd9Sstevel@tonic-gate int pcmcia_ioctl(dev_t, int, intptr_t, int, cred_t *, int *);
561*7c478bd9Sstevel@tonic-gate int pcmcia_power(dev_info_t *, int, int);
562*7c478bd9Sstevel@tonic-gate void pcmcia_begin_resume(dev_info_t *);
563*7c478bd9Sstevel@tonic-gate void pcmcia_wait_insert(dev_info_t *);
564*7c478bd9Sstevel@tonic-gate 
565*7c478bd9Sstevel@tonic-gate 
566*7c478bd9Sstevel@tonic-gate /* resource allocation functions and structure */
567*7c478bd9Sstevel@tonic-gate typedef struct ra_return {
568*7c478bd9Sstevel@tonic-gate 	uint_t	ra_addr_hi;
569*7c478bd9Sstevel@tonic-gate 	uint_t	ra_addr_lo;
570*7c478bd9Sstevel@tonic-gate 	uint_t	ra_len;
571*7c478bd9Sstevel@tonic-gate } ra_return_t;
572*7c478bd9Sstevel@tonic-gate 
573*7c478bd9Sstevel@tonic-gate int pcmcia_alloc_mem(dev_info_t *, ndi_ra_request_t *, ra_return_t *);
574*7c478bd9Sstevel@tonic-gate int pcmcia_alloc_io(dev_info_t *, ndi_ra_request_t *, ra_return_t *);
575*7c478bd9Sstevel@tonic-gate int pcmcia_free_mem(dev_info_t *, ra_return_t *);
576*7c478bd9Sstevel@tonic-gate int pcmcia_free_io(dev_info_t *, ra_return_t *);
577*7c478bd9Sstevel@tonic-gate int pcmcia_map_reg(dev_info_t *, dev_info_t *, ra_return_t *,
578*7c478bd9Sstevel@tonic-gate 			uint32_t, caddr_t *, ddi_acc_handle_t *,
579*7c478bd9Sstevel@tonic-gate 			ddi_device_acc_attr_t *, uint32_t);
580*7c478bd9Sstevel@tonic-gate int pcmcia_bus_map(dev_info_t *, dev_info_t *, ddi_map_req_t *,
581*7c478bd9Sstevel@tonic-gate 	off_t, off_t, caddr_t *);
582*7c478bd9Sstevel@tonic-gate 
583*7c478bd9Sstevel@tonic-gate #endif /* _KERNEL */
584*7c478bd9Sstevel@tonic-gate 
585*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
586*7c478bd9Sstevel@tonic-gate }
587*7c478bd9Sstevel@tonic-gate #endif
588*7c478bd9Sstevel@tonic-gate 
589*7c478bd9Sstevel@tonic-gate #endif	/* _SSERVICE_H */
590