xref: /onnv-gate/usr/src/uts/common/sys/hotplug/hpctrl.h (revision 881:e6bc7f4b8a33)
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
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*881Sjohnny  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef	_SYS_HOTPLUG_HPCTRL_H
280Sstevel@tonic-gate #define	_SYS_HOTPLUG_HPCTRL_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate /*
330Sstevel@tonic-gate  * ****************************************************************
340Sstevel@tonic-gate  * Hot Plug Controller interfaces for PCI and CompactPCI platforms.
350Sstevel@tonic-gate  * ****************************************************************
360Sstevel@tonic-gate  */
370Sstevel@tonic-gate #include <sys/types.h>
380Sstevel@tonic-gate 
390Sstevel@tonic-gate #ifdef	__cplusplus
400Sstevel@tonic-gate extern "C" {
410Sstevel@tonic-gate #endif
420Sstevel@tonic-gate 
430Sstevel@tonic-gate /*
440Sstevel@tonic-gate  * Type definition for slot handle. This is an opaque pointer
450Sstevel@tonic-gate  * created by the HPS framework.
460Sstevel@tonic-gate  */
470Sstevel@tonic-gate typedef void *hpc_slot_t;
480Sstevel@tonic-gate 
490Sstevel@tonic-gate #define	HPC_SLOT_OPS_VERSION	0
500Sstevel@tonic-gate 
510Sstevel@tonic-gate /*
520Sstevel@tonic-gate  * slot operations structure definition.
530Sstevel@tonic-gate  *
540Sstevel@tonic-gate  *	Function		Description
550Sstevel@tonic-gate  *	--------		-----------
560Sstevel@tonic-gate  *	xxx_op_connect		CONNECT the slot to the bus to enable
570Sstevel@tonic-gate  *				access to the adapter.
580Sstevel@tonic-gate  *	xxx_op_disconnect	DISCONNECT the slot from the bus. For PCI,
590Sstevel@tonic-gate  *				this disables the power to the slot.
600Sstevel@tonic-gate  *	xxx_op_insert		Prepare the slot for card insertion. This
610Sstevel@tonic-gate  *				may not be applicable for all bus types.
620Sstevel@tonic-gate  *	xxx_op_remove		Prepare the slot for card removal. This
630Sstevel@tonic-gate  *				may not be applicable for all bus types.
640Sstevel@tonic-gate  *	xxx_op_control		Perform misc. commands to control the
650Sstevel@tonic-gate  *				LEDs, get status information, etc.
660Sstevel@tonic-gate  */
670Sstevel@tonic-gate typedef struct hpc_slot_ops {
680Sstevel@tonic-gate 	int	hpc_version;			/* HPC_SLOT_OPS_VERSION */
690Sstevel@tonic-gate 	int	(*hpc_op_connect)(caddr_t ops_arg, hpc_slot_t slot_hdl,
700Sstevel@tonic-gate 			void *data, uint_t flags);
710Sstevel@tonic-gate 	int	(*hpc_op_disconnect)(caddr_t ops_arg, hpc_slot_t slot_hdl,
720Sstevel@tonic-gate 			void *data, uint_t flags);
730Sstevel@tonic-gate 	int	(*hpc_op_insert)(caddr_t ops_arg, hpc_slot_t slot_hdl,
740Sstevel@tonic-gate 			void *data, uint_t flags);
750Sstevel@tonic-gate 	int	(*hpc_op_remove)(caddr_t ops_arg, hpc_slot_t slot_hdl,
760Sstevel@tonic-gate 			void *data, uint_t flags);
770Sstevel@tonic-gate 	int	(*hpc_op_control)(caddr_t ops_arg, hpc_slot_t slot_hdl,
780Sstevel@tonic-gate 			int request, caddr_t arg);
790Sstevel@tonic-gate } hpc_slot_ops_t;
800Sstevel@tonic-gate 
810Sstevel@tonic-gate #define	HPC_SLOT_INFO_VERSION	1
820Sstevel@tonic-gate #define	PCI_SLOT_NAME_LEN	256
830Sstevel@tonic-gate /*
840Sstevel@tonic-gate  * Slot information structure.
850Sstevel@tonic-gate  */
860Sstevel@tonic-gate typedef struct hpc_slot_info {
870Sstevel@tonic-gate 	uint16_t	version;		/* HPC_SLOT_INFO_VERSION */
880Sstevel@tonic-gate 	uint16_t	slot_type;		/* slot type: PCI, ... */
890Sstevel@tonic-gate 	uint16_t	slot_flags;
900Sstevel@tonic-gate 	union {
910Sstevel@tonic-gate 	    /* pci bus slot */
920Sstevel@tonic-gate 	    struct pci_slot_info {
930Sstevel@tonic-gate 		uint16_t	device_number;		/* PCI device number */
940Sstevel@tonic-gate 		uint16_t	slot_capabilities;	/* 64bit, etc. */
950Sstevel@tonic-gate 		char		slot_logical_name[PCI_SLOT_NAME_LEN];
960Sstevel@tonic-gate 	    } pci;
970Sstevel@tonic-gate 	    struct sbd_slot_info {
980Sstevel@tonic-gate 		int		slot_num;
990Sstevel@tonic-gate 	    } sbd;
1000Sstevel@tonic-gate 	    /* other bus types go here... */
1010Sstevel@tonic-gate 	} slot;
1020Sstevel@tonic-gate } hpc_slot_info_t;
1030Sstevel@tonic-gate 
1040Sstevel@tonic-gate /* short names for bus specific fields in hpc_slot_info structure */
1050Sstevel@tonic-gate #define	pci_dev_num		slot.pci.device_number
1060Sstevel@tonic-gate #define	pci_slot_name		slot.pci.slot_logical_name
1070Sstevel@tonic-gate #define	pci_slot_capabilities	slot.pci.slot_capabilities
1080Sstevel@tonic-gate 
1090Sstevel@tonic-gate #define	sbd_slot_num		slot.sbd.slot_num
1100Sstevel@tonic-gate 
1110Sstevel@tonic-gate /* slot_type definitions */
1120Sstevel@tonic-gate #define	HPC_SLOT_TYPE_PCI	0x1		/* PCI bus slot */
1130Sstevel@tonic-gate #define	HPC_SLOT_TYPE_CPCI	0x2		/* Compact PCI bus slot */
1140Sstevel@tonic-gate #define	HPC_SLOT_TYPE_SBD	0x3		/* System bus slot */
115*881Sjohnny #define	HPC_SLOT_TYPE_PCIE	0x4		/* PCI Express slot */
1160Sstevel@tonic-gate 
1170Sstevel@tonic-gate /* bit definitions in slot_capabilities field for PCI or cPCI bus slots */
1180Sstevel@tonic-gate #define	HPC_SLOT_64BITS		0x0001	/* slot is a 64bit slot */
1190Sstevel@tonic-gate #define	HPC_SLOT_TEST		0x0002	/* testing capability on the slot */
1200Sstevel@tonic-gate 
1210Sstevel@tonic-gate /* slot_flags definitions */
1220Sstevel@tonic-gate #define	HPC_SLOT_NO_AUTO_ENABLE	0x1	/* No auto-enable on registration */
1230Sstevel@tonic-gate #define	HPC_SLOT_CREATE_DEVLINK	0x2	/* create device link under /dev/cfg */
1240Sstevel@tonic-gate 
1250Sstevel@tonic-gate /*
1260Sstevel@tonic-gate  * xxx_op_control command definitions.
1270Sstevel@tonic-gate  *
1280Sstevel@tonic-gate  * 	Command (request)	   arg			Descritpion
1290Sstevel@tonic-gate  *	-----------------	   ---			-----------
1300Sstevel@tonic-gate  *	HPC_CTRL_GET_LED_STATE	   hpc_led_info *	Get state of an LED.
1310Sstevel@tonic-gate  *	HPC_CTRL_SET_LED_STATE	   hpc_led_info *	Set state of an LED.
1320Sstevel@tonic-gate  *	HPC_CTRL_GET_SLOT_STATE	   hpc_slot_state_t *	Get the slot state.
1330Sstevel@tonic-gate  *	HPC_CTRL_DEV_CONFIGURED	   NULL 		Board is configured.
1340Sstevel@tonic-gate  *	HPC_CTRL_DEV_UNCONFIGURED  NULL 		Board is unconfigured.
1350Sstevel@tonic-gate  *	HPC_CTRL_DEV_CONFIG_FAILURE NULL	Board Configuration Failed
1360Sstevel@tonic-gate  *	HPC_CTRL_DEV_UNCONFIG_FAILURE NULL	Board Unconfiguration Failed
1370Sstevel@tonic-gate  *	HPC_CTRL_GET_BOARD_TYPE    hpc_board_type_t *	Get board type info.
1380Sstevel@tonic-gate  *	HPC_CTRL_DISABLE_AUTOCFG   NULL			Disable auto config-
1390Sstevel@tonic-gate  *							uration for this slot.
1400Sstevel@tonic-gate  *	HPC_CTRL_ENABLE_AUTOCFG    NULL			Enable auto config-
1410Sstevel@tonic-gate  *							uration for this slot.
1420Sstevel@tonic-gate  *	HPC_CTRL_DISABLE_SLOT	   NULL			Disable the slot for
1430Sstevel@tonic-gate  *							hot plug operations.
1440Sstevel@tonic-gate  *	HPC_CTRL_ENABLE_SLOT	   NULL			ReEnable the slot for
1450Sstevel@tonic-gate  *							hot plug operations.
1460Sstevel@tonic-gate  */
1470Sstevel@tonic-gate #define	HPC_CTRL_GET_LED_STATE		0x1
1480Sstevel@tonic-gate #define	HPC_CTRL_SET_LED_STATE		0x2
1490Sstevel@tonic-gate #define	HPC_CTRL_GET_SLOT_STATE		0x3
1500Sstevel@tonic-gate #define	HPC_CTRL_DEV_CONFIGURED		0x4
1510Sstevel@tonic-gate #define	HPC_CTRL_DEV_UNCONFIGURED	0x5
1520Sstevel@tonic-gate #define	HPC_CTRL_GET_BOARD_TYPE		0x6
1530Sstevel@tonic-gate #define	HPC_CTRL_DISABLE_AUTOCFG	0x7
1540Sstevel@tonic-gate #define	HPC_CTRL_ENABLE_AUTOCFG		0x8
1550Sstevel@tonic-gate #define	HPC_CTRL_DISABLE_SLOT		0x9
1560Sstevel@tonic-gate #define	HPC_CTRL_ENABLE_SLOT		0xa
1570Sstevel@tonic-gate #define	HPC_CTRL_DISABLE_ENUM		0xb
1580Sstevel@tonic-gate #define	HPC_CTRL_ENABLE_ENUM		0xc
1590Sstevel@tonic-gate #define	HPC_CTRL_DEV_CONFIG_FAILURE	0xd
1600Sstevel@tonic-gate #define	HPC_CTRL_DEV_UNCONFIG_FAILURE	0xe
1610Sstevel@tonic-gate #define	HPC_CTRL_DEV_CONFIG_START	0xf
1620Sstevel@tonic-gate #define	HPC_CTRL_DEV_UNCONFIG_START	0x10
1630Sstevel@tonic-gate 
1640Sstevel@tonic-gate /*
1650Sstevel@tonic-gate  * type definitions for led information.
1660Sstevel@tonic-gate  *
1670Sstevel@tonic-gate  * Note: ATTN/ACTIVE leds are platform specific and they may not be
1680Sstevel@tonic-gate  *	 available on all platforms.
1690Sstevel@tonic-gate  */
1700Sstevel@tonic-gate typedef enum { HPC_FAULT_LED, HPC_POWER_LED, HPC_ATTN_LED,
1710Sstevel@tonic-gate 	HPC_ACTIVE_LED} hpc_led_t;
1720Sstevel@tonic-gate 
1730Sstevel@tonic-gate typedef enum { HPC_LED_OFF, HPC_LED_ON, HPC_LED_BLINK } hpc_led_state_t;
1740Sstevel@tonic-gate 
1750Sstevel@tonic-gate typedef struct hpc_led_info {
1760Sstevel@tonic-gate 	hpc_led_t	led;	/* led id: HPC_POWER_LED, HPC_FAULT_LED, ... */
1770Sstevel@tonic-gate 	hpc_led_state_t	state;	/* led state: HPC_LED_ON, HPC_LED_OFF, ... */
1780Sstevel@tonic-gate } hpc_led_info_t;
1790Sstevel@tonic-gate 
1800Sstevel@tonic-gate /*
1810Sstevel@tonic-gate  * type definition for slot state.
1820Sstevel@tonic-gate  *
1830Sstevel@tonic-gate  *	HPC_SLOT_EMPTY		Slot has no card present.
1840Sstevel@tonic-gate  *	HPC_SLOT_CONNECTED	Card is present in the slot and it is
1850Sstevel@tonic-gate  *				connected to the bus.
1860Sstevel@tonic-gate  *	HPC_SLOT_DISCONNECTED	Card is present in the slot and it is
1870Sstevel@tonic-gate  *				disconnected from the bus.
1880Sstevel@tonic-gate  *	HPC_SLOT_UNKNOWN	If the HPC driver can not figure out
1890Sstevel@tonic-gate  *				the receptacle state. This is possible
1900Sstevel@tonic-gate  *				on Compact PCI Hot Swap platform.
1910Sstevel@tonic-gate  */
1920Sstevel@tonic-gate typedef enum { HPC_SLOT_EMPTY, HPC_SLOT_DISCONNECTED,
1930Sstevel@tonic-gate 	HPC_SLOT_CONNECTED, HPC_SLOT_UNKNOWN } hpc_slot_state_t;
1940Sstevel@tonic-gate 
1950Sstevel@tonic-gate /*
1960Sstevel@tonic-gate  * type definition for board type.
1970Sstevel@tonic-gate  *
1980Sstevel@tonic-gate  *	HPC_BOARD_UNKNOWN	Board is either not present or unknown.
199*881Sjohnny  *	HPC_BOARD_PCI_HOTPLUG	PCI or PCIe adapter.
2000Sstevel@tonic-gate  *	HPC_BOARD_CPCI_NON_HS	Non Hot Swap cPCI board.
2010Sstevel@tonic-gate  *	HPC_BOARD_CPCI_BASIC_HS	Basic Hot Swap cPCI board.
2020Sstevel@tonic-gate  *	HPC_BOARD_CPCI_FULL_HS	Full Hot Swap cPCI board.
2030Sstevel@tonic-gate  *	HPC_BOARD_CPCI_HS	Indicates if HSC driver can not determine
2040Sstevel@tonic-gate  *				the type of Hot Swap board.
2050Sstevel@tonic-gate  */
2060Sstevel@tonic-gate typedef enum { HPC_BOARD_UNKNOWN, HPC_BOARD_PCI_HOTPLUG,
2070Sstevel@tonic-gate 	HPC_BOARD_CPCI_NON_HS, HPC_BOARD_CPCI_BASIC_HS,
2080Sstevel@tonic-gate 	HPC_BOARD_CPCI_FULL_HS, HPC_BOARD_CPCI_HS } hpc_board_type_t;
2090Sstevel@tonic-gate 
2100Sstevel@tonic-gate /*
2110Sstevel@tonic-gate  * Event type definitions (for hpc_event_notify() interface).
2120Sstevel@tonic-gate  *
2130Sstevel@tonic-gate  *	Event			   Descritpion
2140Sstevel@tonic-gate  *	-----			   -----------
2150Sstevel@tonic-gate  *	HPC_EVENT_SLOT_INSERTION   Card is inserted in the slot.
2160Sstevel@tonic-gate  *	HPC_EVENT_SLOT_REMOVAL	   Card is removed from the slot.
2170Sstevel@tonic-gate  *	HPC_EVENT_SLOT_POWER_ON	   Slot is powered ON.
2180Sstevel@tonic-gate  *	HPC_EVENT_SLOT_POWER_OFF   Slot is powered OFF.
2190Sstevel@tonic-gate  *	HPC_EVENT_SLOT_LATCH_OPEN  LATCH on the slot is open.
2200Sstevel@tonic-gate  *	HPC_EVENT_SLOT_LATCH_SHUT  LATCH on the slot is shut.
2210Sstevel@tonic-gate  *	HPC_EVENT_SLOT_ENUM	   ENUM# signal is generated on the bus
2220Sstevel@tonic-gate  *				   and it may be generated from this slot.
2230Sstevel@tonic-gate  *	HPC_EVENT_SLOT_NOT_HEALTHY HEALTHY# signal is lost on this slot.
2240Sstevel@tonic-gate  *	HPC_EVENT_SLOT_HEALTHY_OK  HEALTHY# signal on this slot is OK now.
2250Sstevel@tonic-gate  *	HPC_EVENT_SLOT_CONFIGURE   Configure the occupant in the slot.
2260Sstevel@tonic-gate  *	HPC_EVENT_SLOT_UNCONFIGURE Unconfigure the occupant in the slot.
2270Sstevel@tonic-gate  */
2280Sstevel@tonic-gate #define	HPC_EVENT_SLOT_INSERTION	0x00000001
2290Sstevel@tonic-gate #define	HPC_EVENT_SLOT_REMOVAL		0x00000002
2300Sstevel@tonic-gate #define	HPC_EVENT_SLOT_POWER_ON		0x00000004
2310Sstevel@tonic-gate #define	HPC_EVENT_SLOT_POWER_OFF	0x00000008
2320Sstevel@tonic-gate #define	HPC_EVENT_SLOT_LATCH_OPEN	0x00000010
2330Sstevel@tonic-gate #define	HPC_EVENT_SLOT_LATCH_SHUT	0x00000020
2340Sstevel@tonic-gate #define	HPC_EVENT_SLOT_ENUM		0x00000040
2350Sstevel@tonic-gate #define	HPC_EVENT_SLOT_NOT_HEALTHY	0x00000080
2360Sstevel@tonic-gate #define	HPC_EVENT_SLOT_HEALTHY_OK	0x00000100
2370Sstevel@tonic-gate #define	HPC_EVENT_SLOT_CONFIGURE	0x00000200
2380Sstevel@tonic-gate #define	HPC_EVENT_SLOT_UNCONFIGURE	0x00000400
2390Sstevel@tonic-gate #define	HPC_EVENT_SLOT_BLUE_LED_ON	0x00000800
2400Sstevel@tonic-gate #define	HPC_EVENT_SLOT_BLUE_LED_OFF	0x00001000
2410Sstevel@tonic-gate #define	HPC_EVENT_CLEAR_ENUM		0x00002000
2420Sstevel@tonic-gate #define	HPC_EVENT_PROCESS_ENUM		0x00004000
2430Sstevel@tonic-gate #define	HPC_EVENT_ENABLE_ENUM		0x00008000
2440Sstevel@tonic-gate #define	HPC_EVENT_DISABLE_ENUM		0x00010000
2450Sstevel@tonic-gate #define	HPC_EVENT_BUS_ENUM		HPC_EVENT_SLOT_ENUM
246*881Sjohnny #define	HPC_EVENT_SLOT_ATTN		0x00020000
247*881Sjohnny #define	HPC_EVENT_SLOT_POWER_FAULT  	0x00040000
2480Sstevel@tonic-gate 
2490Sstevel@tonic-gate /*
2500Sstevel@tonic-gate  * return values for errors from HPS framework interfaces.
2510Sstevel@tonic-gate  */
2520Sstevel@tonic-gate #define	HPC_SUCCESS			0x0
2530Sstevel@tonic-gate #define	HPC_ERR_INVALID			0x1	/* invalid arguments */
2540Sstevel@tonic-gate #define	HPC_ERR_SLOT_NOTREGISTERED	0x2	/* slot is not registered */
2550Sstevel@tonic-gate #define	HPC_ERR_SLOT_DUPLICATE		0x3	/* slot is already registered */
2560Sstevel@tonic-gate #define	HPC_ERR_BUS_NOTREGISTERED	0x4	/* slot is not registered */
2570Sstevel@tonic-gate #define	HPC_ERR_BUS_DUPLICATE		0x5	/* slot is already registered */
2580Sstevel@tonic-gate #define	HPC_ERR_NOTSUPPORTED		0x6	/* operation not supported */
2590Sstevel@tonic-gate #define	HPC_ERR_FAILED			0x7	/* operation failed */
2600Sstevel@tonic-gate 
2610Sstevel@tonic-gate /* return values for event notifications */
2620Sstevel@tonic-gate #define	HPC_EVENT_CLAIMED		0x10	/* HPC event is claimed */
2630Sstevel@tonic-gate #define	HPC_EVENT_UNCLAIMED		-1	/* HPC event is not claimed */
2640Sstevel@tonic-gate 
2650Sstevel@tonic-gate /* definitions for slot (un)registration events */
2660Sstevel@tonic-gate #define	HPC_SLOT_ONLINE		1	/* slot is registered */
2670Sstevel@tonic-gate #define	HPC_SLOT_OFFLINE	2	/* slot is unregistered */
2680Sstevel@tonic-gate 
2690Sstevel@tonic-gate /*
2700Sstevel@tonic-gate  * function prototype definitions for interfaces between HPC driver
2710Sstevel@tonic-gate  * and Hot Plug Services framework.
2720Sstevel@tonic-gate  */
2730Sstevel@tonic-gate #ifdef	__STDC__
2740Sstevel@tonic-gate extern int hpc_slot_register(dev_info_t *dip, char *bus_path,
2750Sstevel@tonic-gate 	hpc_slot_info_t *slot_info, hpc_slot_t *slot_hdl,
2760Sstevel@tonic-gate 	hpc_slot_ops_t *slot_ops, caddr_t ops_arg, uint_t flags);
2770Sstevel@tonic-gate extern int hpc_slot_unregister(hpc_slot_t *slot_hdl);
2780Sstevel@tonic-gate extern struct hpc_slot_ops *hpc_alloc_slot_ops(int sleepflag);
2790Sstevel@tonic-gate extern void hpc_free_slot_ops(hpc_slot_ops_t *ops);
2800Sstevel@tonic-gate extern int hpc_slot_event_notify(hpc_slot_t slot_hdl, uint_t event,
2810Sstevel@tonic-gate 	uint_t flags);
2820Sstevel@tonic-gate extern boolean_t hpc_bus_registered(hpc_slot_t slot_hdl);
2830Sstevel@tonic-gate #else
2840Sstevel@tonic-gate extern int hpc_slot_register();
2850Sstevel@tonic-gate extern int hpc_slot_unregister();
2860Sstevel@tonic-gate extern struct hpc_slot_ops *hpc_alloc_slot_ops();
2870Sstevel@tonic-gate extern void hpc_free_slot_ops();
2880Sstevel@tonic-gate extern int hpc_slot_event_notify();
2890Sstevel@tonic-gate extern boolean_t hpc_bus_registered();
2900Sstevel@tonic-gate #endif	/* __STDC__ */
2910Sstevel@tonic-gate 
2920Sstevel@tonic-gate /*
2930Sstevel@tonic-gate  * *****************************************************************
2940Sstevel@tonic-gate  * Implementation specific data structures and definitons. These are
2950Sstevel@tonic-gate  * the private interfaces between cfgadm plug-in and the PCI nexus
2960Sstevel@tonic-gate  * driver.
2970Sstevel@tonic-gate  * *****************************************************************
2980Sstevel@tonic-gate  */
2990Sstevel@tonic-gate 
3000Sstevel@tonic-gate /*
3010Sstevel@tonic-gate  * Data structure used for DEVCTL_AP_CONTROL ioctl on the AP.
3020Sstevel@tonic-gate  */
3030Sstevel@tonic-gate struct hpc_control_data {
3040Sstevel@tonic-gate 	uint_t	cmd;		/* HPC_CTRL_* command */
3050Sstevel@tonic-gate 	void	*data;		/* pointer to data that is exchanged */
3060Sstevel@tonic-gate };
3070Sstevel@tonic-gate 
3080Sstevel@tonic-gate struct hpc_control32_data {
3090Sstevel@tonic-gate 	uint_t	  cmd;		/* HPC_CTRL_* command */
3100Sstevel@tonic-gate 	caddr32_t data;		/* pointer to data that is exchanged */
3110Sstevel@tonic-gate };
3120Sstevel@tonic-gate 
3130Sstevel@tonic-gate /* misc. control commands for DEVCTL_AP_CONTROL ioctl interface */
3140Sstevel@tonic-gate #define	HPC_CTRL_GET_SLOT_INFO	0x100
3150Sstevel@tonic-gate #define	HPC_CTRL_GET_CARD_INFO	0x101
3160Sstevel@tonic-gate 
3170Sstevel@tonic-gate /* card information structure to get data from the PCI config header */
3180Sstevel@tonic-gate typedef struct hpc_card_info {
3190Sstevel@tonic-gate 	uint8_t	prog_class;	/* PCI_CONF_PROGCLASS byte */
3200Sstevel@tonic-gate 	uint8_t	base_class;	/* PCI_CONF_BASCLASS byte */
3210Sstevel@tonic-gate 	uint8_t	sub_class;	/* PCI_CONF_SUBCLASS byte */
3220Sstevel@tonic-gate 	uint8_t	header_type;	/* PCI_CONF_HEADER byte */
3230Sstevel@tonic-gate } hpc_card_info_t;
3240Sstevel@tonic-gate 
3250Sstevel@tonic-gate /* Slot occupant information structure */
3260Sstevel@tonic-gate #define	HPC_MAX_OCCUPANTS	128
3270Sstevel@tonic-gate typedef struct hpc_occupant_info {
3280Sstevel@tonic-gate 	int	i;
3290Sstevel@tonic-gate 	char	*id[HPC_MAX_OCCUPANTS];
3300Sstevel@tonic-gate } hpc_occupant_info_t;
3310Sstevel@tonic-gate 
3320Sstevel@tonic-gate #ifdef	__cplusplus
3330Sstevel@tonic-gate }
3340Sstevel@tonic-gate #endif
3350Sstevel@tonic-gate 
3360Sstevel@tonic-gate #endif	/* _SYS_HOTPLUG_HPCTRL_H */
337