/*
* 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
*/
/*
*/
#include "ses_impl.h"
static ses_node_t *
{
return ((ses_node_t *)np);
}
return (NULL);
}
/*
* ses_snap_primary_enclosure() finds the primary enclosure for
* the supplied ses_snap_t.
*/
{
return (ses_find_enclosure(sp, 0));
}
void
{
return;
}
}
static ses_node_t *
{
goto fail;
goto fail;
} else {
else
}
return (np);
fail:
return (NULL);
}
/*
* Parse element type descriptor.
*/
static int
{
int nverr;
return (0);
}
/*
* Build a skeleton tree of nodes in the given snapshot. This is the heart of
* libses, and is responsible for parsing the config page into a tree and
* populating nodes with data from the config page.
*/
static int
{
int i, j, n_etds = 0;
int err;
"configuration diagnostic page"));
"descriptors found"));
/*
* Start with the root of the tree, which is a target node, containing
* just the SCSI inquiry properties.
*/
return (-1);
break;
}
/*
* There should really be only one Enclosure element possible for a
* give subenclosure ID. The standard never comes out and says this,
* but it does describe this element as "managing the enclosure itself"
* which implies rather strongly that the subenclosure ID field is that
* of, well, the enclosure itself. Since an enclosure can't contain
* itself, it follows logically that each subenclosure has at most one
* Enclosure type descriptor elements matching its ID. Of course, some
* enclosure firmware is buggy, so this may not always work out; in
* this case we just ignore all but the first Enclosure-type element
* with our subenclosure ID.
*/
break;
return (-1);
sizeof (ses2_ed_hdr_impl_t),
break;
return (-1);
}
"descriptors found"));
break;
continue;
}
if (tip->sthi_max_elements == 0) {
} else {
}
if (tip->sthi_text_len > 0 &&
} else {
}
return (-1);
continue;
}
return (-1);
if (tip->sthi_text_len > 0 &&
} else {
}
return (-1);
if (tip->sthi_max_elements == 0)
continue;
for (j = 0; j < tip->sthi_max_elements; j++) {
return (-1);
SES_PROP_ELEMENT_ONLY_INDEX, eidx + j);
}
}
return (0);
}
static int
{
return (0);
if (ses_fill_node(np) != 0)
return (-1);
return (-1);
}
return (0);
}
int
{
if (ses_build_snap_skel(sp) != 0)
return (-1);
return (-1);
return (0);
}
{
}
{
return (np->sn_next_sibling);
}
{
return (np->sn_prev_sibling);
}
{
}
{
return (np->sn_first_child);
}
{
}
{
}
{
}
nvlist_t *
{
}
/*
* A node identifier is a (generation, index) tuple that can be used to lookup a
* node within this target at a later point. This will be valid across
* snapshots, though it will return failure if the generation count has changed.
*/
{
}