Blame src/ahci.h

Packit 7e09eb
/*
Packit 7e09eb
 * Intel(R) Enclosure LED Utilities
Packit 7e09eb
 * Copyright (C) 2009-2017 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 _AHCI_H_INCLUDED_
Packit 7e09eb
#define _AHCI_H_INCLUDED_
Packit 7e09eb
Packit 7e09eb
#include "block.h"
Packit 7e09eb
#include "ibpi.h"
Packit 7e09eb
Packit 7e09eb
/**
Packit 7e09eb
 * @brief Gets sysfs path to SATA port.
Packit 7e09eb
 *
Packit 7e09eb
 * The function returns a path to SATA port in sysfs tree the given block device
Packit 7e09eb
 * is connected to.
Packit 7e09eb
 *
Packit 7e09eb
 * @param[in]      path           Path to block device in sysfs tree.
Packit 7e09eb
 *
Packit 7e09eb
 * @return Canonical path if successful, otherwise NULL pointer if an error occurred.
Packit 7e09eb
 */
Packit 7e09eb
char *ahci_get_port_path(const char *path);
Packit 7e09eb
Packit 7e09eb
/**
Packit 7e09eb
 * @brief Sends LED control message using SGPIO.
Packit 7e09eb
 *
Packit 7e09eb
 * This function visualizes IBPI pattern on LEDs associated with a slot in
Packit 7e09eb
 * drive bay. This function is designed to send messaged to AHCI controller
Packit 7e09eb
 * only.
Packit 7e09eb
 *
Packit 7e09eb
 * @param[in]      path           Path in sysfs tree to slot in drive bay.
Packit 7e09eb
 * @param[in]      ibpi           IBPI pattern to visualize on LEDs associated
Packit 7e09eb
 *                                with the given slot.
Packit 7e09eb
 *
Packit 7e09eb
 * @return Number of bytes send to controller, -1 means error occurred and
Packit 7e09eb
 *         errno has additional error information.
Packit 7e09eb
 */
Packit 7e09eb
int ahci_sgpio_write(struct block_device *path, enum ibpi_pattern ibpi);
Packit 7e09eb
Packit 7e09eb
#endif				/* _AHCI_H_INCLUDED_ */