/*
* 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 <string.h>
#include <strings.h>
#include <scsi/libses_plugin.h>
static int
{
int nverr;
/*
* The spec conveniently defines the bay number as part of the
* additional element status descriptor. However, the AES descriptor
* is technically only valid if the device is inserted. This is a
* problem for loki because the bay numbers don't match the element
* class index, so when a device is removed we have no way of knowing
* *which* bay is empty. Thankfully, loki defines this value even if
* the invalid bit is set, so we override this value, even for empty
* bays.
*/
return (0);
return (0);
return (0);
}
static int
{
int nverr;
char *field;
int i;
return (0);
&type) == 0);
if (type == SES_ET_ARRAY_DEVICE)
if (type != SES_ET_COOLING &&
return (0);
&index) == 0);
}
/*
* Find the containing enclosure node and extract the STRING IN
* information.
*/
;
return (0);
/*
* If this is an enclosure, then calculate the chassis WWN by masking
* off the bottom 8 bits of the WWN.
*/
wwn & ~0xFFULL);
/*
* J4500 has 4 expanders and two of them provides
* only ARRAY DEVICE elements while the other two provides
* fully populated SES element information.
* This behavior may cause missing corresponding enclosure
* element for an enclousre descriptor so no element type
* is added to the enclosure node.
* The enclosure element type is added here. Note that
* even if the enclosure element is found and the associated
* prop is created by libses the plugin based prop
* overrides so there should be no side effect doing this.
*/
}
/*
* The STRING IN data is organized into a series of variable-length
* fields, where each field can be either a key ("Fan PartNUM") or a
* value. If the field length is less than our shortest expected
* identifier, then something has gone awry and we assume that the data
* is corrupt.
*/
if (fieldlen < 11)
return (0);
/*
* This is the part number for the enclosure itself.
*/
continue;
break;
return (0);
}
/*
* Part numbers for the fans, of which there are 5.
*/
type != SES_ET_COOLING) {
continue;
}
for (i = 0; i < 5 &&
if (index == i &&
return (0);
}
}
/*
* Part numbers for the power supplies, of which there
* are 2.
*/
type != SES_ET_POWER_SUPPLY) {
continue;
}
for (i = 0; i < 2 &&
if (index == i &&
return (0);
}
}
}
}
return (0);
}
int
{
};
&config) != 0);
}