|
ONLP
Open Network Linux Platform APIs
|
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 [] |
| #define ONLP_FAN_CAPS_VALID | ( | _e | ) | (onlp_fan_caps_valid((_e))) |
validator
| #define ONLP_FAN_DIR_STRINGS |
Strings macro.
| #define ONLP_FAN_DIR_VALID | ( | _e | ) | ( (0 <= (_e)) && ((_e) <= ONLP_FAN_DIR_F2B)) |
validator
| #define ONLP_FAN_STATUS_FAILED | ( | _fi | ) | ( (_fi).hdr.status & ONLP_OID_STATUS.FAILED) |
Fan has failed.
| #define ONLP_FAN_STATUS_MISSING | ( | _fi | ) | (!ONLP_FAN_INFO_PRESENT(_fi)) |
Fan is missing.
| #define ONLP_FAN_STATUS_NORMAL | ( | _fi | ) | ( ONLP_FAN_STATUS_PRESENT(_fi) && !ONLP_FAN_STATUS_FAILED(_fi) ) |
Fan is operating normally
| #define ONLP_FAN_STATUS_PRESENT | ( | _fi | ) | ((_fi).hdr.status & ONLP_OID_STATUS.PRESENT) |
Fan is present.
| typedef enum onlp_fan_caps_e onlp_fan_caps_t |
onlp_fan_caps
| typedef enum onlp_fan_dir_e onlp_fan_dir_t |
onlp_fan_dir
| typedef struct onlp_fan_info_s onlp_fan_info_t |
Fan information structure.
| enum onlp_fan_caps_e |
onlp_fan_caps
| enum onlp_fan_dir_e |
onlp_fan_dir
| const char* onlp_fan_caps_desc | ( | onlp_fan_caps_t | e | ) |
Enum descriptions.
| int onlp_fan_caps_get | ( | onlp_oid_t | oid, |
| uint32_t * | caps | ||
| ) |
Retrieve the fan capabilities.
| oid | The fan OID. | |
| [out] | caps | Receives the fan capabilities. |
| const char* onlp_fan_caps_name | ( | onlp_fan_caps_t | e | ) |
Enum names.
| int onlp_fan_caps_valid | ( | onlp_fan_caps_t | e | ) |
Enum validator.
| int onlp_fan_caps_value | ( | const char * | str, |
| onlp_fan_caps_t * | e, | ||
| int | substr | ||
| ) |
Enum values.
| const char* onlp_fan_dir_desc | ( | onlp_fan_dir_t | e | ) |
Enum descriptions.
| const char* onlp_fan_dir_name | ( | onlp_fan_dir_t | e | ) |
Enum names.
| int onlp_fan_dir_set | ( | onlp_oid_t | oid, |
| onlp_fan_dir_t | dir | ||
| ) |
Set the fan direction.
| oid | The fan OID. |
| dir | The fan direction (B2F or F2B) |
| int onlp_fan_dir_value | ( | const char * | str, |
| onlp_fan_dir_t * | e, | ||
| int | substr | ||
| ) |
Enum values.
| int onlp_fan_hdr_get | ( | onlp_oid_t | oid, |
| onlp_oid_hdr_t * | hdr | ||
| ) |
Retrieve the fan's OID hdr.
| oid | The fan OID. | |
| [out] | hdr | Receives the OID header. |
| int onlp_fan_hw_init | ( | uint32_t | flags | ) |
Hardware Initialization of the Fan module.
| flags | The hardware initialization flags. |
| int onlp_fan_info_from_json | ( | cJSON * | cj, |
| onlp_fan_info_t * | info | ||
| ) |
Convert a JSON object to a fan info structure.
| cj | The JSON object. | |
| [out] | info | Recieves the fan info structure. |
| int onlp_fan_info_get | ( | onlp_oid_t | oid, |
| onlp_fan_info_t * | rv | ||
| ) |
Retrieve fan information.
| oid | The fan OID. | |
| [out] | rv | Receives the fan information. |
| int onlp_fan_info_to_json | ( | onlp_fan_info_t * | info, |
| cJSON ** | cj, | ||
| uint32_t | flags | ||
| ) |
Convert a fan info structure to JSON.
| info | The fan info structure. | |
| [out] | cj | Receives the JSON object. |
| flags | The JSON format flags. |
| 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.
| info | The fan info structure. | |
| [out] | cj | Receives the JSON object. |
| flags | The JSON format flags. |
| int onlp_fan_percentage_set | ( | onlp_oid_t | oid, |
| int | p | ||
| ) |
Set the fan speed in percentage.
| oid | The fan OID. |
| p | The percentage. |
| int onlp_fan_rpm_set | ( | onlp_oid_t | oid, |
| int | rpm | ||
| ) |
Set the fan speed in RPMs.
| oid | The fan OID. |
| rpm | The new RPM. |
| int onlp_fan_sw_denit | ( | void | ) |
Deinitialize the fan software module.
| aim_map_si_t onlp_fan_caps_desc_map[] |
onlp_fan_caps_desc_map table.
| aim_map_si_t onlp_fan_caps_map[] |
onlp_fan_caps_map table.
| aim_map_si_t onlp_fan_dir_desc_map[] |
onlp_fan_dir_desc_map table.
| aim_map_si_t onlp_fan_dir_map[] |
onlp_fan_dir_map table.
1.8.13