13faa91230bde46da937bf33010b9accc5bdeb59sd * CDDL HEADER START
13faa91230bde46da937bf33010b9accc5bdeb59sd * The contents of this file are subject to the terms of the
13faa91230bde46da937bf33010b9accc5bdeb59sd * Common Development and Distribution License (the "License").
13faa91230bde46da937bf33010b9accc5bdeb59sd * You may not use this file except in compliance with the License.
13faa91230bde46da937bf33010b9accc5bdeb59sd * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
13faa91230bde46da937bf33010b9accc5bdeb59sd * See the License for the specific language governing permissions
13faa91230bde46da937bf33010b9accc5bdeb59sd * and limitations under the License.
13faa91230bde46da937bf33010b9accc5bdeb59sd * When distributing Covered Code, include this CDDL HEADER in each
13faa91230bde46da937bf33010b9accc5bdeb59sd * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
13faa91230bde46da937bf33010b9accc5bdeb59sd * If applicable, add the following below this CDDL HEADER, with the
13faa91230bde46da937bf33010b9accc5bdeb59sd * fields enclosed by brackets "[]" replaced with your own identifying
13faa91230bde46da937bf33010b9accc5bdeb59sd * information: Portions Copyright [yyyy] [name of copyright owner]
13faa91230bde46da937bf33010b9accc5bdeb59sd * CDDL HEADER END
9c94f155585ea35e938fea603bc227c685223abdCheng Sean Ye * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
13faa91230bde46da937bf33010b9accc5bdeb59sd * Use is subject to license terms.
13faa91230bde46da937bf33010b9accc5bdeb59sd * sun4v specific zambezi enumerators
13faa91230bde46da937bf33010b9accc5bdeb59sdextern "C" {
13faa91230bde46da937bf33010b9accc5bdeb59sdstatic int zambezi_enum(topo_mod_t *, tnode_t *, const char *, topo_instance_t,
13faa91230bde46da937bf33010b9accc5bdeb59sd topo_instance_t, void *, void *);
13faa91230bde46da937bf33010b9accc5bdeb59sd {INTERCONNECT, FM_FMRI_SCHEME_HC, ZAMBEZI_VERSION, &zambezi_ops};
13faa91230bde46da937bf33010b9accc5bdeb59sd/*ARGSUSED*/
13faa91230bde46da937bf33010b9accc5bdeb59sd * Turn on module debugging output
13faa91230bde46da937bf33010b9accc5bdeb59sd topo_mod_dprintf(mod, "initializing zambezi enumerator\n");
13faa91230bde46da937bf33010b9accc5bdeb59sd if (topo_mod_register(mod, &zambezi_info, TOPO_VERSION) < 0) {
13faa91230bde46da937bf33010b9accc5bdeb59sd topo_mod_dprintf(mod, "zambezi registration failed: %s\n",
13faa91230bde46da937bf33010b9accc5bdeb59sd return; /* mod errno already set */
13faa91230bde46da937bf33010b9accc5bdeb59sd fmri = topo_mod_hcfmri(mod, parent, FM_HC_SCHEME_VERSION, name, i,
13faa91230bde46da937bf33010b9accc5bdeb59sd "Unable to make nvlist for %s bind: %s.\n",
13faa91230bde46da937bf33010b9accc5bdeb59sd "topo_node_bind (%s%d/%s%d) failed: %s\n",
13faa91230bde46da937bf33010b9accc5bdeb59sd if (topo_pgroup_create(ntn, &zambezi_auth_pgroup, &err) == 0) {
9c94f155585ea35e938fea603bc227c685223abdCheng Sean Ye (void) topo_prop_inherit(ntn, FM_FMRI_AUTHORITY,
13faa91230bde46da937bf33010b9accc5bdeb59sd/*ARGSUSED*/
13faa91230bde46da937bf33010b9accc5bdeb59sdzam_declare(tnode_t *parent, const char *name, topo_instance_t i,
13faa91230bde46da937bf33010b9accc5bdeb59sd if ((ntn = zam_tnode_create(mod, parent, name, i, NULL)) == NULL) {
13faa91230bde46da937bf33010b9accc5bdeb59sd /* inherit FRU from parent */
13faa91230bde46da937bf33010b9accc5bdeb59sd /* inherit parent's label */
13faa91230bde46da937bf33010b9accc5bdeb59sd /* set ASRU to resource fmri */
13faa91230bde46da937bf33010b9accc5bdeb59sd/*ARGSUSED*/
13faa91230bde46da937bf33010b9accc5bdeb59sdzambezi_enum(topo_mod_t *mod, tnode_t *rnode, const char *name,
13faa91230bde46da937bf33010b9accc5bdeb59sd topo_instance_t min, topo_instance_t max, void *notused, void *data)
13faa91230bde46da937bf33010b9accc5bdeb59sd "Currently only know how to enumerate %s components.\n",
13faa91230bde46da937bf33010b9accc5bdeb59sd return (0);
13faa91230bde46da937bf33010b9accc5bdeb59sd for (i = 0; i <= max; i++) {
13faa91230bde46da937bf33010b9accc5bdeb59sd return (-1);
13faa91230bde46da937bf33010b9accc5bdeb59sd return (0);