xref: /onnv-gate/usr/src/lib/fm/topo/libtopo/common/topo_method.h (revision 7732:64e76207849d)
13062Scindi /*
23062Scindi  * CDDL HEADER START
33062Scindi  *
43062Scindi  * The contents of this file are subject to the terms of the
53062Scindi  * Common Development and Distribution License (the "License").
63062Scindi  * You may not use this file except in compliance with the License.
73062Scindi  *
83062Scindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
93062Scindi  * or http://www.opensolaris.org/os/licensing.
103062Scindi  * See the License for the specific language governing permissions
113062Scindi  * and limitations under the License.
123062Scindi  *
133062Scindi  * When distributing Covered Code, include this CDDL HEADER in each
143062Scindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
153062Scindi  * If applicable, add the following below this CDDL HEADER, with the
163062Scindi  * fields enclosed by brackets "[]" replaced with your own identifying
173062Scindi  * information: Portions Copyright [yyyy] [name of copyright owner]
183062Scindi  *
193062Scindi  * CDDL HEADER END
203062Scindi  */
213062Scindi 
223062Scindi /*
236828Stsien  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
243062Scindi  * Use is subject to license terms.
253062Scindi  */
263062Scindi 
273062Scindi #ifndef _TOPO_METHOD_H
283062Scindi #define	_TOPO_METHOD_H
293062Scindi 
303062Scindi #ifdef __cplusplus
313062Scindi extern "C" {
323062Scindi #endif
333062Scindi 
346869Seschrock #include <fm/topo_list.h>
354087Scindi 
364087Scindi typedef struct topo_imethod {
374087Scindi 	topo_list_t tim_list;		/* next/prev pointers */
384087Scindi 	pthread_mutex_t tim_lock;	/* method entry lock */
394087Scindi 	pthread_cond_t  tim_cv;		/* method entry cv */
404087Scindi 	uint_t tim_busy;		/* method entry busy indicator */
414087Scindi 	char *tim_name;			/* Method name */
424087Scindi 	topo_version_t tim_version;	/* Method version */
434087Scindi 	topo_stability_t tim_stability;	/* SMI stability of method */
444087Scindi 	char *tim_desc;			/* Method description */
454087Scindi 	topo_method_f *tim_func;	/* Method function */
464087Scindi 	struct topo_mod *tim_mod;	/* Ptr to controlling module */
474087Scindi } topo_imethod_t;
484087Scindi 
494087Scindi extern int topo_method_call(tnode_t *, const char *, topo_version_t, nvlist_t *,
504087Scindi     nvlist_t **, int *);
514087Scindi extern topo_imethod_t *topo_method_lookup(tnode_t *, const char *);
524087Scindi extern int topo_prop_method_version_register(tnode_t *, const char *,
534087Scindi     const char *, topo_type_t, const char *, topo_version_t, const nvlist_t *,
544087Scindi     int *);
554087Scindi 
563062Scindi /*
573062Scindi  * FMRI methods
583062Scindi  */
593062Scindi #define	TOPO_METH_ASRU_COMPUTE		"topo_asru_compute"
603062Scindi #define	TOPO_METH_FRU_COMPUTE		"topo_fru_compute"
613062Scindi #define	TOPO_METH_FMRI			"topo_fmri"
623062Scindi #define	TOPO_METH_NVL2STR		"topo_nvl2str"
633062Scindi #define	TOPO_METH_STR2NVL		"topo_str2nvl"
643062Scindi #define	TOPO_METH_COMPARE		"topo_compare"
654087Scindi #define	TOPO_METH_PROP_GET		"topo_prop_get"
664087Scindi #define	TOPO_METH_PGRP_GET		"topo_pgrp_get"
674087Scindi #define	TOPO_METH_PROP_SET		"topo_prop_set"
687243Srobj #define	TOPO_METH_FACILITY		"topo_facility"
693062Scindi 
703062Scindi #define	TOPO_METH_FMRI_VERSION			0
713062Scindi #define	TOPO_METH_FRU_COMPUTE_VERSION		0
723062Scindi #define	TOPO_METH_ASRU_COMPUTE_VERSION		0
733062Scindi #define	TOPO_METH_NVL2STR_VERSION		0
743062Scindi #define	TOPO_METH_STR2NVL_VERSION		0
753062Scindi #define	TOPO_METH_COMPARE_VERSION		0
764087Scindi #define	TOPO_METH_PROP_GET_VERSION		0
774087Scindi #define	TOPO_METH_PGRP_GET_VERSION		0
784087Scindi #define	TOPO_METH_PROP_SET_VERSION		0
797243Srobj #define	TOPO_METH_FACILITY_VERSION		0
803062Scindi 
814087Scindi #define	TOPO_METH_ASRU_COMPUTE_DESC	"Dynamic ASRU constructor"
824087Scindi #define	TOPO_METH_FRU_COMPUTE_DESC	"Dynamic FRU constructor"
834087Scindi #define	TOPO_METH_FMRI_DESC		"Dynamic FMRI constructor"
844087Scindi #define	TOPO_METH_NVL2STR_DESC		"FMRI to string"
854087Scindi #define	TOPO_METH_STR2NVL_DESC		"string to FMRI"
864087Scindi #define	TOPO_METH_COMPARE_DESC		"compare two FMRIs"
874087Scindi #define	TOPO_METH_PROP_GET_DESC		"get properties for FMRI"
884087Scindi #define	TOPO_METH_PGRP_GET_DESC		"get property group for FMRI"
894087Scindi #define	TOPO_METH_PROP_SET_DESC		"set properties for FMRI"
907243Srobj #define	TOPO_METH_FACILITY_DESC		"get facility for FMRI"
914087Scindi 
92*7732SRobert.Johnston@Sun.COM #define	TOPO_METH_COMPARE_RET		"compare-return"
933062Scindi 
943062Scindi #define	TOPO_METH_FMRI_ARG_NAME		"child-name"
953062Scindi #define	TOPO_METH_FMRI_ARG_INST		"child-inst"
963062Scindi #define	TOPO_METH_FMRI_ARG_NVL		"args"
973062Scindi #define	TOPO_METH_FMRI_ARG_PARENT	"parent-fmri"
983062Scindi #define	TOPO_METH_FMRI_ARG_AUTH		"auth"
993062Scindi #define	TOPO_METH_FMRI_ARG_PART		"part"
1003062Scindi #define	TOPO_METH_FMRI_ARG_REV		"rev"
1013062Scindi #define	TOPO_METH_FMRI_ARG_SER		"serial"
1023062Scindi #define	TOPO_METH_FMRI_ARG_HCS		"hc-specific"
1034087Scindi #define	TOPO_METH_FMRI_ARG_FMRI		"fmri"
1044087Scindi #define	TOPO_METH_FMRI_ARG_SUBFMRI	"sub-fmri"
1054087Scindi #define	TOPO_METH_FMRI_ARG_NV1		"nv1"
1064087Scindi #define	TOPO_METH_FMRI_ARG_NV2		"nv2"
1073062Scindi 
1083062Scindi #ifdef	__cplusplus
1093062Scindi }
1103062Scindi #endif
1113062Scindi 
1123062Scindi #endif	/* _TOPO_METHOD_H */
113