fault_analyze.h revision 724365f7556fc4201fdb11766ebc6bd918523130
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FAULT_ANALYZE_H
#define _FAULT_ANALYZE_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Definitions for data structures used in the SCSI IE module
*/
#ifdef __cplusplus
extern "C" {
#endif
#include "dm_types.h"
#define IE_SUCCESS 0
#define IE_NOT_SUPPORTED 1
#define IE_CANNOT_BE_ENABLED 2
#define IE_ENABLE_FAILED 3
#define IE_ENABLE_DIDNT_STICK 4
#define IE_OTHER_ERROR 10
#define MODE_CMD_LEN_UNKNOWN 0
#define MODE_CMD_LEN_6 1
#define MODE_CMD_LEN_10 2
typedef enum {
MODEPAGE_SUPP_IEC = 0x00000001
typedef enum {
LOGPAGE_SUPP_IE = 0x00000001,
LOGPAGE_SUPP_TEMP = 0x00000002,
LOGPAGE_SUPP_SELFTEST = 0x00000004
typedef enum {
EXTN_IE_TEMP_THRESHOLD = 0x00000001,
EXTN_TEMPLOG_TEMP_THRESHOLD = 0x00000002
typedef enum {
OPTION_PERF_MODE = 0x00000001,
OPTION_TEST_MODE = 0x00000002,
OPTION_SELFTEST_ERRS_ARE_FATAL = 0x00000004,
OPTION_OVERTEMP_ERRS_ARE_FATAL = 0x00000008
/* This MUST be a MASK: */
typedef enum {
DISK_FAULT_SOURCE_NONE = 0x00000000,
DISK_FAULT_SOURCE_SELFTEST = 0x00000001,
DISK_FAULT_SOURCE_OVERTEMP = 0x00000002,
DISK_FAULT_SOURCE_INFO_EXCPT = 0x00000004
struct scsi_ms_hdrs {
int length;
union {
struct scsi_ms_header g0;
struct scsi_ms_header_g1 g1;
} h;
};
/* Yea, this can be a union... */
struct disk_fault {
char *msg;
/* Predictive failure information */
/* Self-test failure information */
/* Temperature information */
int cur_temp;
int thresh_temp;
struct disk_fault *next;
};
struct diskmon;
struct fault_monitor_info;
/*
* Each of the following validation or analysis functions are called once
* for each parameter type in the log page for which the function is
* written. If there's a problem with the parameter passed-in, the
* function returns a negative number.
*/
typedef int (*logpage_validation_fn_t)(struct diskmon *,
struct log_parameter_header *);
typedef int (*logpage_analyze_fn_t)(struct diskmon *,
struct log_parameter_header *);
struct logpage_validation_entry {
int supp_bit;
const char *descr;
};
#ifdef __cplusplus
}
#endif
#endif /* _FAULT_ANALYZE_H */