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

Data Structures

struct  onlp_psu_info_t
 

Macros

#define ONLP_PSU_INFO_CAP_IS_SET(_pinfo, _name)   ((_pinfo)->caps & ONLP_PSU_CAPS_##_name)
 
#define ONLP_PSU_STATUS_PRESENT(_pi)   ( (_pi).status & ONLP_PSU_STATUS_PRESENT )
 
#define ONLP_PSU_STATUS_MISSING(_pi)   (!ONLP_PSU_STATUS_PRESENT(_pi))
 
#define ONLP_PSU_STATUS_FAILED(_pi)   ( (_pi).status & ONLP_PSU_STATUS_FAILED)
 
#define ONLP_PSU_CAPS_VALID(_e)   (onlp_psu_caps_valid((_e)))
 
#define ONLP_PSU_TYPE_STRINGS
 
#define ONLP_PSU_TYPE_VALID(_e)   ( (0 <= (_e)) && ((_e) <= ONLP_PSU_TYPE_DC48))
 

Typedefs

typedef enum onlp_psu_caps_e onlp_psu_caps_t
 
typedef enum onlp_psu_type_e onlp_psu_type_t
 
typedef struct onlp_psu_info_t onlp_psu_info_t
 

Enumerations

enum  onlp_psu_caps_e {
  ONLP_PSU_CAPS_GET_TYPE = (1 << 0),
  ONLP_PSU_CAPS_GET_VIN = (1 << 1),
  ONLP_PSU_CAPS_GET_VOUT = (1 << 2),
  ONLP_PSU_CAPS_GET_IIN = (1 << 3),
  ONLP_PSU_CAPS_GET_IOUT = (1 << 4),
  ONLP_PSU_CAPS_GET_PIN = (1 << 5),
  ONLP_PSU_CAPS_GET_POUT = (1 << 6)
}
 
enum  onlp_psu_type_e {
  ONLP_PSU_TYPE_AC,
  ONLP_PSU_TYPE_DC12,
  ONLP_PSU_TYPE_DC48,
  ONLP_PSU_TYPE_LAST = ONLP_PSU_TYPE_DC48,
  ONLP_PSU_TYPE_COUNT,
  ONLP_PSU_TYPE_INVALID = -1
}
 

Functions

int onlp_psu_sw_init (void)
 Software initialization of the PSU module.
 
int onlp_psu_hw_init (uint32_t flags)
 Hardware initialization of the PSU module. More...
 
int onlp_psu_sw_denit (void)
 Deinitialize the psu software module. More...
 
int onlp_psu_hdr_get (onlp_oid_t oid, onlp_oid_hdr_t *rv)
 Get the PSU's oid header. More...
 
int onlp_psu_info_get (onlp_oid_t oid, onlp_psu_info_t *rv)
 Get the PSU information. More...
 
int onlp_psu_info_to_user_json (onlp_psu_info_t *info, cJSON **cj, uint32_t flags)
 Convert a PSU info structure to user JSON. More...
 
int onlp_psu_info_to_json (onlp_psu_info_t *info, cJSON **cj, uint32_t flags)
 Convert a PSU info structure to JSON. More...
 
int onlp_psu_info_from_json (cJSON *cj, onlp_psu_info_t *info)
 Convert a JSON object to a PSU info structure. More...
 
const char * onlp_psu_caps_name (onlp_psu_caps_t e)
 
int onlp_psu_caps_value (const char *str, onlp_psu_caps_t *e, int substr)
 
const char * onlp_psu_caps_desc (onlp_psu_caps_t e)
 
int onlp_psu_caps_valid (onlp_psu_caps_t e)
 
const char * onlp_psu_type_name (onlp_psu_type_t e)
 
int onlp_psu_type_value (const char *str, onlp_psu_type_t *e, int substr)
 
const char * onlp_psu_type_desc (onlp_psu_type_t e)
 

Variables

aim_map_si_t onlp_psu_caps_map []
 
aim_map_si_t onlp_psu_caps_desc_map []
 
aim_map_si_t onlp_psu_type_map []
 
aim_map_si_t onlp_psu_type_desc_map []
 

Detailed Description

Macro Definition Documentation

◆ ONLP_PSU_CAPS_VALID

#define ONLP_PSU_CAPS_VALID (   _e)    (onlp_psu_caps_valid((_e)))

validator

◆ ONLP_PSU_INFO_CAP_IS_SET

#define ONLP_PSU_INFO_CAP_IS_SET (   _pinfo,
  _name 
)    ((_pinfo)->caps & ONLP_PSU_CAPS_##_name)

Determine if a PSU capability is set.

◆ ONLP_PSU_STATUS_FAILED

#define ONLP_PSU_STATUS_FAILED (   _pi)    ( (_pi).status & ONLP_PSU_STATUS_FAILED)

PSU has failed.

◆ ONLP_PSU_STATUS_MISSING

#define ONLP_PSU_STATUS_MISSING (   _pi)    (!ONLP_PSU_STATUS_PRESENT(_pi))

PSU is missing.

◆ ONLP_PSU_STATUS_PRESENT

#define ONLP_PSU_STATUS_PRESENT (   _pi)    ( (_pi).status & ONLP_PSU_STATUS_PRESENT )

PSU is present.

◆ ONLP_PSU_TYPE_STRINGS

#define ONLP_PSU_TYPE_STRINGS
Value:
{\
"AC", \
"DC12", \
"DC48", \
}

Strings macro.

◆ ONLP_PSU_TYPE_VALID

#define ONLP_PSU_TYPE_VALID (   _e)    ( (0 <= (_e)) && ((_e) <= ONLP_PSU_TYPE_DC48))

validator

Typedef Documentation

◆ onlp_psu_caps_t

onlp_psu_caps

◆ onlp_psu_info_t

PSU Information Structure

◆ onlp_psu_type_t

onlp_psu_type

Enumeration Type Documentation

◆ onlp_psu_caps_e

onlp_psu_caps

36  {
37  ONLP_PSU_CAPS_GET_TYPE = (1 << 0),
38  ONLP_PSU_CAPS_GET_VIN = (1 << 1),
39  ONLP_PSU_CAPS_GET_VOUT = (1 << 2),
40  ONLP_PSU_CAPS_GET_IIN = (1 << 3),
41  ONLP_PSU_CAPS_GET_IOUT = (1 << 4),
42  ONLP_PSU_CAPS_GET_PIN = (1 << 5),
43  ONLP_PSU_CAPS_GET_POUT = (1 << 6),
enum onlp_psu_caps_e onlp_psu_caps_t

◆ onlp_psu_type_e

onlp_psu_type

47  {
48  ONLP_PSU_TYPE_AC,
49  ONLP_PSU_TYPE_DC12,
50  ONLP_PSU_TYPE_DC48,
51  ONLP_PSU_TYPE_LAST = ONLP_PSU_TYPE_DC48,
52  ONLP_PSU_TYPE_COUNT,
53  ONLP_PSU_TYPE_INVALID = -1,
enum onlp_psu_type_e onlp_psu_type_t

Function Documentation

◆ onlp_psu_caps_desc()

const char* onlp_psu_caps_desc ( onlp_psu_caps_t  e)

Enum descriptions.

◆ onlp_psu_caps_name()

const char* onlp_psu_caps_name ( onlp_psu_caps_t  e)

Enum names.

◆ onlp_psu_caps_valid()

int onlp_psu_caps_valid ( onlp_psu_caps_t  e)

Enum validator.

◆ onlp_psu_caps_value()

int onlp_psu_caps_value ( const char *  str,
onlp_psu_caps_t e,
int  substr 
)

Enum values.

◆ onlp_psu_hdr_get()

int onlp_psu_hdr_get ( onlp_oid_t  oid,
onlp_oid_hdr_t rv 
)

Get the PSU's oid header.

Parameters
oidThe PSU OID.
[out]rvReceives the header.

◆ onlp_psu_hw_init()

int onlp_psu_hw_init ( uint32_t  flags)

Hardware initialization of the PSU module.

Parameters
flagsThe hardware initialization flags.

◆ onlp_psu_info_from_json()

int onlp_psu_info_from_json ( cJSON *  cj,
onlp_psu_info_t info 
)

Convert a JSON object to a PSU info structure.

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

◆ onlp_psu_info_get()

int onlp_psu_info_get ( onlp_oid_t  oid,
onlp_psu_info_t rv 
)

Get the PSU information.

Parameters
oidThe PSU OID.
[out]rvReceives the information structure.

◆ onlp_psu_info_to_json()

int onlp_psu_info_to_json ( onlp_psu_info_t info,
cJSON **  cj,
uint32_t  flags 
)

Convert a PSU info structure to JSON.

Parameters
infoThe PSU info structure
[out]cjReceives the JSON object.
flagsThe JSON format flags.

◆ onlp_psu_info_to_user_json()

int onlp_psu_info_to_user_json ( onlp_psu_info_t info,
cJSON **  cj,
uint32_t  flags 
)

Convert a PSU info structure to user JSON.

Parameters
infoThe PSU info structure
[out]cjReceives the JSON object.
flagsThe JSON format flags.

◆ onlp_psu_sw_denit()

int onlp_psu_sw_denit ( void  )

Deinitialize the psu 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_psu_type_desc()

const char* onlp_psu_type_desc ( onlp_psu_type_t  e)

Enum descriptions.

◆ onlp_psu_type_name()

const char* onlp_psu_type_name ( onlp_psu_type_t  e)

Enum names.

◆ onlp_psu_type_value()

int onlp_psu_type_value ( const char *  str,
onlp_psu_type_t e,
int  substr 
)

Enum values.

Variable Documentation

◆ onlp_psu_caps_desc_map

aim_map_si_t onlp_psu_caps_desc_map[]

onlp_psu_caps_desc_map table.

◆ onlp_psu_caps_map

aim_map_si_t onlp_psu_caps_map[]

onlp_psu_caps_map table.

◆ onlp_psu_type_desc_map

aim_map_si_t onlp_psu_type_desc_map[]

onlp_psu_type_desc_map table.

◆ onlp_psu_type_map

aim_map_si_t onlp_psu_type_map[]

onlp_psu_type_map table.