diskmon_conf.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 _DISKMOND_CONF_H
#define _DISKMOND_CONF_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Configuration File data
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <pthread.h>
#include <libnvpair.h>
#include "dm_types.h"
#include "scsi_util.h"
#include "fault_analyze.h"
#include "util.h"
#ifndef MIN
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#endif
#ifndef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif
#define DEVICES_PREFIX "/devices"
#define GLOBAL_PROP_FAULT_POLL "fault-polling-interval"
#define GLOBAL_PROP_FAULT_INJ "fault-inject-max-reps"
#define GLOBAL_PROP_FAULT_OPTIONS "fault-analyze-options"
#define GLOBAL_PROP_LOG_LEVEL "log-level"
/* Property names (and values) for the disk configuration file entity */
#define DISK_PROP_DEVPATH "dev-path"
#define DISK_PROP_LOGNAME "logical-path"
#define DISK_PROP_FRUACTION "fru-update-action"
#define DISK_PROP_OTEMPACTION "overtemp-action"
#define DISK_PROP_STFAILACTION "selftest-fail-action"
/* Properties for the "ap" subentity */
#define DISK_AP_PROP_APID "path"
#define DEVPATH_MINOR_SEPARATOR ':'
#define INDICATOR_FAULT_IDENTIFIER "FAULT"
typedef enum conf_err_e {
E_NO_ERROR = 0,
} conf_err_t;
typedef enum {
} ind_state_t;
typedef enum {
typedef struct ind_action {
char *ind_name;
struct ind_action *next;
} ind_action_t;
typedef struct state_transition {
typedef struct indrule {
} indrule_t;
typedef struct indicator {
char *ind_name;
char *ind_instr_spec;
} indicator_t;
typedef struct fault_monitor_info {
int mode_length;
/* Protects fault_list and disk_fault_srcs: */
struct disk_fault *fault_list;
/* XXX - may not need these long-term: */
struct scsi_ms_hdrs hdrs;
struct info_except_page iec_current;
struct info_except_page iec_changeable;
typedef struct diskmon {
/*
* Static configuration data
*/
char *location; /* descriptive location */
/*
* Dynamic data
*/
/*
* Only one manager can be manipulating the
* state in the diskmon at one time (either the
* state-change manager or the fault-polling manager)
*/
/*
* Set to true only during initialization, and
* cleared the next time a fru update needs to
* occur, this flag enabled an optimization of
* NOT calling libtopo for a configuration update
* when the DE starts up. This allows a HUGE
* savings (since only a single snapshot-- the
* initial snapshot) is used as the source of
* the FRU information.
*/
/* For the fault manager: */
/*
* Set to TRUE when the fault manager adds faults to the diskmon
* that are processed by the state manager. Once the state
* manager generates ereports and clears the disk_faults member,
* it clears this flag, allowing the fault manager to add new
* faults, when they are detected.
*/
/* Bitmap of accumulated faults: */
/* The time the next fault analysis is due: */
/*
* The number of analysis generations after which fake faults
* are injected.
*/
/*
* The current analysis generation (number of times the fault
* analysis algorithm was run). Used to determine when to do
* fault injection, when fault injection is enabled.
*/
/* For the state-change manager: */
/*
* Set to TRUE when a disk transitions to the CONFIGURED state
* and remains TRUE until the disk is physically removed. Used
* to detect the first configuration of a disk so that fault
* state can be collected.
*/
/*
* The number of disk hotplug state transitions since the disk
* was inserted.
*/
/*
* FMRI (nvlist and string versions) for populating
* ereports and faults
*/
/*
* The following member holds details about what faults were
* detected, and their details (see above for the structure
* definition)
*/
/* Disk FRU (model, manufacturer, etc) information */
} diskmon_t;
typedef struct cfgdata {
} cfgdata_t;
typedef struct namevalpr {
char *name;
char *value;
} namevalpr_t;
char *actionp);
void *arg);
extern int config_init(void);
extern void config_fini(void);
extern nvlist_t *dm_global_proplist(void);
#ifdef __cplusplus
}
#endif
#endif /* _DISKMOND_CONF_H */