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) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A/*
2N/A * Create a topology node for a top level PRI node, one that is a child
2N/A * of the 'components' node.
2N/A */
2N/A#include <sys/types.h>
2N/A#include <strings.h>
2N/A#include <sys/fm/protocol.h>
2N/A#include <fm/topo_mod.h>
2N/A#include <fm/topo_hc.h>
2N/A#include "pi_impl.h"
2N/A
2N/A#define _ENUM_NAME "enum_top"
2N/A
2N/A/*
2N/A * This enumerator is the same as the generic enumerator, except that when
2N/A * the FMRI is created, the parent node must be NULL. This is true for all
2N/A * top level nodes.
2N/A */
2N/Aint
2N/Api_enum_top(topo_mod_t *mod, md_t *mdp, mde_cookie_t mde_node,
2N/A topo_instance_t inst, tnode_t *t_parent, const char *hc_name,
2N/A tnode_t **t_node)
2N/A{
2N/A int result;
2N/A
2N/A /*
2N/A * This is a top-level topology node and there is no resource data
2N/A * from which to generate an FMRI. We use a NULL value for the FMRI
2N/A * parent when creating the FMRI for this node so that the underlying
2N/A * libtopo method does not fail.
2N/A */
2N/A result = pi_enum_generic_impl(mod, mdp, mde_node, inst, t_parent,
2N/A NULL, hc_name, _ENUM_NAME, t_node, 0);
2N/A return (result);
2N/A}