7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER START
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi *
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * The contents of this file are subject to the terms of the
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * Common Development and Distribution License (the "License").
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * You may not use this file except in compliance with the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi *
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * or http://www.opensolaris.org/os/licensing.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * See the License for the specific language governing permissions
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * and limitations under the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi *
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * When distributing Covered Code, include this CDDL HEADER in each
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * If applicable, add the following below this CDDL HEADER, with the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * fields enclosed by brackets "[]" replaced with your own identifying
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * information: Portions Copyright [yyyy] [name of copyright owner]
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi *
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER END
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Use is subject to license terms.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#ifndef _TOPO_PROP_H
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define _TOPO_PROP_H
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#pragma ident "%Z%%M% %I% %E% SMI"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#include <fm/libtopo.h>
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#include <topo_list.h>
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#ifdef __cplusplus
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern "C" {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#endif
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditypedef struct topo_ipgroup_info {
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi char *tpi_name; /* property group name */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi topo_stability_t tpi_namestab; /* stability of group name */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi topo_stability_t tpi_datastab; /* stability of all property values */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi topo_version_t tpi_version; /* version of pgroup definition */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi} topo_ipgroup_info_t;
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef struct topo_pgroup {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi topo_list_t tpg_list; /* next/prev pointers */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi topo_ipgroup_info_t *tpg_info; /* name, version, stability */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi topo_list_t tpg_pvals; /* property values */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi} topo_pgroup_t;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
c40d7343efa60b18ad1ceb316eb337caeea79046cinditypedef struct topo_propmethod {
c40d7343efa60b18ad1ceb316eb337caeea79046cindi char *tpm_name; /* property method name */
c40d7343efa60b18ad1ceb316eb337caeea79046cindi topo_version_t tpm_version; /* method version */
c40d7343efa60b18ad1ceb316eb337caeea79046cindi nvlist_t *tpm_args; /* in args for method */
c40d7343efa60b18ad1ceb316eb337caeea79046cindi} topo_propmethod_t;
c40d7343efa60b18ad1ceb316eb337caeea79046cindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef struct topo_propval {
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi char *tp_name; /* prop name */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi topo_type_t tp_type; /* prop type */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi int tp_flag; /* dynamic property */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int tp_refs; /* ref count for this prop val */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi topo_hdl_t *tp_hdl; /* handle pointer for allocations */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi void (*tp_free)(struct topo_propval *); /* prop value destructor */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi nvlist_t *tp_val;
c40d7343efa60b18ad1ceb316eb337caeea79046cindi topo_propmethod_t *tp_method; /* Method for accessing dynamic prop */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi} topo_propval_t;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef struct topo_proplist {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi topo_list_t tp_list; /* next/prev pointers */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi topo_propval_t *tp_pval; /* actual value */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi} topo_proplist_t;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void topo_prop_hold(topo_propval_t *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void topo_prop_rele(topo_propval_t *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void topo_pgroup_destroy_all(tnode_t *);
c40d7343efa60b18ad1ceb316eb337caeea79046cindiextern nvlist_t *topo_prop_get(tnode_t *, const char *, const char *,
c40d7343efa60b18ad1ceb316eb337caeea79046cindi topo_type_t, nvlist_t *, int *err);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#ifdef __cplusplus
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi}
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#endif
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#endif /* _TOPO_PROP_H */