Blame src/slave.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 _SLAVE_H_INCLUDED_
Packit 7e09eb
#define _SLAVE_H_INCLUDED_
Packit 7e09eb
Packit 7e09eb
#include "block.h"
Packit 7e09eb
#include "raid.h"
Packit 7e09eb
Packit 7e09eb
/**
Packit 7e09eb
 */
Packit 7e09eb
#define SLAVE_STATE_UNKNOWN      0x00
Packit 7e09eb
#define SLAVE_STATE_IN_SYNC      0x01
Packit 7e09eb
#define SLAVE_STATE_SPARE        0x02
Packit 7e09eb
#define SLAVE_STATE_FAULTY       0x04
Packit 7e09eb
#define SLAVE_STATE_WRITE_MOSTLY 0x08
Packit 7e09eb
#define SLAVE_STATE_BLOCKED      0x10
Packit 7e09eb
Packit 7e09eb
/**
Packit 7e09eb
 */
Packit 7e09eb
struct slave_device {
Packit 7e09eb
	struct raid_device *raid;
Packit 7e09eb
	unsigned int errors;
Packit 7e09eb
	unsigned int slot;
Packit 7e09eb
	struct block_device *block;
Packit 7e09eb
	unsigned char state;
Packit 7e09eb
};
Packit 7e09eb
Packit 7e09eb
/**
Packit 7e09eb
 */
Packit 7e09eb
struct slave_device *slave_device_init(const char *path, struct list *block_list);
Packit 7e09eb
Packit 7e09eb
/**
Packit 7e09eb
 */
Packit 7e09eb
void slave_device_fini(struct slave_device *device);
Packit 7e09eb
Packit 7e09eb
#endif				/* _SLAVE_H_INCLUDED_ */