/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* SBP2 config ROM routines
*/
static int sbp2_cfgrom_parse_dir(sbp2_tgt_t *, void *,
static int sbp2_cfgrom_read_leaf(sbp2_tgt_t *, void *,
static void sbp2_cfgrom_dir_grow(sbp2_cfgrom_dir_t *, int);
static int sbp2_cfgrom_walk_impl(sbp2_cfgrom_ent_t *,
int (*)(void *, sbp2_cfgrom_ent_t *, int), void *, int);
static int sbp2_cfgrom_ent_by_key_walker(void *, sbp2_cfgrom_ent_t *,
int);
static void sbp2_cfgrom_walk_free(sbp2_cfgrom_ent_t *);
/* imitate throwing an exception when read fails */
goto rq_error; \
}
static int
{
int berr;
int ret;
if (tm < sbp2_cfgrom_read_delay) {
}
*q = SBP2_SWAP32(*q);
return (ret);
}
int
{
void *cmd;
int ret;
return (ret);
}
return (ret);
}
/* parse root directory and everything underneath */
}
return (ret);
}
/*
* Caller must initialize pa and pa->pa_dir.
*/
static int
{
uint8_t t, k; /* key type and value */
uint32_t v; /* entry value */
int i;
int ret = 0;
/* read directory entry and initialize the structure */
/* walk directory entries */
CFGROM_TYPE_KEY_VALUE(entry, t, k, v);
switch (t) {
case IEEE1212_IMMEDIATE_TYPE:
break;
case IEEE1212_CSR_OFFSET_TYPE:
break;
case IEEE1212_LEAF_TYPE:
/* text leaf describes preceding entry */
} else {
/* text directory describes preceding entry */
}
break;
case IEEE1212_DIRECTORY_TYPE:
}
break;
default:
ASSERT(0);
}
}
return (ret);
}
static int
{
int ret;
int i;
/* header */
addr += 4;
/* verify data length */
return (SBP2_EDATA);
}
/* data */
}
return (ret);
}
return (ret);
}
static int
{
int ret;
int i;
/* header */
addr += 4;
/* verify data length */
return (SBP2_EDATA);
}
/* data */
}
return (ret);
}
/*ARGSUSED*/
static void
{
}
}
static void
{
void *new_ent;
}
}
static sbp2_cfgrom_ent_t *
{
/* grow if out of entries */
}
}
/*
* walk Config ROM entries calling the specified function for each
*/
void
{
}
static int
{
int i;
return (SBP2_WALK_STOP);
}
return (SBP2_WALK_STOP);
}
}
}
return (SBP2_WALK_CONTINUE);
}
{
}
/*ARGSUSED*/
static int
{
return (SBP2_WALK_STOP);
}
}
return (SBP2_WALK_CONTINUE);
}
void
{
}
static void
{
int i;
sbp2_cfgrom_walk_free(&ent[i]);
}
}
if (ent) {
}
}