Blame src/scsi.h

Packit 7e09eb
/*
Packit 7e09eb
 * Intel(R) Enclosure LED Utilities
Packit Service cb68d2
 * Copyright (C) 2009-2021 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 _SCSI_H_INCLUDED
Packit 7e09eb
#define _SCSI_H_INCLUDED
Packit 7e09eb
Packit 7e09eb
#include "block.h"
Packit 7e09eb
#include "ibpi.h"
Packit 7e09eb
Packit 7e09eb
/**
Packit Service cb68d2
 * @brief Gets the sas host path of the device.
Packit 7e09eb
 *
Packit Service cb68d2
 * This function returns a sysfs path to the sas host that the device
Packit 7e09eb
 * belongs to.
Packit 7e09eb
 *
Packit 7e09eb
 * @param[in]      path           Canonical sysfs path to block device.
Packit 7e09eb
 *
Packit Service cb68d2
 * @return A sysfs path to host device associated with the given
Packit 7e09eb
 *         block device if successful, otherwise NULL pointer.
Packit 7e09eb
 */
Packit Service cb68d2
char *scsi_get_host_path(const char *path, const char *cntrl_path);
Packit 7e09eb
Packit 7e09eb
/**
Packit 7e09eb
 * @brief Prepares SES message based on ibpi pattern.
Packit 7e09eb
 *
Packit 7e09eb
 * @param[in]      device         Sysfs path of a drive in enclosure.
Packit 7e09eb
 * @param[in]      ibpi           IBPI pattern to visualize.
Packit 7e09eb
 *
Packit 7e09eb
 * @return 0 on success, otherwise error.
Packit 7e09eb
 */
Packit 7e09eb
int scsi_ses_write(struct block_device *device, enum ibpi_pattern ibpi);
Packit 7e09eb
Packit 7e09eb
/**
Packit 7e09eb
 * @brief Sends message to SES processor of an enclosure.
Packit 7e09eb
 *
Packit 7e09eb
 * This function send a message to an enclosure in order to control LEDs of
Packit 7e09eb
 * the given slot/component. It uses interface of ENCLOSURE kernel module to
Packit 7e09eb
 * control LEDs.
Packit 7e09eb
 *
Packit 7e09eb
 * @param[in]      device         Sysfs path of a drive in enclosure.
Packit 7e09eb
 *
Packit 7e09eb
 * @return 0 on success, otherwise error.
Packit 7e09eb
 */
Packit 7e09eb
int scsi_ses_flush(struct block_device *device);
Packit 7e09eb
Packit 7e09eb
/**
Packit 7e09eb
 * @brief Assigns enclosure device to block device.
Packit 7e09eb
 *
Packit 7e09eb
 * @param[in]      device        Path to block device.
Packit 7e09eb
 *
Packit 7e09eb
 * @return 1 on success, 0 otherwise.
Packit 7e09eb
 * */
Packit 7e09eb
int scsi_get_enclosure(struct block_device *device);
Packit 7e09eb
Packit 7e09eb
#endif				/* _SCSI_H_INCLUDED_ */