ONLP
Open Network Linux Platform APIs
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables

Data Structures

struct  onlp_thermal_info_s
 

Macros

#define ONLP_THERMAL_CAPS_ALL   0xF
 
#define ONLP_THERMAL_CAPS_GET_ANY_THRESHOLD
 
#define ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS
 
#define ONLP_THERMAL_INFO_CAP_IS_SET(_pinfo, _name)   ((_pinfo)->caps & ONLP_THERMAL_CAPS_##_name)
 
#define ONLP_THERMAL_CAPS_VALID(_e)   (onlp_thermal_caps_valid((_e)))
 
#define ONLP_THERMAL_THRESHOLD_VALID(_e)   (onlp_thermal_threshold_valid((_e)))
 

Typedefs

typedef enum onlp_thermal_caps_e onlp_thermal_caps_t
 
typedef enum onlp_thermal_threshold_e onlp_thermal_threshold_t
 
typedef struct onlp_thermal_info_s onlp_thermal_info_t
 

Enumerations

enum  onlp_thermal_caps_e {
  ONLP_THERMAL_CAPS_GET_TEMPERATURE = (1 << 0),
  ONLP_THERMAL_CAPS_GET_WARNING_THRESHOLD = (1 << 1),
  ONLP_THERMAL_CAPS_GET_ERROR_THRESHOLD = (1 << 2),
  ONLP_THERMAL_CAPS_GET_SHUTDOWN_THRESHOLD = (1 << 3)
}
 
enum  onlp_thermal_threshold_e {
  ONLP_THERMAL_THRESHOLD_WARNING_DEFAULT = 45000,
  ONLP_THERMAL_THRESHOLD_ERROR_DEFAULT = 55000,
  ONLP_THERMAL_THRESHOLD_SHUTDOWN_DEFAULT = 60000
}
 

Functions

int onlp_thermal_sw_init (void)
 Software initialization of the thermal module.
 
int onlp_thermal_hw_init (uint32_t flags)
 Hardware initialization of the thermal module. More...
 
int onlp_thermal_sw_denit (void)
 Deinitialize the thermal software module. More...
 
int onlp_thermal_hdr_get (onlp_oid_t oid, onlp_oid_hdr_t *rv)
 Retrieve the thermal's oid header. More...
 
int onlp_thermal_info_get (onlp_oid_t oid, onlp_thermal_info_t *rv)
 Retrieve information about the given thermal id. More...
 
int onlp_thermal_info_to_json (onlp_thermal_info_t *info, cJSON **rv, uint32_t flags)
 Convert a thermal info structure to json. More...
 
int onlp_thermal_info_from_json (cJSON *cj, onlp_thermal_info_t *info)
 Convert a JSON object to a thermal info structure. More...
 
int onlp_thermal_info_to_user_json (onlp_thermal_info_t *info, cJSON **rv, uint32_t flags)
 Convert a thermal info structure to user json. More...
 
const char * onlp_thermal_caps_name (onlp_thermal_caps_t e)
 
int onlp_thermal_caps_value (const char *str, onlp_thermal_caps_t *e, int substr)
 
const char * onlp_thermal_caps_desc (onlp_thermal_caps_t e)
 
int onlp_thermal_caps_valid (onlp_thermal_caps_t e)
 
const char * onlp_thermal_threshold_name (onlp_thermal_threshold_t e)
 
int onlp_thermal_threshold_value (const char *str, onlp_thermal_threshold_t *e, int substr)
 
const char * onlp_thermal_threshold_desc (onlp_thermal_threshold_t e)
 
int onlp_thermal_threshold_valid (onlp_thermal_threshold_t e)
 

Variables

aim_map_si_t onlp_thermal_caps_map []
 
aim_map_si_t onlp_thermal_caps_desc_map []
 
aim_map_si_t onlp_thermal_threshold_map []
 
aim_map_si_t onlp_thermal_threshold_desc_map []
 

Detailed Description

Macro Definition Documentation

◆ ONLP_THERMAL_CAPS_ALL

#define ONLP_THERMAL_CAPS_ALL   0xF

Shortcut for specifying all capabilties.

◆ ONLP_THERMAL_CAPS_GET_ANY_THRESHOLD

#define ONLP_THERMAL_CAPS_GET_ANY_THRESHOLD
Value:
( ONLP_THERMAL_CAPS_GET_WARNING_THRESHOLD | \
ONLP_THERMAL_CAPS_GET_ERROR_THRESHOLD | \
ONLP_THERMAL_CAPS_GET_SHUTDOWN_THRESHOLD )

Shortcut for determining the availability of any threshold value.

◆ ONLP_THERMAL_CAPS_VALID

#define ONLP_THERMAL_CAPS_VALID (   _e)    (onlp_thermal_caps_valid((_e)))

validator

◆ ONLP_THERMAL_INFO_CAP_IS_SET

#define ONLP_THERMAL_INFO_CAP_IS_SET (   _pinfo,
  _name 
)    ((_pinfo)->caps & ONLP_THERMAL_CAPS_##_name)

Determine if a thermal capability is set.

◆ ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS

#define ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS
Value:
{ ONLP_THERMAL_THRESHOLD_WARNING_DEFAULT, \
ONLP_THERMAL_THRESHOLD_ERROR_DEFAULT, \
ONLP_THERMAL_THRESHOLD_SHUTDOWN_DEFAULT }

Shortcut for all default thermal threshold value.

◆ ONLP_THERMAL_THRESHOLD_VALID

#define ONLP_THERMAL_THRESHOLD_VALID (   _e)    (onlp_thermal_threshold_valid((_e)))

validator

Typedef Documentation

◆ onlp_thermal_caps_t

onlp_thermal_caps

◆ onlp_thermal_info_t

Thermal sensor information structure.

◆ onlp_thermal_threshold_t

onlp_thermal_threshold

Enumeration Type Documentation

◆ onlp_thermal_caps_e

onlp_thermal_caps

37  {
38  ONLP_THERMAL_CAPS_GET_TEMPERATURE = (1 << 0),
39  ONLP_THERMAL_CAPS_GET_WARNING_THRESHOLD = (1 << 1),
40  ONLP_THERMAL_CAPS_GET_ERROR_THRESHOLD = (1 << 2),
41  ONLP_THERMAL_CAPS_GET_SHUTDOWN_THRESHOLD = (1 << 3),
enum onlp_thermal_caps_e onlp_thermal_caps_t

◆ onlp_thermal_threshold_e

onlp_thermal_threshold

45  {
46  ONLP_THERMAL_THRESHOLD_WARNING_DEFAULT = 45000,
47  ONLP_THERMAL_THRESHOLD_ERROR_DEFAULT = 55000,
48  ONLP_THERMAL_THRESHOLD_SHUTDOWN_DEFAULT = 60000,
enum onlp_thermal_threshold_e onlp_thermal_threshold_t

Function Documentation

◆ onlp_thermal_caps_desc()

const char* onlp_thermal_caps_desc ( onlp_thermal_caps_t  e)

Enum descriptions.

◆ onlp_thermal_caps_name()

const char* onlp_thermal_caps_name ( onlp_thermal_caps_t  e)

Enum names.

◆ onlp_thermal_caps_valid()

int onlp_thermal_caps_valid ( onlp_thermal_caps_t  e)

Enum validator.

◆ onlp_thermal_caps_value()

int onlp_thermal_caps_value ( const char *  str,
onlp_thermal_caps_t e,
int  substr 
)

Enum values.

◆ onlp_thermal_hdr_get()

int onlp_thermal_hdr_get ( onlp_oid_t  oid,
onlp_oid_hdr_t rv 
)

Retrieve the thermal's oid header.

Parameters
oidThe thermal oid.
[out]rvReceives the header.

◆ onlp_thermal_hw_init()

int onlp_thermal_hw_init ( uint32_t  flags)

Hardware initialization of the thermal module.

Parameters
flagsThe hardware initialization flags.

◆ onlp_thermal_info_from_json()

int onlp_thermal_info_from_json ( cJSON *  cj,
onlp_thermal_info_t info 
)

Convert a JSON object to a thermal info structure.

Parameters
cjThe JSON object representing the structure.
[out]infoReceives the thermal info.

◆ onlp_thermal_info_get()

int onlp_thermal_info_get ( onlp_oid_t  oid,
onlp_thermal_info_t rv 
)

Retrieve information about the given thermal id.

Parameters
oidThe thermal oid.
[out]rvReceives the thermal information.

◆ onlp_thermal_info_to_json()

int onlp_thermal_info_to_json ( onlp_thermal_info_t info,
cJSON **  rv,
uint32_t  flags 
)

Convert a thermal info structure to json.

Parameters
infoThe thermal info structure.
[out]rvReceives the JSON object.
flagsThe JSON processing flags.

◆ onlp_thermal_info_to_user_json()

int onlp_thermal_info_to_user_json ( onlp_thermal_info_t info,
cJSON **  rv,
uint32_t  flags 
)

Convert a thermal info structure to user json.

Parameters
infoThe thermal info structure.
[out]rvReceives the JSON object.
flagsThe JSON processing flags.
Note
The user json format contains only the fields relevant to user output.

◆ onlp_thermal_sw_denit()

int onlp_thermal_sw_denit ( void  )

Deinitialize the thermal software module.

Note
The primary purpose of this API is to properly deallocate any resources used by the module in order faciliate detection of real resouce leaks.

◆ onlp_thermal_threshold_desc()

const char* onlp_thermal_threshold_desc ( onlp_thermal_threshold_t  e)

Enum descriptions.

◆ onlp_thermal_threshold_name()

const char* onlp_thermal_threshold_name ( onlp_thermal_threshold_t  e)

Enum names.

◆ onlp_thermal_threshold_valid()

int onlp_thermal_threshold_valid ( onlp_thermal_threshold_t  e)

Enum validator.

◆ onlp_thermal_threshold_value()

int onlp_thermal_threshold_value ( const char *  str,
onlp_thermal_threshold_t e,
int  substr 
)

Enum values.

Variable Documentation

◆ onlp_thermal_caps_desc_map

aim_map_si_t onlp_thermal_caps_desc_map[]

onlp_thermal_caps_desc_map table.

◆ onlp_thermal_caps_map

aim_map_si_t onlp_thermal_caps_map[]

onlp_thermal_caps_map table.

◆ onlp_thermal_threshold_desc_map

aim_map_si_t onlp_thermal_threshold_desc_map[]

onlp_thermal_threshold_desc_map table.

◆ onlp_thermal_threshold_map

aim_map_si_t onlp_thermal_threshold_map[]

onlp_thermal_threshold_map table.