|
Packit Service |
db8df9 |
/*
|
|
Packit Service |
db8df9 |
* Intel(R) Enclosure LED Utilities
|
|
Packit Service |
db8df9 |
* Copyright (C) 2009-2018 Intel Corporation.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* This program is free software; you can redistribute it and/or modify it
|
|
Packit Service |
db8df9 |
* under the terms and conditions of the GNU General Public License,
|
|
Packit Service |
db8df9 |
* version 2, as published by the Free Software Foundation.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
Packit Service |
db8df9 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
Packit Service |
db8df9 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
Packit Service |
db8df9 |
* more details.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* You should have received a copy of the GNU General Public License along with
|
|
Packit Service |
db8df9 |
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
Packit Service |
db8df9 |
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
*/
|
|
Packit Service |
db8df9 |
|
|
Packit Service |
db8df9 |
#ifndef _SCSI_H_INCLUDED
|
|
Packit Service |
db8df9 |
#define _SCSI_H_INCLUDED
|
|
Packit Service |
db8df9 |
|
|
Packit Service |
db8df9 |
#include "block.h"
|
|
Packit Service |
db8df9 |
#include "ibpi.h"
|
|
Packit Service |
db8df9 |
|
|
Packit Service |
db8df9 |
/**
|
|
Packit Service |
db8df9 |
* @brief Gets a path to slot of an enclosure.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* This function returns a sysfs path to component of enclosure the device
|
|
Packit Service |
db8df9 |
* belongs to.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* @param[in] path Canonical sysfs path to block device.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* @return A sysfs path to enclosure's component associated with the given
|
|
Packit Service |
db8df9 |
* block device if successful, otherwise NULL pointer.
|
|
Packit Service |
db8df9 |
*/
|
|
Packit Service |
db8df9 |
char *scsi_get_slot_path(const char *path, const char *cntrl_path);
|
|
Packit Service |
db8df9 |
|
|
Packit Service |
db8df9 |
/**
|
|
Packit Service |
db8df9 |
* @brief Prepares SES message based on ibpi pattern.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* @param[in] device Sysfs path of a drive in enclosure.
|
|
Packit Service |
db8df9 |
* @param[in] ibpi IBPI pattern to visualize.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* @return 0 on success, otherwise error.
|
|
Packit Service |
db8df9 |
*/
|
|
Packit Service |
db8df9 |
int scsi_ses_write(struct block_device *device, enum ibpi_pattern ibpi);
|
|
Packit Service |
db8df9 |
|
|
Packit Service |
db8df9 |
/**
|
|
Packit Service |
db8df9 |
* @brief Sends message to SES processor of an enclosure.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* This function send a message to an enclosure in order to control LEDs of
|
|
Packit Service |
db8df9 |
* the given slot/component. It uses interface of ENCLOSURE kernel module to
|
|
Packit Service |
db8df9 |
* control LEDs.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* @param[in] device Sysfs path of a drive in enclosure.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* @return 0 on success, otherwise error.
|
|
Packit Service |
db8df9 |
*/
|
|
Packit Service |
db8df9 |
int scsi_ses_flush(struct block_device *device);
|
|
Packit Service |
db8df9 |
|
|
Packit Service |
db8df9 |
/**
|
|
Packit Service |
db8df9 |
* @brief Assigns enclosure device to block device.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* @param[in] device Path to block device.
|
|
Packit Service |
db8df9 |
*
|
|
Packit Service |
db8df9 |
* @return 1 on success, 0 otherwise.
|
|
Packit Service |
db8df9 |
* */
|
|
Packit Service |
db8df9 |
int scsi_get_enclosure(struct block_device *device);
|
|
Packit Service |
db8df9 |
|
|
Packit Service |
db8df9 |
#endif /* _SCSI_H_INCLUDED_ */
|