xref: /onnv-gate/usr/src/uts/common/sys/hotplug/hpctrl.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 2003 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef	_SYS_HOTPLUG_HPCTRL_H
28*0Sstevel@tonic-gate #define	_SYS_HOTPLUG_HPCTRL_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate /*
33*0Sstevel@tonic-gate  * ****************************************************************
34*0Sstevel@tonic-gate  * Hot Plug Controller interfaces for PCI and CompactPCI platforms.
35*0Sstevel@tonic-gate  * ****************************************************************
36*0Sstevel@tonic-gate  */
37*0Sstevel@tonic-gate #include <sys/types.h>
38*0Sstevel@tonic-gate 
39*0Sstevel@tonic-gate #ifdef	__cplusplus
40*0Sstevel@tonic-gate extern "C" {
41*0Sstevel@tonic-gate #endif
42*0Sstevel@tonic-gate 
43*0Sstevel@tonic-gate /*
44*0Sstevel@tonic-gate  * Type definition for slot handle. This is an opaque pointer
45*0Sstevel@tonic-gate  * created by the HPS framework.
46*0Sstevel@tonic-gate  */
47*0Sstevel@tonic-gate typedef void *hpc_slot_t;
48*0Sstevel@tonic-gate 
49*0Sstevel@tonic-gate #define	HPC_SLOT_OPS_VERSION	0
50*0Sstevel@tonic-gate 
51*0Sstevel@tonic-gate /*
52*0Sstevel@tonic-gate  * slot operations structure definition.
53*0Sstevel@tonic-gate  *
54*0Sstevel@tonic-gate  *	Function		Description
55*0Sstevel@tonic-gate  *	--------		-----------
56*0Sstevel@tonic-gate  *	xxx_op_connect		CONNECT the slot to the bus to enable
57*0Sstevel@tonic-gate  *				access to the adapter.
58*0Sstevel@tonic-gate  *	xxx_op_disconnect	DISCONNECT the slot from the bus. For PCI,
59*0Sstevel@tonic-gate  *				this disables the power to the slot.
60*0Sstevel@tonic-gate  *	xxx_op_insert		Prepare the slot for card insertion. This
61*0Sstevel@tonic-gate  *				may not be applicable for all bus types.
62*0Sstevel@tonic-gate  *	xxx_op_remove		Prepare the slot for card removal. This
63*0Sstevel@tonic-gate  *				may not be applicable for all bus types.
64*0Sstevel@tonic-gate  *	xxx_op_control		Perform misc. commands to control the
65*0Sstevel@tonic-gate  *				LEDs, get status information, etc.
66*0Sstevel@tonic-gate  */
67*0Sstevel@tonic-gate typedef struct hpc_slot_ops {
68*0Sstevel@tonic-gate 	int	hpc_version;			/* HPC_SLOT_OPS_VERSION */
69*0Sstevel@tonic-gate 	int	(*hpc_op_connect)(caddr_t ops_arg, hpc_slot_t slot_hdl,
70*0Sstevel@tonic-gate 			void *data, uint_t flags);
71*0Sstevel@tonic-gate 	int	(*hpc_op_disconnect)(caddr_t ops_arg, hpc_slot_t slot_hdl,
72*0Sstevel@tonic-gate 			void *data, uint_t flags);
73*0Sstevel@tonic-gate 	int	(*hpc_op_insert)(caddr_t ops_arg, hpc_slot_t slot_hdl,
74*0Sstevel@tonic-gate 			void *data, uint_t flags);
75*0Sstevel@tonic-gate 	int	(*hpc_op_remove)(caddr_t ops_arg, hpc_slot_t slot_hdl,
76*0Sstevel@tonic-gate 			void *data, uint_t flags);
77*0Sstevel@tonic-gate 	int	(*hpc_op_control)(caddr_t ops_arg, hpc_slot_t slot_hdl,
78*0Sstevel@tonic-gate 			int request, caddr_t arg);
79*0Sstevel@tonic-gate } hpc_slot_ops_t;
80*0Sstevel@tonic-gate 
81*0Sstevel@tonic-gate #define	HPC_SLOT_INFO_VERSION	1
82*0Sstevel@tonic-gate #define	PCI_SLOT_NAME_LEN	256
83*0Sstevel@tonic-gate /*
84*0Sstevel@tonic-gate  * Slot information structure.
85*0Sstevel@tonic-gate  */
86*0Sstevel@tonic-gate typedef struct hpc_slot_info {
87*0Sstevel@tonic-gate 	uint16_t	version;		/* HPC_SLOT_INFO_VERSION */
88*0Sstevel@tonic-gate 	uint16_t	slot_type;		/* slot type: PCI, ... */
89*0Sstevel@tonic-gate 	uint16_t	slot_flags;
90*0Sstevel@tonic-gate 	union {
91*0Sstevel@tonic-gate 	    /* pci bus slot */
92*0Sstevel@tonic-gate 	    struct pci_slot_info {
93*0Sstevel@tonic-gate 		uint16_t	device_number;		/* PCI device number */
94*0Sstevel@tonic-gate 		uint16_t	slot_capabilities;	/* 64bit, etc. */
95*0Sstevel@tonic-gate 		char		slot_logical_name[PCI_SLOT_NAME_LEN];
96*0Sstevel@tonic-gate 	    } pci;
97*0Sstevel@tonic-gate 	    struct sbd_slot_info {
98*0Sstevel@tonic-gate 		int		slot_num;
99*0Sstevel@tonic-gate 	    } sbd;
100*0Sstevel@tonic-gate 	    /* other bus types go here... */
101*0Sstevel@tonic-gate 	} slot;
102*0Sstevel@tonic-gate } hpc_slot_info_t;
103*0Sstevel@tonic-gate 
104*0Sstevel@tonic-gate /* short names for bus specific fields in hpc_slot_info structure */
105*0Sstevel@tonic-gate #define	pci_dev_num		slot.pci.device_number
106*0Sstevel@tonic-gate #define	pci_slot_name		slot.pci.slot_logical_name
107*0Sstevel@tonic-gate #define	pci_slot_capabilities	slot.pci.slot_capabilities
108*0Sstevel@tonic-gate 
109*0Sstevel@tonic-gate #define	sbd_slot_num		slot.sbd.slot_num
110*0Sstevel@tonic-gate 
111*0Sstevel@tonic-gate /* slot_type definitions */
112*0Sstevel@tonic-gate #define	HPC_SLOT_TYPE_PCI	0x1		/* PCI bus slot */
113*0Sstevel@tonic-gate #define	HPC_SLOT_TYPE_CPCI	0x2		/* Compact PCI bus slot */
114*0Sstevel@tonic-gate #define	HPC_SLOT_TYPE_SBD	0x3		/* System bus slot */
115*0Sstevel@tonic-gate 
116*0Sstevel@tonic-gate /* bit definitions in slot_capabilities field for PCI or cPCI bus slots */
117*0Sstevel@tonic-gate #define	HPC_SLOT_64BITS		0x0001	/* slot is a 64bit slot */
118*0Sstevel@tonic-gate #define	HPC_SLOT_TEST		0x0002	/* testing capability on the slot */
119*0Sstevel@tonic-gate 
120*0Sstevel@tonic-gate /* slot_flags definitions */
121*0Sstevel@tonic-gate #define	HPC_SLOT_NO_AUTO_ENABLE	0x1	/* No auto-enable on registration */
122*0Sstevel@tonic-gate #define	HPC_SLOT_CREATE_DEVLINK	0x2	/* create device link under /dev/cfg */
123*0Sstevel@tonic-gate 
124*0Sstevel@tonic-gate /*
125*0Sstevel@tonic-gate  * xxx_op_control command definitions.
126*0Sstevel@tonic-gate  *
127*0Sstevel@tonic-gate  * 	Command (request)	   arg			Descritpion
128*0Sstevel@tonic-gate  *	-----------------	   ---			-----------
129*0Sstevel@tonic-gate  *	HPC_CTRL_GET_LED_STATE	   hpc_led_info *	Get state of an LED.
130*0Sstevel@tonic-gate  *	HPC_CTRL_SET_LED_STATE	   hpc_led_info *	Set state of an LED.
131*0Sstevel@tonic-gate  *	HPC_CTRL_GET_SLOT_STATE	   hpc_slot_state_t *	Get the slot state.
132*0Sstevel@tonic-gate  *	HPC_CTRL_DEV_CONFIGURED	   NULL 		Board is configured.
133*0Sstevel@tonic-gate  *	HPC_CTRL_DEV_UNCONFIGURED  NULL 		Board is unconfigured.
134*0Sstevel@tonic-gate  *	HPC_CTRL_DEV_CONFIG_FAILURE NULL	Board Configuration Failed
135*0Sstevel@tonic-gate  *	HPC_CTRL_DEV_UNCONFIG_FAILURE NULL	Board Unconfiguration Failed
136*0Sstevel@tonic-gate  *	HPC_CTRL_GET_BOARD_TYPE    hpc_board_type_t *	Get board type info.
137*0Sstevel@tonic-gate  *	HPC_CTRL_DISABLE_AUTOCFG   NULL			Disable auto config-
138*0Sstevel@tonic-gate  *							uration for this slot.
139*0Sstevel@tonic-gate  *	HPC_CTRL_ENABLE_AUTOCFG    NULL			Enable auto config-
140*0Sstevel@tonic-gate  *							uration for this slot.
141*0Sstevel@tonic-gate  *	HPC_CTRL_DISABLE_SLOT	   NULL			Disable the slot for
142*0Sstevel@tonic-gate  *							hot plug operations.
143*0Sstevel@tonic-gate  *	HPC_CTRL_ENABLE_SLOT	   NULL			ReEnable the slot for
144*0Sstevel@tonic-gate  *							hot plug operations.
145*0Sstevel@tonic-gate  */
146*0Sstevel@tonic-gate #define	HPC_CTRL_GET_LED_STATE		0x1
147*0Sstevel@tonic-gate #define	HPC_CTRL_SET_LED_STATE		0x2
148*0Sstevel@tonic-gate #define	HPC_CTRL_GET_SLOT_STATE		0x3
149*0Sstevel@tonic-gate #define	HPC_CTRL_DEV_CONFIGURED		0x4
150*0Sstevel@tonic-gate #define	HPC_CTRL_DEV_UNCONFIGURED	0x5
151*0Sstevel@tonic-gate #define	HPC_CTRL_GET_BOARD_TYPE		0x6
152*0Sstevel@tonic-gate #define	HPC_CTRL_DISABLE_AUTOCFG	0x7
153*0Sstevel@tonic-gate #define	HPC_CTRL_ENABLE_AUTOCFG		0x8
154*0Sstevel@tonic-gate #define	HPC_CTRL_DISABLE_SLOT		0x9
155*0Sstevel@tonic-gate #define	HPC_CTRL_ENABLE_SLOT		0xa
156*0Sstevel@tonic-gate #define	HPC_CTRL_DISABLE_ENUM		0xb
157*0Sstevel@tonic-gate #define	HPC_CTRL_ENABLE_ENUM		0xc
158*0Sstevel@tonic-gate #define	HPC_CTRL_DEV_CONFIG_FAILURE	0xd
159*0Sstevel@tonic-gate #define	HPC_CTRL_DEV_UNCONFIG_FAILURE	0xe
160*0Sstevel@tonic-gate #define	HPC_CTRL_DEV_CONFIG_START	0xf
161*0Sstevel@tonic-gate #define	HPC_CTRL_DEV_UNCONFIG_START	0x10
162*0Sstevel@tonic-gate 
163*0Sstevel@tonic-gate /*
164*0Sstevel@tonic-gate  * type definitions for led information.
165*0Sstevel@tonic-gate  *
166*0Sstevel@tonic-gate  * Note: ATTN/ACTIVE leds are platform specific and they may not be
167*0Sstevel@tonic-gate  *	 available on all platforms.
168*0Sstevel@tonic-gate  */
169*0Sstevel@tonic-gate typedef enum { HPC_FAULT_LED, HPC_POWER_LED, HPC_ATTN_LED,
170*0Sstevel@tonic-gate 	HPC_ACTIVE_LED} hpc_led_t;
171*0Sstevel@tonic-gate 
172*0Sstevel@tonic-gate typedef enum { HPC_LED_OFF, HPC_LED_ON, HPC_LED_BLINK } hpc_led_state_t;
173*0Sstevel@tonic-gate 
174*0Sstevel@tonic-gate typedef struct hpc_led_info {
175*0Sstevel@tonic-gate 	hpc_led_t	led;	/* led id: HPC_POWER_LED, HPC_FAULT_LED, ... */
176*0Sstevel@tonic-gate 	hpc_led_state_t	state;	/* led state: HPC_LED_ON, HPC_LED_OFF, ... */
177*0Sstevel@tonic-gate } hpc_led_info_t;
178*0Sstevel@tonic-gate 
179*0Sstevel@tonic-gate /*
180*0Sstevel@tonic-gate  * type definition for slot state.
181*0Sstevel@tonic-gate  *
182*0Sstevel@tonic-gate  *	HPC_SLOT_EMPTY		Slot has no card present.
183*0Sstevel@tonic-gate  *	HPC_SLOT_CONNECTED	Card is present in the slot and it is
184*0Sstevel@tonic-gate  *				connected to the bus.
185*0Sstevel@tonic-gate  *	HPC_SLOT_DISCONNECTED	Card is present in the slot and it is
186*0Sstevel@tonic-gate  *				disconnected from the bus.
187*0Sstevel@tonic-gate  *	HPC_SLOT_UNKNOWN	If the HPC driver can not figure out
188*0Sstevel@tonic-gate  *				the receptacle state. This is possible
189*0Sstevel@tonic-gate  *				on Compact PCI Hot Swap platform.
190*0Sstevel@tonic-gate  */
191*0Sstevel@tonic-gate typedef enum { HPC_SLOT_EMPTY, HPC_SLOT_DISCONNECTED,
192*0Sstevel@tonic-gate 	HPC_SLOT_CONNECTED, HPC_SLOT_UNKNOWN } hpc_slot_state_t;
193*0Sstevel@tonic-gate 
194*0Sstevel@tonic-gate /*
195*0Sstevel@tonic-gate  * type definition for board type.
196*0Sstevel@tonic-gate  *
197*0Sstevel@tonic-gate  *	HPC_BOARD_UNKNOWN	Board is either not present or unknown.
198*0Sstevel@tonic-gate  *	HPC_BOARD_PCI_HOTPLUG	PCI bus adapter.
199*0Sstevel@tonic-gate  *	HPC_BOARD_CPCI_NON_HS	Non Hot Swap cPCI board.
200*0Sstevel@tonic-gate  *	HPC_BOARD_CPCI_BASIC_HS	Basic Hot Swap cPCI board.
201*0Sstevel@tonic-gate  *	HPC_BOARD_CPCI_FULL_HS	Full Hot Swap cPCI board.
202*0Sstevel@tonic-gate  *	HPC_BOARD_CPCI_HS	Indicates if HSC driver can not determine
203*0Sstevel@tonic-gate  *				the type of Hot Swap board.
204*0Sstevel@tonic-gate  */
205*0Sstevel@tonic-gate typedef enum { HPC_BOARD_UNKNOWN, HPC_BOARD_PCI_HOTPLUG,
206*0Sstevel@tonic-gate 	HPC_BOARD_CPCI_NON_HS, HPC_BOARD_CPCI_BASIC_HS,
207*0Sstevel@tonic-gate 	HPC_BOARD_CPCI_FULL_HS, HPC_BOARD_CPCI_HS } hpc_board_type_t;
208*0Sstevel@tonic-gate 
209*0Sstevel@tonic-gate /*
210*0Sstevel@tonic-gate  * Event type definitions (for hpc_event_notify() interface).
211*0Sstevel@tonic-gate  *
212*0Sstevel@tonic-gate  *	Event			   Descritpion
213*0Sstevel@tonic-gate  *	-----			   -----------
214*0Sstevel@tonic-gate  *	HPC_EVENT_SLOT_INSERTION   Card is inserted in the slot.
215*0Sstevel@tonic-gate  *	HPC_EVENT_SLOT_REMOVAL	   Card is removed from the slot.
216*0Sstevel@tonic-gate  *	HPC_EVENT_SLOT_POWER_ON	   Slot is powered ON.
217*0Sstevel@tonic-gate  *	HPC_EVENT_SLOT_POWER_OFF   Slot is powered OFF.
218*0Sstevel@tonic-gate  *	HPC_EVENT_SLOT_LATCH_OPEN  LATCH on the slot is open.
219*0Sstevel@tonic-gate  *	HPC_EVENT_SLOT_LATCH_SHUT  LATCH on the slot is shut.
220*0Sstevel@tonic-gate  *	HPC_EVENT_SLOT_ENUM	   ENUM# signal is generated on the bus
221*0Sstevel@tonic-gate  *				   and it may be generated from this slot.
222*0Sstevel@tonic-gate  *	HPC_EVENT_SLOT_NOT_HEALTHY HEALTHY# signal is lost on this slot.
223*0Sstevel@tonic-gate  *	HPC_EVENT_SLOT_HEALTHY_OK  HEALTHY# signal on this slot is OK now.
224*0Sstevel@tonic-gate  *	HPC_EVENT_SLOT_CONFIGURE   Configure the occupant in the slot.
225*0Sstevel@tonic-gate  *	HPC_EVENT_SLOT_UNCONFIGURE Unconfigure the occupant in the slot.
226*0Sstevel@tonic-gate  */
227*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_INSERTION	0x00000001
228*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_REMOVAL		0x00000002
229*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_POWER_ON		0x00000004
230*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_POWER_OFF	0x00000008
231*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_LATCH_OPEN	0x00000010
232*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_LATCH_SHUT	0x00000020
233*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_ENUM		0x00000040
234*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_NOT_HEALTHY	0x00000080
235*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_HEALTHY_OK	0x00000100
236*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_CONFIGURE	0x00000200
237*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_UNCONFIGURE	0x00000400
238*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_BLUE_LED_ON	0x00000800
239*0Sstevel@tonic-gate #define	HPC_EVENT_SLOT_BLUE_LED_OFF	0x00001000
240*0Sstevel@tonic-gate #define	HPC_EVENT_CLEAR_ENUM		0x00002000
241*0Sstevel@tonic-gate #define	HPC_EVENT_PROCESS_ENUM		0x00004000
242*0Sstevel@tonic-gate #define	HPC_EVENT_ENABLE_ENUM		0x00008000
243*0Sstevel@tonic-gate #define	HPC_EVENT_DISABLE_ENUM		0x00010000
244*0Sstevel@tonic-gate #define	HPC_EVENT_BUS_ENUM		HPC_EVENT_SLOT_ENUM
245*0Sstevel@tonic-gate 
246*0Sstevel@tonic-gate /*
247*0Sstevel@tonic-gate  * return values for errors from HPS framework interfaces.
248*0Sstevel@tonic-gate  */
249*0Sstevel@tonic-gate #define	HPC_SUCCESS			0x0
250*0Sstevel@tonic-gate #define	HPC_ERR_INVALID			0x1	/* invalid arguments */
251*0Sstevel@tonic-gate #define	HPC_ERR_SLOT_NOTREGISTERED	0x2	/* slot is not registered */
252*0Sstevel@tonic-gate #define	HPC_ERR_SLOT_DUPLICATE		0x3	/* slot is already registered */
253*0Sstevel@tonic-gate #define	HPC_ERR_BUS_NOTREGISTERED	0x4	/* slot is not registered */
254*0Sstevel@tonic-gate #define	HPC_ERR_BUS_DUPLICATE		0x5	/* slot is already registered */
255*0Sstevel@tonic-gate #define	HPC_ERR_NOTSUPPORTED		0x6	/* operation not supported */
256*0Sstevel@tonic-gate #define	HPC_ERR_FAILED			0x7	/* operation failed */
257*0Sstevel@tonic-gate 
258*0Sstevel@tonic-gate /* return values for event notifications */
259*0Sstevel@tonic-gate #define	HPC_EVENT_CLAIMED		0x10	/* HPC event is claimed */
260*0Sstevel@tonic-gate #define	HPC_EVENT_UNCLAIMED		-1	/* HPC event is not claimed */
261*0Sstevel@tonic-gate 
262*0Sstevel@tonic-gate /* definitions for slot (un)registration events */
263*0Sstevel@tonic-gate #define	HPC_SLOT_ONLINE		1	/* slot is registered */
264*0Sstevel@tonic-gate #define	HPC_SLOT_OFFLINE	2	/* slot is unregistered */
265*0Sstevel@tonic-gate 
266*0Sstevel@tonic-gate /*
267*0Sstevel@tonic-gate  * function prototype definitions for interfaces between HPC driver
268*0Sstevel@tonic-gate  * and Hot Plug Services framework.
269*0Sstevel@tonic-gate  */
270*0Sstevel@tonic-gate #ifdef	__STDC__
271*0Sstevel@tonic-gate extern int hpc_slot_register(dev_info_t *dip, char *bus_path,
272*0Sstevel@tonic-gate 	hpc_slot_info_t *slot_info, hpc_slot_t *slot_hdl,
273*0Sstevel@tonic-gate 	hpc_slot_ops_t *slot_ops, caddr_t ops_arg, uint_t flags);
274*0Sstevel@tonic-gate extern int hpc_slot_unregister(hpc_slot_t *slot_hdl);
275*0Sstevel@tonic-gate extern struct hpc_slot_ops *hpc_alloc_slot_ops(int sleepflag);
276*0Sstevel@tonic-gate extern void hpc_free_slot_ops(hpc_slot_ops_t *ops);
277*0Sstevel@tonic-gate extern int hpc_slot_event_notify(hpc_slot_t slot_hdl, uint_t event,
278*0Sstevel@tonic-gate 	uint_t flags);
279*0Sstevel@tonic-gate extern boolean_t hpc_bus_registered(hpc_slot_t slot_hdl);
280*0Sstevel@tonic-gate #else
281*0Sstevel@tonic-gate extern int hpc_slot_register();
282*0Sstevel@tonic-gate extern int hpc_slot_unregister();
283*0Sstevel@tonic-gate extern struct hpc_slot_ops *hpc_alloc_slot_ops();
284*0Sstevel@tonic-gate extern void hpc_free_slot_ops();
285*0Sstevel@tonic-gate extern int hpc_slot_event_notify();
286*0Sstevel@tonic-gate extern boolean_t hpc_bus_registered();
287*0Sstevel@tonic-gate #endif	/* __STDC__ */
288*0Sstevel@tonic-gate 
289*0Sstevel@tonic-gate /*
290*0Sstevel@tonic-gate  * *****************************************************************
291*0Sstevel@tonic-gate  * Implementation specific data structures and definitons. These are
292*0Sstevel@tonic-gate  * the private interfaces between cfgadm plug-in and the PCI nexus
293*0Sstevel@tonic-gate  * driver.
294*0Sstevel@tonic-gate  * *****************************************************************
295*0Sstevel@tonic-gate  */
296*0Sstevel@tonic-gate 
297*0Sstevel@tonic-gate /*
298*0Sstevel@tonic-gate  * Data structure used for DEVCTL_AP_CONTROL ioctl on the AP.
299*0Sstevel@tonic-gate  */
300*0Sstevel@tonic-gate struct hpc_control_data {
301*0Sstevel@tonic-gate 	uint_t	cmd;		/* HPC_CTRL_* command */
302*0Sstevel@tonic-gate 	void	*data;		/* pointer to data that is exchanged */
303*0Sstevel@tonic-gate };
304*0Sstevel@tonic-gate 
305*0Sstevel@tonic-gate struct hpc_control32_data {
306*0Sstevel@tonic-gate 	uint_t	  cmd;		/* HPC_CTRL_* command */
307*0Sstevel@tonic-gate 	caddr32_t data;		/* pointer to data that is exchanged */
308*0Sstevel@tonic-gate };
309*0Sstevel@tonic-gate 
310*0Sstevel@tonic-gate /* misc. control commands for DEVCTL_AP_CONTROL ioctl interface */
311*0Sstevel@tonic-gate #define	HPC_CTRL_GET_SLOT_INFO	0x100
312*0Sstevel@tonic-gate #define	HPC_CTRL_GET_CARD_INFO	0x101
313*0Sstevel@tonic-gate 
314*0Sstevel@tonic-gate /* card information structure to get data from the PCI config header */
315*0Sstevel@tonic-gate typedef struct hpc_card_info {
316*0Sstevel@tonic-gate 	uint8_t	prog_class;	/* PCI_CONF_PROGCLASS byte */
317*0Sstevel@tonic-gate 	uint8_t	base_class;	/* PCI_CONF_BASCLASS byte */
318*0Sstevel@tonic-gate 	uint8_t	sub_class;	/* PCI_CONF_SUBCLASS byte */
319*0Sstevel@tonic-gate 	uint8_t	header_type;	/* PCI_CONF_HEADER byte */
320*0Sstevel@tonic-gate } hpc_card_info_t;
321*0Sstevel@tonic-gate 
322*0Sstevel@tonic-gate /* Slot occupant information structure */
323*0Sstevel@tonic-gate #define	HPC_MAX_OCCUPANTS	128
324*0Sstevel@tonic-gate typedef struct hpc_occupant_info {
325*0Sstevel@tonic-gate 	int	i;
326*0Sstevel@tonic-gate 	char	*id[HPC_MAX_OCCUPANTS];
327*0Sstevel@tonic-gate } hpc_occupant_info_t;
328*0Sstevel@tonic-gate 
329*0Sstevel@tonic-gate #ifdef	__cplusplus
330*0Sstevel@tonic-gate }
331*0Sstevel@tonic-gate #endif
332*0Sstevel@tonic-gate 
333*0Sstevel@tonic-gate #endif	/* _SYS_HOTPLUG_HPCTRL_H */
334