7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER START
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 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * See the License for the specific language governing permissions
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * and limitations under the License.
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 * CDDL HEADER END
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Topology Plugin Modules
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Topology plugin modules are shared libraries that are dlopen'd and
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * used to enumerate resources in the system and export per-node method
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * operations.
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * They are loaded by our builtin scheme-specific plugins, other modules or
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * by processing a topo map XML file to enumerate and create nodes for
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * resources that are present in the system. They may also export a set of
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * topology node specific methods that can be invoked directly via
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * topo_method_invoke() or indirectly via the
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * topo_prop_get* family of functions to access dynamic property data.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Module Plugin API
24db46411fd54f70c35b94bb952eb7ba040e43b4eschrock * Enumerators must provide entry points for initialization and clean-up
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * (_topo_init() and _topo_fini()). In their _topo_init() function, an
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * enumerator should register (topo_mod_register()) its enumeration callback
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * and allocate resources required for a subsequent call to the callback.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Optionally, methods may also be registered with topo_method_register().
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * In its enumeration callback routine, the module should search for resources
24db46411fd54f70c35b94bb952eb7ba040e43b4eschrock * within its realm of responsibility and create any node ranges,
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * topo_node_range_create() and nodes, topo_node_bind(). The Enumerator
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * module is handed a node to which it may begin attaching additional
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * topology nodes. The enumerator may only access those nodes within its
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * current scope of operation: the node passed into its enumeration op and
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * any nodes it creates during enumeration. If the enumerator requires walker-
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * style access to these nodes, it must use
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * topo_mod_walk_init()/topo_walk_step()/topo_walk_fini().
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * If additional helper modules need to be loaded to complete the enumeration
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * the module may do so by calling topo_mod_load(). Enumeration may then
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * continue with the module handing off enumeration to its helper module
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * by calling topo_mod_enumerate(). Similarly, a module may call
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * topo_mod_enummap() to kick-off enumeration according to a given XML
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * topology map file. A module *may* not cause re-entrance to itself
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * via either of these interfaces. If re-entry is detected an error
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * will be returned (ETOPO_ENUM_RECURS).
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * If the module registers a release callback, it will be called on a node
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * by node basis during topo_snap_rele(). Any private node data may be
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * deallocated or methods unregistered at that time. Global module data
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * should be cleaned up before or at the time that the module _topo_fini
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * entry point is called.
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * Module entry points and method invocations are guaranteed to be
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * single-threaded for a given snapshot handle. Applications may have
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * more than one topology snapshot open at a time. This means that the
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * module operations and methods may be called for different module handles
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * (topo_mod_t) asynchronously. The enumerator should not use static or
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * global data structures that may become inconsistent in this situation.
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * Method operations may be re-entrant if the module invokes one of its own
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * methods directly or via dynamic property access. Caution should be
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * exercised with method operations to insure that data remains consistent
c40d7343efa60b18ad1ceb316eb337caeea79046cindi * within the module and that deadlocks can not occur.
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * Already loaded, topo_mod_lookup will bump the ref count
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi path = topo_search_path(pmod, thp->th_rootdir, (const char *)file);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (mod = topo_modhash_load(thp, name, path, &topo_rtld_ops, version))
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi "module registration failed for %s: %s\n",
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditopo_mod_register(topo_mod_t *mod, const topo_modinfo_t *mip,
c40d7343efa60b18ad1ceb316eb337caeea79046cindi if ((mod->tm_info = topo_mod_zalloc(mod, sizeof (topo_imodinfo_t)))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi mod->tm_info->tmi_desc = topo_mod_strdup(mod, mip->tmi_desc);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi mod->tm_info->tmi_scheme = topo_mod_strdup(mod, mip->tmi_scheme);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi mod->tm_info->tmi_version = (topo_version_t)mip->tmi_version;
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi mod->tm_info->tmi_ops->tmo_enum = mip->tmi_ops->tmo_enum;
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi mod->tm_info->tmi_ops->tmo_release = mip->tmi_ops->tmo_release;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (0);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi topo_mod_free(mod, mod->tm_info, sizeof (topo_imodinfo_t));
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditopo_mod_enumerate(topo_mod_t *mod, tnode_t *node, const char *enum_name,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi const char *name, topo_instance_t min, topo_instance_t max, void *data)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if ((enum_mod = topo_mod_lookup(mod->tm_hdl, enum_name, 0)) == NULL)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi topo_dprintf(mod->tm_hdl, TOPO_DBG_MODSVC, "module %s enumerating "
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi "node %s=%d\n", (char *)mod->tm_name, (char *)node->tn_name,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi err = enum_mod->tm_info->tmi_ops->tmo_enum(enum_mod, node, name, min,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi if (err != 0) {
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi "module %s failed enumeration for "
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (-1);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (0);
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditopo_mod_enummap(topo_mod_t *mod, tnode_t *node, const char *name,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi const char *scheme)
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robj return (topo_file_load(mod, node, (char *)name, (char *)scheme, 0));
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditopo_mod_hcfmri(topo_mod_t *mod, tnode_t *pnode, int version, const char *name,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi topo_instance_t inst, nvlist_t *hc_specific, nvlist_t *auth,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi const char *part, const char *rev, const char *serial)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * Do we have any args to pass?
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (pnode != NULL || auth != NULL || part != NULL || rev != NULL ||
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (topo_mod_nvalloc(mod, &args, NV_UNIQUE_NAME) != 0)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (nvlist_add_nvlist(args, TOPO_METH_FMRI_ARG_PARENT,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * Add optional payload
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (void) nvlist_add_nvlist(args, TOPO_METH_FMRI_ARG_AUTH, auth);
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost lpart = topo_cleanup_auth_str(mod->tm_hdl, part);
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost (void) nvlist_add_string(args, TOPO_METH_FMRI_ARG_PART,
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost topo_hdl_free(mod->tm_hdl, lpart, strlen(lpart) + 1);
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost (void) nvlist_add_string(args, TOPO_METH_FMRI_ARG_PART,
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost lrev = topo_cleanup_auth_str(mod->tm_hdl, rev);
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost (void) nvlist_add_string(args, TOPO_METH_FMRI_ARG_REV,
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost topo_hdl_free(mod->tm_hdl, lrev, strlen(lrev) + 1);
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost (void) nvlist_add_string(args, TOPO_METH_FMRI_ARG_REV,
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost lserial = topo_cleanup_auth_str(mod->tm_hdl, serial);
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost (void) nvlist_add_string(args, TOPO_METH_FMRI_ARG_SER,
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost (void) nvlist_add_string(args, TOPO_METH_FMRI_ARG_SER,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (void) nvlist_add_nvlist(args, TOPO_METH_FMRI_ARG_HCS,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if ((fmri = topo_fmri_create(mod->tm_hdl, FM_FMRI_SCHEME_HC, name, inst,
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditopo_mod_devfmri(topo_mod_t *mod, int version, const char *dev_path,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi const char *devid)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (topo_mod_nvalloc(mod, &args, NV_UNIQUE_NAME) != 0)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (nvlist_add_string(args, FM_FMRI_DEV_PATH, dev_path) != 0) {
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (void) nvlist_add_string(args, FM_FMRI_DEV_ID, devid);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if ((fmri = topo_fmri_create(mod->tm_hdl, FM_FMRI_SCHEME_DEV,
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditopo_mod_cpufmri(topo_mod_t *mod, int version, uint32_t cpu_id, uint8_t cpumask,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi const char *serial)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (topo_mod_nvalloc(mod, &args, NV_UNIQUE_NAME) != 0)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (nvlist_add_uint32(args, FM_FMRI_CPU_ID, cpu_id) != 0) {
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * Add optional payload
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (void) nvlist_add_uint8(args, FM_FMRI_CPU_MASK, cpumask);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (void) nvlist_add_string(args, FM_FMRI_CPU_SERIAL_ID, serial);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if ((fmri = topo_fmri_create(mod->tm_hdl, FM_FMRI_SCHEME_CPU,
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditopo_mod_memfmri(topo_mod_t *mod, int version, uint64_t pa, uint64_t offset,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (topo_mod_nvalloc(mod, &args, NV_UNIQUE_NAME) != 0)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi err = nvlist_add_string(args, FM_FMRI_MEM_UNUM, unum);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi err |= nvlist_add_uint64(args, FM_FMRI_MEM_PHYSADDR, pa);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi err |= nvlist_add_uint64(args, FM_FMRI_MEM_OFFSET, offset);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (err != 0) {
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if ((fmri = topo_fmri_create(mod->tm_hdl, FM_FMRI_SCHEME_MEM,
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditopo_mod_pkgfmri(topo_mod_t *mod, int version, const char *path)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (topo_mod_nvalloc(mod, &args, NV_UNIQUE_NAME) != 0)
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi if ((fmri = topo_fmri_create(mod->tm_hdl, FM_FMRI_SCHEME_PKG,
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditopo_mod_modfmri(topo_mod_t *mod, int version, const char *driver)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (topo_mod_nvalloc(mod, &args, NV_UNIQUE_NAME) != 0)
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi if ((fmri = topo_fmri_create(mod->tm_hdl, FM_FMRI_SCHEME_MOD,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby ((val) ? (nvlist_add_string(nvl, name, val) != 0) : 0)
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby char *obj_path, char *obj_root, nvlist_t *obj_pkg,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby char *site_token, char *site_module, char *site_file, char *site_func,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby int64_t site_line, char *ctxt_origin, char *ctxt_execname,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby int64_t ctxt_pid, char *ctxt_zone, int64_t ctxt_ctid,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby if (topo_mod_nvalloc(mod, &args, NV_UNIQUE_NAME) != 0)
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= _SWFMRI_ADD_STRING(args, "obj_path", obj_path);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= _SWFMRI_ADD_STRING(args, "obj_root", obj_root);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= nvlist_add_nvlist(args, "obj_pkg", obj_pkg);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= _SWFMRI_ADD_STRING(args, "site_token", site_token);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= _SWFMRI_ADD_STRING(args, "site_module", site_module);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= _SWFMRI_ADD_STRING(args, "site_file", site_file);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= _SWFMRI_ADD_STRING(args, "site_func", site_func);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= nvlist_add_int64(args, "site_line", site_line);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= _SWFMRI_ADD_STRING(args, "ctxt_origin", ctxt_origin);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= _SWFMRI_ADD_STRING(args, "ctxt_execname", ctxt_execname);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= nvlist_add_int64(args, "ctxt_pid", ctxt_pid);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= _SWFMRI_ADD_STRING(args, "ctxt_zone", ctxt_zone);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= nvlist_add_int64(args, "ctxt_ctid", ctxt_ctid);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby if (ctxt_stack != NULL && ctxt_stackdepth != 0)
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby err |= nvlist_add_string_array(args, "stack", ctxt_stack,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby if ((fmri = topo_fmri_create(mod->tm_hdl, FM_FMRI_SCHEME_SW,
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditopo_mod_str2nvl(topo_mod_t *mod, const char *fmristr, nvlist_t **fmri)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (topo_fmri_str2nvl(mod->tm_hdl, fmristr, &np, &err) < 0)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi return (0);
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditopo_mod_nvl2str(topo_mod_t *mod, nvlist_t *fmri, char **fmristr)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (topo_fmri_nvl2str(mod->tm_hdl, fmri, &sp, &err) < 0)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi return (0);
81d9f076db88c1f40c85831ce1ebb444a209c5a8Robert Johnston if ((thp->th_ipmi = ipmi_open(&err, &errmsg, IPMI_TRANSPORT_BMC,
0b1b4412cfd6c4ac5467dbe6f4088dcec4f55fe8Eric Schrock (void) pthread_mutex_unlock(&thp->th_ipmi_lock);
0b1b4412cfd6c4ac5467dbe6f4088dcec4f55fe8Eric Schrock (void) pthread_mutex_unlock(&thp->th_ipmi_lock);
738c43b514a3570e657652233a5a19291a328a28Eric Schrock thp->th_smbios = smbios_open(NULL, SMB_VERSION, 0, NULL);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*PRINTFLIKE2*/
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditopo_mod_dprintf(topo_mod_t *mod, const char *format, ...)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi topo_vdprintf(mod->tm_hdl, TOPO_DBG_MOD, (const char *)mod->tm_name,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindistatic char *
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi return (topo_mod_strdup(mod, mod->tm_hdl->th_product));
0eb822a1c0c2bea495647510b75f77f0e57633ebcindistatic char *
9c94f155585ea35e938fea603bc227c685223abdCheng Sean Ye return (topo_cleanup_auth_str(mod->tm_hdl, psn));
0eb822a1c0c2bea495647510b75f77f0e57633ebcindistatic char *
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi } else if ((rooth = topo_mod_devinfo(mod)) != DI_NODE_NIL &&
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (promh = topo_mod_prominfo(mod)) != DI_PROM_HANDLE_NIL) {
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (di_prom_prop_lookup_bytes(promh, rooth, "chassis-sn",
12cc75c814f0c017004a9bbc96429911e008601bcindi if ((err = topo_mod_nvalloc(mod, &auth, NV_UNIQUE_NAME)) != 0) {
9c94f155585ea35e938fea603bc227c685223abdCheng Sean Ye (void) topo_prop_get_string(pnode, FM_FMRI_AUTHORITY,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * Let's do this the hard way
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * No luck, return NULL
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi err |= nvlist_add_string(auth, FM_FMRI_AUTH_PRODUCT, prod);
9c94f155585ea35e938fea603bc227c685223abdCheng Sean Ye err |= nvlist_add_string(auth, FM_FMRI_AUTH_PRODUCT_SN, psn);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi err |= nvlist_add_string(auth, FM_FMRI_AUTH_SERVER, server);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi err |= nvlist_add_string(auth, FM_FMRI_AUTH_CHASSIS, csn);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if (err != 0) {
c40d7343efa60b18ad1ceb316eb337caeea79046cinditopo_mod_walk_init(topo_mod_t *mod, tnode_t *node, topo_mod_walk_cb_t cb_f,
c40d7343efa60b18ad1ceb316eb337caeea79046cindi if ((wp = topo_node_walk_init(thp, mod, node, (int (*)())cb_f, pdata,