mtb-pmbus 1.3.0.1943
 
Loading...
Searching...
No Matches
Security Functions

General Description

Macros

#define MTB_PMBUS_SEC_LEVEL_ENCODED_L0   (0x01U)
 Encoded Security Level 0 value returned by mtb_pmbus_sec_get_level.
 
#define MTB_PMBUS_SEC_LEVEL_ENCODED_L1   (0x02U)
 Encoded Security Level 1 value returned by mtb_pmbus_sec_get_level.
 
#define MTB_PMBUS_SEC_LEVEL_ENCODED_L2   (0x04U)
 Encoded Security Level 2 value returned by mtb_pmbus_sec_get_level.
 
#define MTB_PMBUS_SEC_LEVEL_ENCODED_L3   (0x08U)
 Encoded Security Level 3 value returned by mtb_pmbus_sec_get_level.
 
#define MTB_PMBUS_L0_MISSING_PASSKEY   (0x01U)
 Bit set in the missing_mask output of mtb_pmbus_sec_check_l0_cmds when the PASSKEY command is absent from the command table.
 
#define MTB_PMBUS_L0_MISSING_ACCESS_CONTROL   (0x02U)
 Bit set in the missing_mask output of mtb_pmbus_sec_check_l0_cmds when the ACCESS_CONTROL command is absent from the command table.
 
#define MTB_PMBUS_L0_MISSING_WRITE_PROTECT   (0x04U)
 Bit set in the missing_mask output of mtb_pmbus_sec_check_l0_cmds when the WRITE_PROTECT command is absent from the command table.
 

Functions

uint8_t mtb_pmbus_sec_get_level (void)
 Returns the encoded Security Level currently compiled into the Middleware.
 
mtb_pmbus_status_t mtb_pmbus_sec_check_l0_cmds (mtb_pmbus_stc_t *inst, uint8_t *missing_mask)
 Checks that all mandatory Security Level 0 commands are registered in the command table.
 

Function Documentation

◆ mtb_pmbus_sec_get_level()

uint8_t mtb_pmbus_sec_get_level ( void )

Returns the encoded Security Level currently compiled into the Middleware.

Returns one of MTB_PMBUS_SEC_LEVEL_ENCODED_L0, MTB_PMBUS_SEC_LEVEL_ENCODED_L1, MTB_PMBUS_SEC_LEVEL_ENCODED_L2, or MTB_PMBUS_SEC_LEVEL_ENCODED_L3 corresponding to the value of MTB_PMBUS_SEC_LEVEL.

Returns
Encoded Security Level byte.

◆ mtb_pmbus_sec_check_l0_cmds()

mtb_pmbus_status_t mtb_pmbus_sec_check_l0_cmds ( mtb_pmbus_stc_t * inst,
uint8_t * missing_mask )

Checks that all mandatory Security Level 0 commands are registered in the command table.

Verifies that the command table pointed to by inst contains entries for:

  • PASSKEY (MTB_PMBUS_PASSKEY_CMD_CODE)
  • ACCESS_CONTROL (MTB_PMBUS_ACCESS_CONTROL_CMD_CODE)
  • WRITE_PROTECT (MTB_PMBUS_WRITE_PROTECT_CMD_CODE)
Parameters
instThe pointer to the PMBus instance.
missing_maskOutput bitmask of missing commands. Use MTB_PMBUS_L0_MISSING_PASSKEY, MTB_PMBUS_L0_MISSING_ACCESS_CONTROL, and MTB_PMBUS_L0_MISSING_WRITE_PROTECT to test individual bits. Set to 0 on success. May be NULL if the caller does not need details.
Returns
MTB_PMBUS_STATUS_SUCCESS if all three commands are present, MTB_PMBUS_STATUS_L0_CMDS_MISSING otherwise, MTB_PMBUS_STATUS_BAD_PARAM if inst is NULL.