2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _LIBDISKSTATUS_H
2N/A#define _LIBDISKSTATUS_H
2N/A
2N/A#include <libnvpair.h>
2N/A#include <sys/types.h>
2N/A#include "ds_scsi.h"
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/Atypedef struct disk_status disk_status_t;
2N/A
2N/A/*
2N/A * Error definitions
2N/A */
2N/A#define EDS_BASE 2000
2N/A
2N/Aenum {
2N/A EDS_NOMEM = EDS_BASE, /* memory allocation failure */
2N/A EDS_CANT_OPEN, /* failed to open device */
2N/A EDS_NO_TRANSPORT, /* no supported transport */
2N/A EDS_NOT_SUPPORTED, /* status information not supported */
2N/A EDS_NOT_SIMULATOR, /* not a valid simulator file */
2N/A EDS_IO /* I/O error */
2N/A};
2N/A
2N/A/* Supported disk tests. Used in calls to dis_status_open. */
2N/A#define SMART_TEST LOGPAGE_SUPP_IE
2N/A#define TEMPERATURE_TEST LOGPAGE_SUPP_TEMP
2N/A#define SELF_TEST LOGPAGE_SUPP_SELFTEST
2N/A#define ALL_TESTS SMART_TEST | TEMPERATURE_TEST | SELF_TEST
2N/A
2N/A/*
2N/A * Basic library functions
2N/A */
2N/Aextern disk_status_t *disk_status_open(const char *, int, boolean_t, int *);
2N/Aextern void disk_status_close(disk_status_t *);
2N/Aextern const char *disk_status_errmsg(int);
2N/Aextern void disk_status_set_debug(boolean_t);
2N/Aextern int disk_status_errno(disk_status_t *);
2N/A
2N/A/*
2N/A * Miscellaneous functions.
2N/A */
2N/Aextern const char *disk_status_path(disk_status_t *);
2N/A
2N/A/*
2N/A * Main entry point.
2N/A */
2N/Aextern nvlist_t *disk_status_get(disk_status_t *);
2N/A
2N/A/*
2N/A * Utility function to simulate predictive failure (device-specific).
2N/A */
2N/Aextern int disk_status_test_predfail(disk_status_t *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _LIBDISKSTATUS_H */