/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Disk status library
*
* This library is responsible for querying health and other status information
* from disk drives. It is intended to be a generic interface, however only
* SCSI (and therefore SATA) disks are currently supported. The library is
* capable of detecting the following status conditions:
*
* - Predictive failure
* - Overtemp
* - Self-test failure
*/
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <libdevinfo.h>
#include <libdiskstatus.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "ds_impl.h"
#include "ds_scsi.h"
};
/*
* Open a handle to a disk. This will fail if the device cannot be opened, or
* if no suitable transport exists for communicating with the device.
*/
{
ds_transport_t *t;
int i;
return (NULL);
}
*error = EDS_CANT_OPEN;
return (NULL);
}
return (NULL);
}
for (i = 0; i < NTRANSPORTS; i++) {
t = ds_transports[i];
dsp->ds_transport = t;
return (NULL);
}
return (NULL);
}
} else {
break;
}
}
return (NULL);
}
return (dsp);
}
/*
* Close a handle to a disk.
*/
void
{
}
void
{
}
/*
* Query basic information
*/
const char *
{
}
int
{
}
nvlist_t *
{
int err;
/*
* Scan (or rescan) the current device.
*/
/*
* Even if there is an I/O failure when trying to scan the device, we
* can still return the current state.
*/
return (NULL);
goto nverror;
goto nverror;
/*
* Construct the list of faults.
*/
goto nverror;
dsp->ds_predfail)) != 0)
goto nverror;
}
dsp->ds_testfail)) != 0)
goto nverror;
}
dsp->ds_overtemp)) != 0)
goto nverror;
}
goto nverror;
return (nvl);
return (NULL);
}