OpenBIC
OpenSource Bridge-IC
pldm.c File Reference
#include "pldm.h"
#include "mctp.h"
#include <logging/log.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/printk.h>
#include <sys/slist.h>
#include <zephyr.h>
#include "libutil.h"
#include "ipmi.h"
#include "plat_def.h"
Include dependency graph for pldm.c:

Classes

struct  _wait_msg
 
struct  _pldm_handler_query_entry
 
struct  _pldm_recv_resp_arg
 

Macros

#define PLDM_HDR_INST_ID_MASK   0x1F
 
#define PLDM_MAX_INSTID_COUNT   (PLDM_HDR_INST_ID_MASK + 1)
 
#define PLDM_MSG_CHECK_PER_MS   1000
 
#define PLDM_MSG_TIMEOUT_MS   30000
 
#define PLDM_RESP_MSG_PROC_MUTEX_TIMEOUT_MS   500
 
#define PLDM_TASK_NAME_MAX_SIZE   32
 
#define PLDM_MSG_MAX_RETRY   3
 
#define PLDM_READ_EVENT_SUCCESS   BIT(0)
 
#define PLDM_READ_EVENT_TIMEOUT   BIT(1)
 

Typedefs

typedef struct _wait_msg wait_msg
 
typedef struct _pldm_recv_resp_arg pldm_recv_resp_arg
 

Functions

 LOG_MODULE_REGISTER (pldm)
 
void pldm_read_resp_handler (void *args, uint8_t *rbuf, uint16_t rlen)
 
uint16_t mctp_pldm_read (void *mctp_p, pldm_msg *msg, uint8_t *rbuf, uint16_t rbuf_len)
 
uint8_t mctp_pldm_cmd_handler (void *mctp_p, uint8_t *buf, uint32_t len, mctp_ext_params ext_params)
 
uint8_t mctp_pldm_send_msg (void *mctp_p, pldm_msg *msg)
 
uint8_t get_supported_pldm_type (uint8_t *buf, uint8_t buf_size)
 Get the supported PLDM types. More...
 
uint8_t get_supported_pldm_commands (PLDM_TYPE type, uint8_t *buf, uint8_t buf_size)
 
int pldm_send_ipmi_response (uint8_t interface, ipmi_msg *msg)
 
int pldm_send_ipmi_request (ipmi_msg *msg)
 
 K_THREAD_DEFINE (pldm_wait_resp_to, 1024, pldm_msg_timeout_monitor, NULL, NULL, NULL, 7, 0, 0)
 

Macro Definition Documentation

◆ PLDM_HDR_INST_ID_MASK

#define PLDM_HDR_INST_ID_MASK   0x1F

◆ PLDM_MAX_INSTID_COUNT

#define PLDM_MAX_INSTID_COUNT   (PLDM_HDR_INST_ID_MASK + 1)

◆ PLDM_MSG_CHECK_PER_MS

#define PLDM_MSG_CHECK_PER_MS   1000

◆ PLDM_MSG_MAX_RETRY

#define PLDM_MSG_MAX_RETRY   3

◆ PLDM_MSG_TIMEOUT_MS

#define PLDM_MSG_TIMEOUT_MS   30000

◆ PLDM_READ_EVENT_SUCCESS

#define PLDM_READ_EVENT_SUCCESS   BIT(0)

◆ PLDM_READ_EVENT_TIMEOUT

#define PLDM_READ_EVENT_TIMEOUT   BIT(1)

◆ PLDM_RESP_MSG_PROC_MUTEX_TIMEOUT_MS

#define PLDM_RESP_MSG_PROC_MUTEX_TIMEOUT_MS   500

◆ PLDM_TASK_NAME_MAX_SIZE

#define PLDM_TASK_NAME_MAX_SIZE   32

Typedef Documentation

◆ pldm_recv_resp_arg

◆ wait_msg

typedef struct _wait_msg wait_msg

Function Documentation

◆ get_supported_pldm_commands()

uint8_t get_supported_pldm_commands ( PLDM_TYPE  type,
uint8_t *  buf,
uint8_t  buf_size 
)

◆ get_supported_pldm_type()

uint8_t get_supported_pldm_type ( uint8_t *  buf,
uint8_t  buf_size 
)

Get the supported PLDM types.

Parameters
bufPointer to the buffer, which should have 8 bytes
buf_sizeNumber of buf's bytes
Return values
0if successful

◆ K_THREAD_DEFINE()

K_THREAD_DEFINE ( pldm_wait_resp_to  ,
1024  ,
pldm_msg_timeout_monitor  ,
NULL  ,
NULL  ,
NULL  ,
,
,
 
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( pldm  )

◆ mctp_pldm_cmd_handler()

uint8_t mctp_pldm_cmd_handler ( void *  mctp_p,
uint8_t *  buf,
uint32_t  len,
mctp_ext_params  ext_params 
)

◆ mctp_pldm_read()

uint16_t mctp_pldm_read ( void *  mctp_p,
pldm_msg msg,
uint8_t *  rbuf,
uint16_t  rbuf_len 
)
Here is the call graph for this function:

◆ mctp_pldm_send_msg()

uint8_t mctp_pldm_send_msg ( void *  mctp_p,
pldm_msg msg 
)

◆ pldm_read_resp_handler()

void pldm_read_resp_handler ( void *  args,
uint8_t *  rbuf,
uint16_t  rlen 
)

◆ pldm_send_ipmi_request()

int pldm_send_ipmi_request ( ipmi_msg msg)
Here is the call graph for this function:

◆ pldm_send_ipmi_response()

int pldm_send_ipmi_response ( uint8_t  interface,
ipmi_msg msg 
)
Here is the call graph for this function: