b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * CDDL HEADER START
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * The contents of this file are subject to the terms of the
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * Common Development and Distribution License (the "License").
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * You may not use this file except in compliance with the License.
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * See the License for the specific language governing permissions
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * and limitations under the License.
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * When distributing Covered Code, include this CDDL HEADER in each
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * If applicable, add the following below this CDDL HEADER, with the
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * fields enclosed by brackets "[]" replaced with your own identifying
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * information: Portions Copyright [yyyy] [name of copyright owner]
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * CDDL HEADER END
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephhstatic int fmd_enum(topo_mod_t *, tnode_t *, const char *, topo_instance_t,
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh topo_instance_t, void *, void *);
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephhstatic int fmd_fmri_nvl2str(topo_mod_t *, tnode_t *, topo_version_t,
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh { TOPO_METH_NVL2STR, TOPO_METH_NVL2STR_DESC, TOPO_METH_NVL2STR_VERSION,
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh * Turn on module debugging output
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh if (topo_mod_register(mod, &fmd_info, TOPO_VERSION) != 0) {
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh return (0);
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh/*ARGSUSED*/
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephhfmd_enum(topo_mod_t *mod, tnode_t *pnode, const char *name, topo_instance_t min,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Methods are registered, but there is no enumeration. Should
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * enumeration be added be sure to cater for global vs non-global
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh (void) topo_method_register(mod, pnode, fmd_methods);
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh return (0);
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh/*ARGSUSED*/
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh if (nvlist_lookup_string(nvl, FM_FMRI_FMD_NAME, &name) != 0)
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh return (0);
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh/*ARGSUSED*/
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephhfmd_fmri_nvl2str(topo_mod_t *mod, tnode_t *node, topo_version_t version,
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh if (topo_mod_nvalloc(mod, &fmristr, NV_UNIQUE_NAME) != 0) {
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh if (nvlist_add_string(fmristr, "fmri-string", name) != 0) {
b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8stephh return (0);