/*
* 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 <stddef.h>
#include <strings.h>
#include <scsi/libses_plugin.h>
#include "ses2_impl.h"
static int
{
return (0);
return (0);
}
/*ARGSUSED*/
static void *
{
&eo_index) == 0);
&cl_index) == 0);
&type) == 0);
return (0);
/*
* Checking if AES page contains the class index or not.
* The AES page should contain the element only index
* which spans different element types.
* J4410 enclosure AES page contains the class element index
* and we work around it by checking the parent node and its
* sibling and count the number of elements that should
* have the AES data.
*/
break;
sizeof (dep->sadei_length);
break;
if (dep->sadei_element_index == 0) {
if (!zero_index_detected) {
} else {
break;
}
}
}
/*
* If the specified element index is the class index
* check if the parent node and its siblings are one of types,
* Array Device, Device, ESC electronincs, initiator port, target
* port or SAS expander. The count indicates the type of the element
* that is associated with the AES data that is being probed.
*/
if (found_class_index) {
SES_PROP_ELEMENT_TYPE, &unctype) == 0);
if ((unctype == SES_ET_DEVICE) ||
(unctype == SES_ET_ESC_ELECTRONICS) ||
(unctype == SES_ET_SCSI_TARGET_PORT) ||
(unctype == SES_ET_SCSI_INITIATOR_PORT) ||
(unctype == SES_ET_ARRAY_DEVICE) ||
(unctype == SES_ET_SAS_EXPANDER))
clcount++;
}
pos = 0, i = 0, c = 0;
i++) {
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;
if (dep->sadei_element_index == 0) {
c++; /* increment class counter. */
i = 0; /* reset index counter. */
}
if ((clcount == c) &&
(i == cl_index))) {
return (dep);
} else {
continue;
}
} else {
continue;
}
}
} else {
pos = 0, i = 0;
i++) {
break;
sizeof (dep->sadei_length);
break;
type != SES_ET_DEVICE &&
type != SES_ET_ARRAY_DEVICE) {
continue;
/*
* The element index field from AES descriptor
* is element only index which doesn't include
* the OVERALL STATUS fields so we should
* compare with SES_PROP_ELEMENT_ONLY_INDEX
* not SES_PROP_ELEMENT_INDEX.
*/
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));
}
{
.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
}
};