17aec1d6eScindi /*
27aec1d6eScindi  * CDDL HEADER START
37aec1d6eScindi  *
47aec1d6eScindi  * The contents of this file are subject to the terms of the
50eb822a1Scindi  * Common Development and Distribution License (the "License").
60eb822a1Scindi  * You may not use this file except in compliance with the License.
77aec1d6eScindi  *
87aec1d6eScindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97aec1d6eScindi  * or http://www.opensolaris.org/os/licensing.
107aec1d6eScindi  * See the License for the specific language governing permissions
117aec1d6eScindi  * and limitations under the License.
127aec1d6eScindi  *
137aec1d6eScindi  * When distributing Covered Code, include this CDDL HEADER in each
147aec1d6eScindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157aec1d6eScindi  * If applicable, add the following below this CDDL HEADER, with the
167aec1d6eScindi  * fields enclosed by brackets "[]" replaced with your own identifying
177aec1d6eScindi  * information: Portions Copyright [yyyy] [name of copyright owner]
187aec1d6eScindi  *
197aec1d6eScindi  * CDDL HEADER END
207aec1d6eScindi  */
217aec1d6eScindi /*
22*c40d7343Scindi  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237aec1d6eScindi  * Use is subject to license terms.
247aec1d6eScindi  */
257aec1d6eScindi 
267aec1d6eScindi #ifndef _TOPO_PROP_H
277aec1d6eScindi #define	_TOPO_PROP_H
287aec1d6eScindi 
297aec1d6eScindi #include <fm/libtopo.h>
307aec1d6eScindi 
317aec1d6eScindi #include <topo_list.h>
327aec1d6eScindi 
337aec1d6eScindi #ifdef __cplusplus
347aec1d6eScindi extern "C" {
357aec1d6eScindi #endif
367aec1d6eScindi 
370eb822a1Scindi typedef struct topo_ipgroup_info {
380eb822a1Scindi 	char *tpi_name;			/* property group name */
390eb822a1Scindi 	topo_stability_t tpi_namestab;	/* stability of group name */
400eb822a1Scindi 	topo_stability_t tpi_datastab;	/* stability of all property values */
410eb822a1Scindi 	topo_version_t  tpi_version;	/* version of pgroup definition */
420eb822a1Scindi } topo_ipgroup_info_t;
430eb822a1Scindi 
447aec1d6eScindi typedef struct topo_pgroup {
457aec1d6eScindi 	topo_list_t tpg_list;		/* next/prev pointers */
460eb822a1Scindi 	topo_ipgroup_info_t *tpg_info;	/* name, version, stability */
470eb822a1Scindi 	topo_list_t tpg_pvals;		/* property values */
487aec1d6eScindi } topo_pgroup_t;
497aec1d6eScindi 
50*c40d7343Scindi typedef struct topo_propmethod {
51*c40d7343Scindi 	char *tpm_name;			/* property method name */
52*c40d7343Scindi 	topo_version_t tpm_version;	/* method version */
53*c40d7343Scindi 	nvlist_t *tpm_args;		/* in args for method */
54*c40d7343Scindi } topo_propmethod_t;
55*c40d7343Scindi 
567aec1d6eScindi typedef struct topo_propval {
570eb822a1Scindi 	char *tp_name;			/* prop name */
580eb822a1Scindi 	topo_type_t tp_type;		/* prop type */
590eb822a1Scindi 	int tp_flag;			/* dynamic property */
607aec1d6eScindi 	int tp_refs;			/* ref count for this prop val */
617aec1d6eScindi 	topo_hdl_t *tp_hdl;		/* handle pointer for allocations */
620eb822a1Scindi 	void (*tp_free)(struct topo_propval *); /* prop value destructor */
630eb822a1Scindi 	nvlist_t *tp_val;
64*c40d7343Scindi 	topo_propmethod_t *tp_method;	/* Method for accessing dynamic prop */
657aec1d6eScindi } topo_propval_t;
667aec1d6eScindi 
677aec1d6eScindi typedef struct topo_proplist {
687aec1d6eScindi 	topo_list_t tp_list;		/* next/prev pointers */
697aec1d6eScindi 	topo_propval_t *tp_pval;	/* actual value */
707aec1d6eScindi } topo_proplist_t;
717aec1d6eScindi 
727aec1d6eScindi extern void topo_prop_hold(topo_propval_t *);
737aec1d6eScindi extern void topo_prop_rele(topo_propval_t *);
747aec1d6eScindi extern void topo_pgroup_destroy_all(tnode_t *);
75*c40d7343Scindi extern nvlist_t *topo_prop_get(tnode_t *, const char *, const char *,
76*c40d7343Scindi     topo_type_t, nvlist_t *, int *err);
777aec1d6eScindi 
787aec1d6eScindi #ifdef __cplusplus
797aec1d6eScindi }
807aec1d6eScindi #endif
817aec1d6eScindi 
827aec1d6eScindi #endif	/* _TOPO_PROP_H */
83