gptwo_wci.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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* WCI Functions to the Safari Configurator
*
*/
#include <sys/autoconf.h>
#include <sys/ndi_impldefs.h>
#include <sys/ddi_impldefs.h>
#include <sys/machsystm.h>
#include <sys/gptwo_wci.h>
#ifdef DEBUG
int gptwo_wci_debug = 0;
if (gptwo_wci_debug >= level) \
#else
#endif
void gptwocfg_devi_attach_to_parent(dev_info_t *);
/*
* Module linkage information for the kernel.
*/
extern struct mod_ops mod_miscops;
&mod_miscops, /* Type of module */
"gptwo->wci configurator %I%",
};
static struct modlinkage modlinkage = {
};
#ifndef lint
#endif
int
_init(void)
{
int err = 0;
/* register devices with the configurator */
"failed to load, error=%d\n", err);
} else {
"has been loaded.\n");
}
return (err);
}
int
_fini(void)
{
return (mod_remove(&modlinkage));
}
int
{
}
/*ARGSUSED*/
static int
{
return (DDI_WALK_ERROR);
}
return (DDI_WALK_TERMINATE);
}
/*ARGSUSED*/
static void
{
}
{
char unit_address[64];
devi_branch_t b = {0};
"Can not be probed\n", id);
return (NULL);
}
b.type = DEVI_BRANCH_SID;
/*
* Prevent any changes to new_child
* until we have bound it to the correct driver.
*/
"gptwo_configure_wci: failed "
"to alloc child node\n");
"No nodes configured - "
"removing new_nodes\n");
}
return (new_nodes);
}
/*
* The platform DR interfaces created the dip in
* bound state. Bring devinfo node down to linked
* state and hold it there until compatible
* properties are created.
*/
/*
* Drop the busy-hold on parent before calling
* fcode_interpreter to prevent potential deadlocks
*/
unit_address, NULL);
"gptwocfg: Calling Fcode Interpeter...\n");
"gptwo_configure_wci: fcode_interpreter "
" returned %x\n", error);
if (error) {
"%s\n", unit_address);
} else {
/*
* Compatible properties (if any) have been created,
* so bind driver.
*/
" new wci child at dip=0x%p\n", new_child);
}
}
"No nodes configured - removing new_nodes\n");
}
"Returning new_nodes=%p\n", new_nodes);
return (new_nodes);
}
{
if (fco_handle != NULL) {
/*
* If there is a handle, there may be resources
* that need to be freed from when the
* devices's fcode ran.
*/
}
return (NULL);
}
#ifdef DEBUG
static void
{
}
#endif