/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Safari Configurator (gptwocfg)
*
*/
#include <sys/autoconf.h>
#include <sys/ndi_impldefs.h>
#include <sys/ddi_impldefs.h>
#include <sys/machsystm.h>
#include <sys/platform_module.h>
#ifdef DEBUG
int gptwocfg_debug = 0;
if (gptwocfg_debug >= level) \
#else
#endif
static gptwo_new_nodes_t *
extern caddr_t efcode_vaddr;
extern int efcode_size;
/*
* Module linkage information for the kernel.
*/
extern struct mod_ops mod_miscops;
&mod_miscops, /* Type of module */
"gptwo configurator",
};
};
int
_init(void)
{
unsigned int i;
"has been loaded\n");
for (i = 0; i < GPTWO_NUMBER_OF_DEVICE_TYPES; i++)
gptwocfg_ops_table[i] = NULL;
return (mod_install(&modlinkage));
}
int
_fini(void)
{
int error;
if (error != 0) {
return (error);
}
return (0);
}
int
{
}
{
int size;
size = sizeof (gptwo_new_nodes_t) +
return (gptwo_new_nodes);
}
void
{
int size;
size = sizeof (gptwo_new_nodes_t) +
sizeof (dev_info_t *));
}
void
{
/* KM_SLEEP guarantees success */
}
void
{
}
{
/*
* Look to see if the port is already configured.
*/
if (&starcat_dr_name) {
continue;
}
}
"0x%x Port already configured\n", id);
return (NULL);
}
}
return (NULL);
}
"Configuration Descriptor\n");
return (NULL);
}
return (NULL);
}
"gptwocfg: Agent at ID %x has not passed test(s)\n", id);
return (NULL);
}
return (NULL);
}
return (NULL);
}
/*
* put config on config list
*/
} else {
}
return ((gptwocfg_cookie_t)config);
}
{
int i, circ;
int failure = 0;
break;
}
}
/*
* There is no config structure associated with this agent id
* so it was probably built by firmware at start of day. We
* need to create a config structure before we can continue.
*/
"No config structure - Need to build one\n", id);
KM_SLEEP);
/*
* put config on config list
*/
} else {
"No OBP created nodes for ap=0x%lx agent id=0x%x",
return (NULL);
}
}
config);
saf_dip);
"skipping NULLL saf device\n");
continue;
}
if (ops) {
"ops->gptwocfg_configure=%lx\n",
"ops->gptwocfg_unconfigure=%lx\n",
}
}
/*
* Don't hold parent busy when calling
*/
/*
* If non-NULL, fdip is held and must be released.
*/
} else {
}
failure = 1;
}
}
if (!failure) {
if (gptwo_config_list == config) {
} else {
}
}
}
return (config);
}
int
{
int i, j;
cookie = (gptwocfg_config_t *)c;
}
i++) {
*next);
return (1);
}
}
return (0);
}
for (j = i + 1;
j++) {
*next =
"returned 0x%lx\n", *next);
return (1);
}
}
*next);
return (1);
}
}
/*
* previous is probably an invalid dev_info.
*/
return (0);
}
static gptwo_new_nodes_t *
{
int i = 0, nodes = 0;
int circular_count;
/*
* First go through all the children of the attachment point
* to count matching safari agent ids
*/
if (&starcat_dr_name) {
< 0) {
continue;
}
}
nodes++;
}
}
"found\n", nodes);
/*
* Then fill in the nodes structure.
*/
if (&starcat_dr_name) {
< 0) {
continue;
}
}
/*
* Branch rooted at this dip must have been
* held by the DR driver.
*/
}
}
"Returning 0x%lx\n", obp_nodes);
return (obp_nodes);
}
void
{
h->next = gptwocfg_handle_list;
h->fco_handle = fco_handle;
gptwocfg_handle_list = h;
}
{
h = last = gptwocfg_handle_list;
while (h != NULL) {
if (h == gptwocfg_handle_list)
gptwocfg_handle_list = h->next;
else
fco_handle = h->fco_handle;
kmem_free(h, sizeof (gptwocfg_handle_list_t));
return (fco_handle);
}
last = h;
h = h->next;
}
dip);
return (0);
}
void
{
}
#ifdef DEBUG
static void
{
}
#endif