ddi_hp_impl.h revision 269473047d747f7815af570197e4ef7322d3632c
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DDI_HP_IMPL_H
#define _SYS_DDI_HP_IMPL_H
/*
* Sun DDI hotplug implementation specific definitions
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
/* Flags for sync request and async hotplug request */
#define DDI_HP_REQ_SYNC 0x0001
#define DDI_HP_REQ_ASYNC 0x0002
/* Check if a handle represents a port or a connector */
#define DDI_HP_IS_VIRTUAL_PORT(hdlp) \
/*
* ddi_hp_cn_handle_t
*
* DDI handle for a registered Hotplug Connection (CN)
*/
typedef struct ddi_hp_cn_handle {
typedef struct ddi_hp_cn_async_event_entry {
char *cn_name;
/*
* ddi_hp_op_t
*
* Typedef for Hotplug OPS commands used with bus_hp_op()
*/
typedef enum {
DDI_HPOP_CN_CHANGE_STATE, /* Change Connection state */
DDI_HPOP_CN_PROBE, /* Probe Connection */
DDI_HPOP_CN_UNPROBE, /* Unprobe Connection */
DDI_HPOP_CN_GET_PROPERTY, /* Get bus specific property */
DDI_HPOP_CN_SET_PROPERTY, /* Set bus specific property */
DDI_HPOP_CN_CREATE_PORT, /* Create a port for virtual hotplug */
DDI_HPOP_CN_REMOVE_PORT /* Remove an empty port */
} ddi_hp_op_t;
if (DDI_HP_IS_VIRTUAL_PORT(hdlp)) \
else \
#define NEXUS_HAS_HP_OP(dip) \
/*
* ddi_hp_cn_sysevent_t
*
* The following correspond to sysevent defined subclasses
*/
typedef enum {
/*
* Control structure for tree walk during configure/unconfigure operation.
*/
typedef struct ddi_hp_cn_cfg {
/* FALSE for offline children. */
int rv; /* Return error code */
/*
* Misc
*/
/* Append a node to list */
if (node) { \
else \
}
/* Remove a node from a list */
if (node) { \
break; \
} \
if (curr) { \
else \
} \
}
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DDI_HP_IMPL_H */