/*
* 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 2014 Garrett D'Amore <garrett@damore.org>
*
*/
#ifndef _SYS_INSTANCE_H
#define _SYS_INSTANCE_H
/*
* Instance number assignment data structures
*/
#include <sys/dditypes.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* The form of a node; These form a tree that is parallel to the
* dev_info tree, but always fully populated. The tree is rooted in
* the in_softstate struct (e_ddi_inst_state.ins_root).
*
* Each node has one or more in_drv entries hanging from it.
* (It will have more than one if it has been driven by more than one driver
* over its lifetime. This can happen due to a generic name
* or to a "compatible" name giving a more specific driver).
*/
typedef struct in_node {
} in_node_t;
typedef struct in_drv {
/*
* The following field is used to link instance numbers for the
* same driver off of devnamesp or in_no_major or in_no_instance
*/
} in_drv_t;
/*
* Values for in_state
*/
/*
* Guard for path to instance file
*/
/*
* special value for dn_instance
*/
#endif /* defined(_KERNEL) || defined(_KMEMUSER) */
#ifdef _KERNEL
void e_ddi_instance_init(void);
void e_ddi_unorphan_instance_nos(void);
void e_ddi_enter_instance(void);
void e_ddi_exit_instance(void);
in_node_t *e_ddi_instance_root(void);
int e_ddi_instance_is_clean(void);
void e_ddi_instance_set_clean(void);
/* Platform instance override functions */
/* walk the instance tree */
int e_ddi_walk_instances(int (*)(const char *,
/* for DDI-MP */
/* return values from e_ddi_walk_instances callback */
#define INST_WALK_CONTINUE 0
#else /* _KERNEL */
#endif /* _KERNEL */
#define INST_SYNC_IF_REQUIRED 0
#ifdef __cplusplus
}
#endif
#endif /* _SYS_INSTANCE_H */