2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _TOPO_METHOD_H
2N/A#define _TOPO_METHOD_H
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#include <fm/topo_list.h>
2N/A
2N/Atypedef struct topo_imethod {
2N/A topo_list_t tim_list; /* next/prev pointers */
2N/A pthread_mutex_t tim_lock; /* method entry lock */
2N/A pthread_cond_t tim_cv; /* method entry cv */
2N/A uint_t tim_busy; /* method entry busy indicator */
2N/A char *tim_name; /* Method name */
2N/A topo_version_t tim_version; /* Method version */
2N/A topo_stability_t tim_stability; /* SMI stability of method */
2N/A char *tim_desc; /* Method description */
2N/A topo_method_f *tim_func; /* Method function */
2N/A struct topo_mod *tim_mod; /* Ptr to controlling module */
2N/A} topo_imethod_t;
2N/A
2N/Aextern int topo_method_call(tnode_t *, const char *, topo_version_t, nvlist_t *,
2N/A nvlist_t **, int *);
2N/Aextern topo_imethod_t *topo_method_lookup(tnode_t *, const char *);
2N/Aextern int topo_prop_method_version_register(tnode_t *, const char *,
2N/A const char *, topo_type_t, const char *, topo_version_t, const nvlist_t *,
2N/A int *);
2N/A
2N/A/*
2N/A * FMRI methods
2N/A */
2N/A#define TOPO_METH_ASRU_COMPUTE "topo_asru_compute"
2N/A#define TOPO_METH_FRU_COMPUTE "topo_fru_compute"
2N/A#define TOPO_METH_FMRI "topo_fmri"
2N/A#define TOPO_METH_NVL2STR "topo_nvl2str"
2N/A#define TOPO_METH_STR2NVL "topo_str2nvl"
2N/A#define TOPO_METH_COMPARE "topo_compare"
2N/A#define TOPO_METH_PROP_GET "topo_prop_get"
2N/A#define TOPO_METH_PGRP_GET "topo_pgrp_get"
2N/A#define TOPO_METH_PROP_SET "topo_prop_set"
2N/A#define TOPO_METH_FACILITY "topo_facility"
2N/A
2N/A#define METH_FMRI_VERSION0 0
2N/A#define METH_FMRI_VERSION1 1
2N/A#define TOPO_METH_FMRI_VERSION METH_FMRI_VERSION1
2N/A#define TOPO_METH_FRU_COMPUTE_VERSION 0
2N/A#define TOPO_METH_ASRU_COMPUTE_VERSION 0
2N/A#define TOPO_METH_NVL2STR_VERSION 0
2N/A#define TOPO_METH_STR2NVL_VERSION 0
2N/A#define TOPO_METH_COMPARE_VERSION 0
2N/A#define TOPO_METH_PROP_GET_VERSION 0
2N/A#define TOPO_METH_PGRP_GET_VERSION 0
2N/A#define TOPO_METH_PROP_SET_VERSION 0
2N/A#define TOPO_METH_FACILITY_VERSION 0
2N/A
2N/A#define TOPO_METH_ASRU_COMPUTE_DESC "Dynamic ASRU constructor"
2N/A#define TOPO_METH_FRU_COMPUTE_DESC "Dynamic FRU constructor"
2N/A#define TOPO_METH_FMRI_DESC "Dynamic FMRI constructor"
2N/A#define TOPO_METH_NVL2STR_DESC "FMRI to string"
2N/A#define TOPO_METH_STR2NVL_DESC "string to FMRI"
2N/A#define TOPO_METH_COMPARE_DESC "compare two FMRIs"
2N/A#define TOPO_METH_PROP_GET_DESC "get properties for FMRI"
2N/A#define TOPO_METH_PGRP_GET_DESC "get property group for FMRI"
2N/A#define TOPO_METH_PROP_SET_DESC "set properties for FMRI"
2N/A#define TOPO_METH_FACILITY_DESC "get facility for FMRI"
2N/A
2N/A#define TOPO_METH_COMPARE_RET "compare-return"
2N/A
2N/A#define TOPO_METH_FMRI_ARG_NAME "child-name"
2N/A#define TOPO_METH_FMRI_ARG_INST "child-inst"
2N/A#define TOPO_METH_FMRI_ARG_NVL "args"
2N/A#define TOPO_METH_FMRI_ARG_PARENT "parent-fmri"
2N/A#define TOPO_METH_FMRI_ARG_AUTH "auth"
2N/A#define TOPO_METH_FMRI_ARG_PART "part"
2N/A#define TOPO_METH_FMRI_ARG_REV "rev"
2N/A#define TOPO_METH_FMRI_ARG_SER "serial"
2N/A#define TOPO_METH_FMRI_ARG_HCS "hc-specific"
2N/A#define TOPO_METH_FMRI_ARG_FMRI "fmri"
2N/A#define TOPO_METH_FMRI_ARG_SUBFMRI "sub-fmri"
2N/A#define TOPO_METH_FMRI_ARG_NV1 "nv1"
2N/A#define TOPO_METH_FMRI_ARG_NV2 "nv2"
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _TOPO_METHOD_H */