sbdp_dr.c revision 03831d35f7499c87d51205817c93e9a8d42c4bae
/*
* 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
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/autoconf.h>
#include <sys/ndi_impldefs.h>
#include <sys/ddi_impldefs.h>
#include <sys/sgsbbc_mailbox.h>
#include <vm/seg_kmem.h>
#include <sys/prom_plat.h>
#include <sys/machsystm.h>
#include <sys/cheetahregs.h>
#include <sys/sbd_ioctl.h>
#include <sys/sbdp_priv.h>
static int sbdp_detach_nodes(attach_pkt_t *);
static void
void *arg)
{
/*
* Ignore return value from callback. Return value from callback
* does NOT indicate subsequent walk behavior.
*/
if (node != OBP_NONODE) {
}
}
struct sbdp_walk_prom_tree_args {
void *arg;
};
/*ARGSUSED*/
static int
{
return (0);
}
void
{
struct sbdp_walk_prom_tree_args arg_block;
arg_block.f = f;
}
static void
{
static int err = 0;
static int len = 0;
char name[OBP_MAXDRVNAME];
#if OBP_MAXDRVNAME == OBP_MAXPROPNAME
#else
char buf[OBP_MAXPROPNAME];
#endif
static fn_t f = "sbdp_attach_branch";
SBDP_DBG_FUNC("%s\n", f);
if (node == OBP_NONODE)
return;
/*
* Get the status for this node
* If it has failed we imitate boot by not creating a node
* in solaris. We just warn the user
*/
SBDP_DBG_STATE("status failed skipping this node\n");
return;
}
if (len <= 0) {
return;
}
if (err != NDI_SUCCESS) {
return;
}
if (err != NDI_SUCCESS) {
return;
}
if (child != OBP_NONODE) {
for (; child != OBP_NONODE;
}
}
}
static int
{
int node;
static fn_t f = "sbdp_find_ssm_dip";
SBDP_DBG_FUNC("%s\n", f);
SBDP_DBG_STATE("error on the argument\n");
return (DDI_WALK_CONTINUE);
}
"nodeid", -1)) == -1)
return (DDI_WALK_CONTINUE);
return (DDI_WALK_TERMINATE);
}
return (DDI_WALK_CONTINUE);
}
/*ARGSUSED*/
int
{
char devtype[OBP_MAXDRVNAME];
char devname[OBP_MAXDRVNAME];
int i;
int wnode;
static fn_t f = "sbdp_select_top_nodes";
SBDP_DBG_FUNC("%s\n", f);
SBDP_DBG_STATE("error on the argument\n");
return (DDI_FAILURE);
}
return (DDI_FAILURE);
return (DDI_FAILURE);
apktp->num_of_nodes++;
/* We want this node */
return (DDI_SUCCESS);
}
int cpuid;
int impl;
/*
* Check the status of the cpu
* If it is failed ignore it
*/
return (DDI_FAILURE);
return (DDI_WALK_TERMINATE);
}
}
return (DDI_WALK_TERMINATE);
/*
* If it is a CPU under CMP, don't save
* the node as we will be saving the CMP
* node.
*/
if (CPU_IMPL_IS_CMP(impl))
return (DDI_FAILURE);
}
/*
* Check to make sure we haven't run out of bounds
*/
return (DDI_FAILURE);
/* Save node */
apktp->num_of_nodes++;
/* We want this node */
return (DDI_SUCCESS);
}
}
return (DDI_FAILURE);
}
void
{
devi_branch_t b = {0};
static fn_t f = "sbdp_attach_bd";
SBDP_DBG_FUNC("%s\n", f);
apktp->num_of_nodes = 0;
/*
* Root node doesn't have to be held for ddi_walk_devs()
*/
SBDP_DBG_STATE("BAD Serengeti\n");
return;
}
b.type = DEVI_BRANCH_PROM;
b.devi_branch_callback = NULL;
/*
* Release hold acquired in sbdp_find_ssm_dip()
*/
}
int
{
int rv;
static fn_t f = "sbdp_detach_bd";
SBDP_DBG_FUNC("%s\n", f);
apktp->num_of_nodes = 0;
(void *) apktp);
return (rv);
}
/*
* Clean up this board struct
*/
return (0);
}
static int
{
dev_info_t **dip;
int dev_list_len = 0;
int i, rv = 0;
KM_SLEEP);
/*
* The branch rooted at dip should already be held,
* so release hold acquired in e_ddi_nodeid_to_dip()
*/
dip++;
++dev_list_len;
}
}
if (rv) {
/*
* If non-NULL, fdip is held and must be released.
*/
} else {
}
break;
}
}
return (rv);
}