|
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 _SYSFS_H_INCLUDED_
|
|
Packit |
7e09eb |
#define _SYSFS_H_INCLUDED_
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
#include "status.h"
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
/**
|
|
Packit |
7e09eb |
* @brief Initializes sysfs module.
|
|
Packit |
7e09eb |
*
|
|
Packit |
7e09eb |
* This function initializes sysfs module internal lists.
|
|
Packit |
7e09eb |
* Application must call this function before any sysfs module function.
|
|
Packit |
7e09eb |
*/
|
|
Packit |
7e09eb |
void sysfs_init(void);
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
/**
|
|
Packit |
7e09eb |
* @brief Resets the content of internal lists.
|
|
Packit |
7e09eb |
*
|
|
Packit |
7e09eb |
* This function releases memory allocated for elements of internal lists.
|
|
Packit |
7e09eb |
*/
|
|
Packit |
7e09eb |
void sysfs_reset(void);
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
/**
|
|
Packit |
7e09eb |
* @brief Scans sysfs tree and populates internal lists.
|
|
Packit |
7e09eb |
*
|
|
Packit |
7e09eb |
* This function scans sysfs tree for storage controllers, block devices, RAID
|
|
Packit |
7e09eb |
* devices, container devices, slave devices and enclosure devices registered
|
|
Packit |
7e09eb |
* in the system. Only supported block and controller devices are put on a list.
|
|
Packit |
7e09eb |
*/
|
|
Packit |
7e09eb |
void sysfs_scan(void);
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
/**
|
|
Packit |
7e09eb |
* The function returns list of enclosure devices attached to SAS/SCSI storage
|
|
Packit |
7e09eb |
* controller(s).
|
|
Packit |
7e09eb |
*/
|
|
Packit |
7e09eb |
const struct list *sysfs_get_enclosure_devices(void);
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
/**
|
|
Packit |
7e09eb |
* The function returns list of controller devices present in the system.
|
|
Packit |
7e09eb |
*/
|
|
Packit |
7e09eb |
const struct list *sysfs_get_cntrl_devices(void);
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
/**
|
|
Packit |
7e09eb |
* The function returns list of RAID volumes present in the system.
|
|
Packit |
7e09eb |
*/
|
|
Packit |
7e09eb |
const struct list *sysfs_get_volumes(void);
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
/**
|
|
Packit |
7e09eb |
* The function returns list of block devices present in the system.
|
|
Packit |
7e09eb |
*/
|
|
Packit |
7e09eb |
const struct list *sysfs_get_block_devices(void);
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
/**
|
|
Packit |
7e09eb |
* The function returns list of pci slots present in the system.
|
|
Packit |
7e09eb |
*/
|
|
Packit |
7e09eb |
const struct list *sysfs_get_pci_slots(void);
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
/**
|
|
Packit |
7e09eb |
* The function checks if the given storage controller is attached to enclosure
|
|
Packit |
7e09eb |
* device(s).
|
|
Packit |
7e09eb |
*/
|
|
Packit |
7e09eb |
int sysfs_enclosure_attached_to_cntrl(const char *path);
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
/*
|
|
Packit |
7e09eb |
* This function checks driver type.
|
|
Packit |
7e09eb |
*/
|
|
Packit |
7e09eb |
int sysfs_check_driver(const char *path, const char *driver);
|
|
Packit |
7e09eb |
|
|
Packit |
7e09eb |
#endif /* _SYSFS_H_INCLUDED_ */
|