ONLP
Open Network Linux Platform APIs
|
Fan Management. More...
Go to the source code of this file.
Data Structures | |
struct | onlp_fan_info_s |
Macros | |
#define | ONLP_FAN_INFO_CAP_IS_SET(_pinfo, _name) ((_pinfo)->caps & ONLP_FAN_CAPS_##_name) |
Determine if a fan capability is set. | |
#define | ONLP_FAN_STATUS_PRESENT(_fi) ((_fi).hdr.status & ONLP_OID_STATUS.PRESENT) |
#define | ONLP_FAN_STATUS_MISSING(_fi) (!ONLP_FAN_INFO_PRESENT(_fi)) |
#define | ONLP_FAN_STATUS_FAILED(_fi) ( (_fi).hdr.status & ONLP_OID_STATUS.FAILED) |
#define | ONLP_FAN_STATUS_NORMAL(_fi) ( ONLP_FAN_STATUS_PRESENT(_fi) && !ONLP_FAN_STATUS_FAILED(_fi) ) |
#define | ONLP_FAN_CAPS_VALID(_e) (onlp_fan_caps_valid((_e))) |
#define | ONLP_FAN_DIR_STRINGS |
#define | ONLP_FAN_DIR_VALID(_e) ( (0 <= (_e)) && ((_e) <= ONLP_FAN_DIR_F2B)) |
Typedefs | |
typedef enum onlp_fan_caps_e | onlp_fan_caps_t |
typedef enum onlp_fan_dir_e | onlp_fan_dir_t |
typedef struct onlp_fan_info_s | onlp_fan_info_t |
Enumerations | |
enum | onlp_fan_caps_e { ONLP_FAN_CAPS_SET_DIR = (1 << 0), ONLP_FAN_CAPS_GET_DIR = (1 << 1), ONLP_FAN_CAPS_SET_RPM = (1 << 2), ONLP_FAN_CAPS_SET_PERCENTAGE = (1 << 3), ONLP_FAN_CAPS_GET_RPM = (1 << 4), ONLP_FAN_CAPS_GET_PERCENTAGE = (1 << 5) } |
enum | onlp_fan_dir_e { ONLP_FAN_DIR_UNKNOWN, ONLP_FAN_DIR_B2F, ONLP_FAN_DIR_F2B, ONLP_FAN_DIR_LAST = ONLP_FAN_DIR_F2B, ONLP_FAN_DIR_COUNT, ONLP_FAN_DIR_INVALID = -1 } |
Functions | |
int | onlp_fan_sw_init (void) |
Software Initialization of the Fan module. | |
int | onlp_fan_hw_init (uint32_t flags) |
Hardware Initialization of the Fan module. More... | |
int | onlp_fan_sw_denit (void) |
Deinitialize the fan software module. More... | |
int | onlp_fan_hdr_get (onlp_oid_t oid, onlp_oid_hdr_t *hdr) |
Retrieve the fan's OID hdr. More... | |
int | onlp_fan_info_get (onlp_oid_t oid, onlp_fan_info_t *rv) |
Retrieve fan information. More... | |
int | onlp_fan_caps_get (onlp_oid_t oid, uint32_t *caps) |
Retrieve the fan capabilities. More... | |
int | onlp_fan_rpm_set (onlp_oid_t oid, int rpm) |
Set the fan speed in RPMs. More... | |
int | onlp_fan_percentage_set (onlp_oid_t oid, int p) |
Set the fan speed in percentage. More... | |
int | onlp_fan_dir_set (onlp_oid_t oid, onlp_fan_dir_t dir) |
Set the fan direction. More... | |
int | onlp_fan_info_to_user_json (onlp_fan_info_t *info, cJSON **cj, uint32_t flags) |
Convert a fan info structure to user JSON. More... | |
int | onlp_fan_info_to_json (onlp_fan_info_t *info, cJSON **cj, uint32_t flags) |
Convert a fan info structure to JSON. More... | |
int | onlp_fan_info_from_json (cJSON *cj, onlp_fan_info_t *info) |
Convert a JSON object to a fan info structure. More... | |
const char * | onlp_fan_caps_name (onlp_fan_caps_t e) |
int | onlp_fan_caps_value (const char *str, onlp_fan_caps_t *e, int substr) |
const char * | onlp_fan_caps_desc (onlp_fan_caps_t e) |
int | onlp_fan_caps_valid (onlp_fan_caps_t e) |
const char * | onlp_fan_dir_name (onlp_fan_dir_t e) |
int | onlp_fan_dir_value (const char *str, onlp_fan_dir_t *e, int substr) |
const char * | onlp_fan_dir_desc (onlp_fan_dir_t e) |
Variables | |
aim_map_si_t | onlp_fan_caps_map [] |
aim_map_si_t | onlp_fan_caps_desc_map [] |
aim_map_si_t | onlp_fan_dir_map [] |
aim_map_si_t | onlp_fan_dir_desc_map [] |
Fan Management.