/*
* 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
*/
/*
* Enclosure Services Devices, SEN Enclosure Routines
*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* The SEN unit is wired to support 7 disk units,
* two power supplies, one fan module, one overtemp sensor,
* and one alarm.
*/
#define DRVOFF 0
int
{
int i;
if (doinit == 0) {
if (ssc->ses_nobjects) {
ssc->ses_nobjects = 0;
}
return (0);
}
ssc->ses_nobjects = 0;
ssc->ses_encstat = 0;
return (ENOMEM);
}
}
}
}
}
}
return (0);
}
int
{
return (0);
}
static int
{
/*
* Fetch current data
*/
return (ENOMEM);
if (err) {
return (err);
}
return (EIO);
}
/*
* Set base SCSI id for drives...
*/
baseid = 8;
else
baseid = 0;
oid = 0;
/*
* Invalidate all status bits.
*/
for (i = 0; i < ssc->ses_nobjects; i++)
ssc->ses_encstat = 0;
/*
* Do Drives...
*/
if (sdata[i] & 0x80) {
/*
* Drive is present
*/
} else {
}
/*
* Is the fault LED lit?
*/
if (sdata[i] & 0x40) {
} else {
}
}
/*
* Do Power Supplies...
*
* Power supply bad, or not installed cannot be distinguished.
* Which one to pick? Let's say 'bad' and make it NONCRITICAL
* if only one is bad but CRITICAL if both are bad.
*/
if ((sdata[i] & 0x80) == 0) {
/*
* Power supply 'ok'...
*/
tmp++;
} else {
}
}
if (tmp == 0) {
}
/*
* Do the Fan(s)
*/
} else {
}
}
/*
* Do the temperature sensor...
*/
if (sdata[i] & 0x80) {
/* ssc->ses_objmap[oid].encstat[2] = 0; */
} else {
/* ssc->ses_objmap[oid].encstat[2] = 0; */
}
}
/*
* and last, but not least, check the state of the alarm.
*/
if ((sdata[i] & 0xf))
} else {
}
}
return (0);
}
int
{
}
int
{
return (0);
}
int
{
if (r)
return (r);
}
return (0);
}
int
{
/*
* If this is clear, we don't do diddly.
*/
return (0);
}
/*
* Fetch current data
*/
return (ENOMEM);
if (err) {
return (err);
}
return (EIO);
}
/*
* Okay, now convert the input page to the output page.
*/
sdata[1] = 0;
sdata[10] = 0;
sdata[21] = 0;
runcmd = 0;
case SESTYP_DEVICE:
runcmd++;
} else {
runcmd++;
}
break;
case SESTYP_POWER:
runcmd++;
}
break;
case SESTYP_ALARM:
/*
* On all nonzero but the 'muted' bit,
* we turn on the alarm,
*/
sdata[8] = 0;
} else {
sdata[8] = 0;
}
runcmd++;
break;
default:
break;
}
if (runcmd) {
/* preserve error across the rest of the action */
} else {
err = 0;
}
return (err);
}
/*
* mode: c
* Local variables:
* c-indent-level: 8
* c-brace-imaginary-offset: 0
* c-brace-offset: -8
* c-argdecl-indent: 8
* c-label-offset: -8
* c-continued-statement-offset: 8
* c-continued-brace-offset: 0
* End:
*/