/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/*
* Some topology creation routines may need to defer completing enumeration
* until after the entire PRI graph has been visited. This file includes
* the interfaces necessary to permit these routines to do this in a general
* way.
*/
#include <stddef.h>
#include <inttypes.h>
#include <strings.h>
#include <string.h>
#include <libuutil.h>
#include <libnvpair.h>
#include <fm/topo_mod.h>
#include "pi_impl.h"
struct pi_defernode_s {
};
/* Routines to handle the list of topology parents and mde_nodes */
static int pi_deferlist_create(topo_mod_t *);
static int pi_deferlist_compare(const void *, const void *, void *);
/*
* Add a new routine to the list of deferred enumeration routines
*/
int
{
int result;
if (defer_list == NULL) {
if (result != 0) {
return (result);
}
}
/*
* Create a data structure to store information about the node for
* which to defer enumeration. The defer_pool is created by the
* list creation routine, above.
*/
return (-1);
}
return (0);
}
/*
* Execute the list of deferred enumeration routines, destroying the list as
* we go.
*/
int
{
int result;
void *dvp;
void *private;
char *hc_name;
if (defer_list == NULL) {
return (0);
}
/* Extract the necessary information from the defernode_t */
/*
* Remove the element from the list. Once we are done calling
* the routine we do not need it any more.
*/
/* Get the instance value from the mde node */
/* Move on to the next node */
continue;
}
/* Get the hc name from the mde node */
"deferred node_0x%llx has invalid NULL hc_name\n",
/* Move on to the next node */
continue;
}
"calling deferred enumerator for node_0x%llx\n",
/* Call the deferred enumeration function */
if (result != 0) {
"deferred enumeration for node_0x%llx failed\n",
}
/* Clean up from the deferred call */
}
defer_list = NULL;
defer_pool = NULL;
return (0);
}
static int
{
/* Initialize the uutil list structure */
pi_deferlist_compare, 0);
if (defer_pool == NULL) {
return (-1);
}
if (defer_list == NULL) {
defer_pool = NULL;
return (-1);
}
return (0);
}
/* ARGSUSED */
static int
{
return (1);
}
return (-1);
}
return (0);
}