Blame src/ibpi.h

Packit 7e09eb
/*
Packit 7e09eb
 * Intel(R) Enclosure LED Utilities
Packit 7e09eb
 * Copyright (C) 2009-2018 Intel Corporation.
Packit 7e09eb
 *
Packit 7e09eb
 * This program is free software; you can redistribute it and/or modify it
Packit 7e09eb
 * under the terms and conditions of the GNU General Public License,
Packit 7e09eb
 * version 2, as published by the Free Software Foundation.
Packit 7e09eb
 *
Packit 7e09eb
 * This program is distributed in the hope it will be useful, but WITHOUT
Packit 7e09eb
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Packit 7e09eb
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
Packit 7e09eb
 * more details.
Packit 7e09eb
 *
Packit 7e09eb
 * You should have received a copy of the GNU General Public License along with
Packit 7e09eb
 * this program; if not, write to the Free Software Foundation, Inc.,
Packit 7e09eb
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
Packit 7e09eb
 *
Packit 7e09eb
 */
Packit 7e09eb
Packit 7e09eb
#ifndef _IBPI_H_INCLUDED_
Packit 7e09eb
#define _IBPI_H_INCLUDED_
Packit 7e09eb
Packit 7e09eb
/**
Packit 7e09eb
 * @brief IBPI pattern identifies.
Packit 7e09eb
 *
Packit 7e09eb
 * The IBPI specification lists the following pattern names:
Packit 7e09eb
 *
Packit 7e09eb
 * - NORMAL      - either drive is present or missing, activity LED does not
Packit 7e09eb
 *                 matter. The rest of the LEDs are off.
Packit 7e09eb
 * - FAIL        - a block device has failed or is missing. Failure LED is
Packit 7e09eb
 *                 active and the behavior is depended on implementation
Packit 7e09eb
 *                 of enclosure management processor.
Packit 7e09eb
 * - REBUILD     - this means a RAID device is recovering or rebuilding
Packit 7e09eb
 *                 its data. Depending on implementation of enclosure
Packit 7e09eb
 *                 management processor appropriate LED is blinking or solid.
Packit 7e09eb
 * - ICA         - In a Critical Array, this means a RAID device is degraded and
Packit 7e09eb
 *                 there's no spare device available.
Packit 7e09eb
 * - IFA         - In a Failed Array, this means a RAID device is damaged and
Packit 7e09eb
 *                 cannot be recovered or rebuild.
Packit 7e09eb
 * - PFA         - Predict Failure Analysis state means that a block device will
Packit 7e09eb
 *                 fail soon, so it must be replaced with working one.
Packit 7e09eb
 * - LOCATE      - turns Locate LED on to identify a block device or slot.
Packit 7e09eb
 *
Packit 7e09eb
 * Additionally the following patterns has been introduced, just for the purpose
Packit 7e09eb
 * of LED control utility.
Packit 7e09eb
 *
Packit 7e09eb
 * - UNKNOWN     - unknown IBPI pattern and it means do not control LEDs for
Packit 7e09eb
 *                 a device it is set (no LED management).
Packit 7e09eb
 * - ONESHOT_NORMAL - this state means that ledmon just started and it does not
Packit 7e09eb
 *                 know anything about existing patterns set, so it will off all
Packit 7e09eb
 *                 the LEDs just in case of any problem in the future. The state
Packit 7e09eb
 *                 is set, when a RAID device disappears, too. Oneshot means
Packit 7e09eb
 *                 as soon application applies the state it will change
Packit 7e09eb
 *                 to UNKNOWN.
Packit 7e09eb
 * - ADDED         this state means that device previously known to ledmon is
Packit 7e09eb
 *                 restored. This state will be changed to ONESHOT_NORMAL.
Packit 7e09eb
 * - REMOVED       this state means that device was removed from system. It
Packit 7e09eb
 *                 will be changed to ADDED after restoring device to system.
Packit 7e09eb
 */
Packit 7e09eb
enum ibpi_pattern {
Packit 7e09eb
	IBPI_PATTERN_UNKNOWN = 0,
Packit 7e09eb
	IBPI_PATTERN_NONE,	/* used only to initialize ibpi_prev */
Packit 7e09eb
	IBPI_PATTERN_NORMAL,
Packit 7e09eb
	IBPI_PATTERN_ONESHOT_NORMAL,
Packit 7e09eb
	IBPI_PATTERN_DEGRADED,
Packit 7e09eb
	IBPI_PATTERN_HOTSPARE,
Packit 7e09eb
	IBPI_PATTERN_REBUILD,
Packit 7e09eb
	IBPI_PATTERN_FAILED_ARRAY,
Packit 7e09eb
	IBPI_PATTERN_PFA,
Packit 7e09eb
	IBPI_PATTERN_FAILED_DRIVE,
Packit 7e09eb
	IBPI_PATTERN_LOCATE,
Packit 7e09eb
	IBPI_PATTERN_LOCATE_OFF,
Packit 7e09eb
	IBPI_PATTERN_ADDED,
Packit 7e09eb
	IBPI_PATTERN_REMOVED,
Packit 7e09eb
	/* Below are SES-2 codes. Note that by default most IBPI messages are
Packit 7e09eb
	 * translated into SES when needed but SES codes can be added also. */
Packit 7e09eb
	SES_REQ_ABORT,
Packit 7e09eb
	SES_REQ_REBUILD,
Packit 7e09eb
	SES_REQ_IFA,
Packit 7e09eb
	SES_REQ_ICA,
Packit 7e09eb
	SES_REQ_CONS_CHECK,
Packit 7e09eb
	SES_REQ_HOSTSPARE,
Packit 7e09eb
	SES_REQ_RSVD_DEV,
Packit 7e09eb
	SES_REQ_OK,
Packit 7e09eb
	SES_REQ_IDENT,
Packit 7e09eb
	SES_REQ_RM,
Packit 7e09eb
	SES_REQ_INS,
Packit 7e09eb
	SES_REQ_MISSING,
Packit 7e09eb
	SES_REQ_DNR,
Packit 7e09eb
	SES_REQ_ACTIVE,
Packit 7e09eb
	SES_REQ_EN_BB,
Packit 7e09eb
	SES_REQ_EN_BA,
Packit 7e09eb
	SES_REQ_DEV_OFF,
Packit 7e09eb
	SES_REQ_FAULT,
Packit 7e09eb
	SES_REQ_PRDFAIL,
Packit 7e09eb
	ibpi_pattern_count,
Packit 7e09eb
};
Packit 7e09eb
Packit 7e09eb
extern const char *ibpi_str[ibpi_pattern_count];
Packit 7e09eb
Packit 7e09eb
#endif				/* _IBPI_H_INCLUDED_ */