ses2_pages.c revision 275c9da86e89f8abf71135cf63d9fc23671b2e60
/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stddef.h>
#include <strings.h>
#include <scsi/libses_plugin.h>
#include "ses2_impl.h"
static int
{
return (0);
return (0);
}
/*ARGSUSED*/
static void *
{
int i, pos;
&index) == 0);
&type) == 0);
return (0);
/*
* Because, according to 6.1.13.1, the element index "does not
* include the OVERALL STATUS fields", we have to go recompute the
* index of this element each time. This, naturally, is a linear
* exercise as well.
*/
--index;
break;
sizeof (dep->sadei_length);
break;
type != SES_ET_DEVICE &&
type != SES_ET_ARRAY_DEVICE) {
/*
* We can't really do anything with this, because
* while the standard requires that these descriptors
* be in the same order as those in the status page,
* some element types may optionally include AES
* data. This means we cannot know which element
* this descriptor refers to unless EIP is 1. Sadly,
* the standard only says that this "should" be true.
* It's impossible to guess what use this is supposed
* to have otherwise. See 6.1.13.1.
*/
continue;
continue;
return (dep);
}
}
return (NULL);
}
/*ARGSUSED*/
static void *
{
&index) == 0);
*len = sizeof (ses2_threshold_impl_t);
return (NULL);
}
/*ARGSUSED*/
static void *
{
int i;
return (NULL);
return (NULL);
/*
* This variable-length list of variable-length strings format sucks
* for performance; we ALWAYS have to walk the whole bloody thing to
* find a particular node's entry.
*/
i < index; i++) {
return (NULL);
}
return (NULL);
if (!SES_WITHIN_PAGE(dp,
return (NULL);
return (dp->sedi_descriptor);
}
/*ARGSUSED*/
static void *
{
&index) != 0)
return (NULL);
return (NULL);
*len = sizeof (ses2_elem_status_impl_t);
}
/*ARGSUSED*/
static size_t
{
return (nelem * sizeof (ses2_elem_ctl_impl_t) +
}
/*ARGSUSED*/
static void *
ses_node_t *np)
{
void *data;
&index) != 0) {
"for enclosure node");
return (NULL);
}
return (NULL);
return (data);
}
/*ARGSUSED*/
static size_t
{
}
/*ARGSUSED*/
static size_t
{
return (nelem * sizeof (ses2_threshold_impl_t) +
}
/*ARGSUSED*/
static void *
ses_node_t *np)
{
void *data;
&index) == 0);
return (NULL);
return (data);
}
/*ARGSUSED*/
static size_t
{
return (datalen +
}
/*ARGSUSED*/
static size_t
{
}
/*ARGSUSED*/
static void *
ses_node_t *np)
{
(void) ses_error(ESES_BAD_TYPE,
"microcode download page only valid for enclosure "
"nodes");
return (NULL);
}
return (data);
}
/*ARGSUSED*/
static size_t
{
return (sizeof (ses2_subnick_ctl_page_impl_t));
}
ses_pagedesc_t ses2_pages[] = {
{
.spd_gcoff = -1
},
{
},
{
},
{
.spd_gcoff = -1
},
{
.spd_gcoff = -1
},
{
.spd_gcoff =
},
{
},
{
},
{
},
{
.spd_gcoff =
},
{
.spd_gcoff = -1
},
{
.spd_gcoff =
},
{
.spd_gcoff =
},
/* Control pages */
{
},
{
.spd_gcoff = -1
},
{
.spd_gcoff =
},
{
.spd_gcoff =
},
{
.spd_gcoff =
},
{
.spd_gcoff =
},
{
.spd_pagenum = -1,
.spd_gcoff = -1
}
};