OpenBIC
OpenSource Bridge-IC
|
#include <logging/log.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <drivers/spi_nor.h>
#include <drivers/flash.h>
#include "sensor.h"
#include "plat_def.h"
#include "pldm.h"
#include "pdr.h"
#include "hal_gpio.h"
Classes | |
struct | pldm_event_pkt |
struct | pldm_event_receiver_info |
Macros | |
#define | PLDM_MONITOR_EVENT_QUEUE_MSG_NUM_MAX PLDM_MONITOR_EVENT_QUEUE_MSG_NUM_MAX_DEFAULT |
Functions | |
LOG_MODULE_DECLARE (pldm) | |
K_FIFO_DEFINE (send_event_pkt_fifo) | |
float | pldm_sensor_cal (uint8_t *buf, uint8_t len, pldm_sensor_readings_data_type_t data_type, pldm_sensor_pdr_parm parm) |
uint8_t | pldm_get_sensor_reading (void *mctp_inst, uint8_t *buf, uint16_t len, uint8_t instance_id, uint8_t *resp, uint16_t *resp_len, void *ext_params) |
uint16_t | pldm_platform_monitor_read (void *mctp_inst, mctp_ext_params ext_params, pldm_platform_monitor_commands_t cmd, uint8_t *req, uint16_t req_len, uint8_t *rbuf, uint16_t rbuf_len) |
uint8_t | pldm_platform_event_message_req (void *mctp_inst, mctp_ext_params ext_params, uint8_t event_class, const uint8_t *event_data, uint8_t event_data_length) |
__weak void | plat_send_event_pre_work () |
K_WORK_DELAYABLE_DEFINE (send_event_pkt_work, process_event_message_queue) | |
uint8_t | pldm_send_platform_event (uint8_t event_class, uint16_t id, uint8_t ext_class, const uint8_t *event_data, uint8_t event_data_length) |
uint8_t | pldm_set_event_receiver (void *mctp_inst, uint8_t *buf, uint16_t len, uint8_t instance_id, uint8_t *resp, uint16_t *resp_len, void *ext_params) |
uint8_t | pldm_event_len_check (uint8_t *buf, uint16_t len) |
PLDM event length check function. More... | |
__weak uint8_t | pldm_platform_event_message (void *mctp_inst, uint8_t *buf, uint16_t len, uint8_t instance_id, uint8_t *resp, uint16_t *resp_len, void *ext_params) |
void | set_effecter_state_gpio_handler (const uint8_t *buf, uint16_t len, uint8_t *resp, uint16_t *resp_len, uint8_t gpio_pin) |
void | pldm_spi_reinit (const char *spi_dev_str, const uint8_t *buf, uint16_t len, uint8_t *resp, uint16_t *resp_len) |
__weak uint8_t | plat_pldm_set_state_effecter_state_handler (const uint8_t *buf, uint16_t len, uint8_t *resp, uint16_t *resp_len, struct pldm_state_effecter_info *info_p) |
__weak uint8_t | plat_pldm_get_state_effecter_state_handler (const uint8_t *buf, uint16_t len, uint8_t *resp, uint16_t *resp_len, struct pldm_state_effecter_info *info_p) |
uint8_t | pldm_set_state_effecter_states (void *mctp_inst, uint8_t *buf, uint16_t len, uint8_t instance_id, uint8_t *resp, uint16_t *resp_len, void *ext_params) |
void | get_effecter_state_gpio_handler (const uint8_t *buf, uint16_t len, uint8_t *resp, uint16_t *resp_len, uint8_t gpio_pin) |
uint8_t | pldm_get_state_effecter_states (void *mctp_inst, uint8_t *buf, uint16_t len, uint8_t instance_id, uint8_t *resp, uint16_t *resp_len, void *ext_params) |
uint8_t | pldm_get_pdr_info (void *mctp_inst, uint8_t *buf, uint16_t len, uint8_t instance_id, uint8_t *resp, uint16_t *resp_len, void *ext_params) |
uint8_t | pldm_get_pdr (void *mctp_inst, uint8_t *buf, uint16_t len, uint8_t instance_id, uint8_t *resp, uint16_t *resp_len, void *ext_params) |
uint8_t | pldm_monitor_handler_query (uint8_t code, void **ret_fn) |
__weak void | plat_pldm_set_effecter_state_host_power_control (const uint8_t *buf, uint16_t len, uint8_t *resp, uint16_t *resp_len) |
void | pldm_assign_gpio_effecter_id (int plat_effecter_id_gpio_high_byte) |
void | pldm_load_state_effecter_table (uint16_t state_effecter_index) |
__weak void | plat_pldm_load_state_effecter_table (void) |
struct pldm_state_effecter_info * | find_state_effecter_info (uint16_t effecter_id) |
uint8_t | pldm_fill_addsel_req (struct pldm_set_state_effecter_states_req *req, uint16_t effecter_id, uint8_t device_type, uint8_t board_info, uint8_t event_type) |
uint8_t | pldm_send_set_state_effecter_states_req (struct pldm_set_state_effecter_states_req *req, void *mctp_inst, mctp_ext_params ext_params) |
Variables | |
struct pldm_state_effecter_info * | state_effecter_table |
uint16_t | pldm_state_effecter_index = 0 |
#define PLDM_MONITOR_EVENT_QUEUE_MSG_NUM_MAX PLDM_MONITOR_EVENT_QUEUE_MSG_NUM_MAX_DEFAULT |
struct pldm_state_effecter_info * find_state_effecter_info | ( | uint16_t | effecter_id | ) |
void get_effecter_state_gpio_handler | ( | const uint8_t * | buf, |
uint16_t | len, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len, | ||
uint8_t | gpio_pin | ||
) |
K_FIFO_DEFINE | ( | send_event_pkt_fifo | ) |
K_WORK_DELAYABLE_DEFINE | ( | send_event_pkt_work | , |
process_event_message_queue | |||
) |
LOG_MODULE_DECLARE | ( | pldm | ) |
__weak uint8_t plat_pldm_get_state_effecter_state_handler | ( | const uint8_t * | buf, |
uint16_t | len, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len, | ||
struct pldm_state_effecter_info * | info_p | ||
) |
__weak void plat_pldm_load_state_effecter_table | ( | void | ) |
__weak void plat_pldm_set_effecter_state_host_power_control | ( | const uint8_t * | buf, |
uint16_t | len, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len | ||
) |
__weak uint8_t plat_pldm_set_state_effecter_state_handler | ( | const uint8_t * | buf, |
uint16_t | len, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len, | ||
struct pldm_state_effecter_info * | info_p | ||
) |
__weak void plat_send_event_pre_work | ( | ) |
void pldm_assign_gpio_effecter_id | ( | int | plat_effecter_id_gpio_high_byte | ) |
uint8_t pldm_event_len_check | ( | uint8_t * | buf, |
uint16_t | len | ||
) |
PLDM event length check function.
Check given event data length meet with spec.
buf | message data start from event class type |
len | Length of buf in bytes |
uint8_t pldm_fill_addsel_req | ( | struct pldm_set_state_effecter_states_req * | req, |
uint16_t | effecter_id, | ||
uint8_t | device_type, | ||
uint8_t | board_info, | ||
uint8_t | event_type | ||
) |
uint8_t pldm_get_pdr | ( | void * | mctp_inst, |
uint8_t * | buf, | ||
uint16_t | len, | ||
uint8_t | instance_id, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len, | ||
void * | ext_params | ||
) |
uint8_t pldm_get_pdr_info | ( | void * | mctp_inst, |
uint8_t * | buf, | ||
uint16_t | len, | ||
uint8_t | instance_id, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len, | ||
void * | ext_params | ||
) |
uint8_t pldm_get_sensor_reading | ( | void * | mctp_inst, |
uint8_t * | buf, | ||
uint16_t | len, | ||
uint8_t | instance_id, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len, | ||
void * | ext_params | ||
) |
uint8_t pldm_get_state_effecter_states | ( | void * | mctp_inst, |
uint8_t * | buf, | ||
uint16_t | len, | ||
uint8_t | instance_id, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len, | ||
void * | ext_params | ||
) |
void pldm_load_state_effecter_table | ( | uint16_t | state_effecter_index | ) |
uint8_t pldm_monitor_handler_query | ( | uint8_t | code, |
void ** | ret_fn | ||
) |
__weak uint8_t pldm_platform_event_message | ( | void * | mctp_inst, |
uint8_t * | buf, | ||
uint16_t | len, | ||
uint8_t | instance_id, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len, | ||
void * | ext_params | ||
) |
uint8_t pldm_platform_event_message_req | ( | void * | mctp_inst, |
mctp_ext_params | ext_params, | ||
uint8_t | event_class, | ||
const uint8_t * | event_data, | ||
uint8_t | event_data_length | ||
) |
uint16_t pldm_platform_monitor_read | ( | void * | mctp_inst, |
mctp_ext_params | ext_params, | ||
pldm_platform_monitor_commands_t | cmd, | ||
uint8_t * | req, | ||
uint16_t | req_len, | ||
uint8_t * | rbuf, | ||
uint16_t | rbuf_len | ||
) |
uint8_t pldm_send_platform_event | ( | uint8_t | event_class, |
uint16_t | id, | ||
uint8_t | ext_class, | ||
const uint8_t * | event_data, | ||
uint8_t | event_data_length | ||
) |
uint8_t pldm_send_set_state_effecter_states_req | ( | struct pldm_set_state_effecter_states_req * | req, |
void * | mctp_inst, | ||
mctp_ext_params | ext_params | ||
) |
float pldm_sensor_cal | ( | uint8_t * | buf, |
uint8_t | len, | ||
pldm_sensor_readings_data_type_t | data_type, | ||
pldm_sensor_pdr_parm | parm | ||
) |
uint8_t pldm_set_event_receiver | ( | void * | mctp_inst, |
uint8_t * | buf, | ||
uint16_t | len, | ||
uint8_t | instance_id, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len, | ||
void * | ext_params | ||
) |
uint8_t pldm_set_state_effecter_states | ( | void * | mctp_inst, |
uint8_t * | buf, | ||
uint16_t | len, | ||
uint8_t | instance_id, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len, | ||
void * | ext_params | ||
) |
void pldm_spi_reinit | ( | const char * | spi_dev_str, |
const uint8_t * | buf, | ||
uint16_t | len, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len | ||
) |
void set_effecter_state_gpio_handler | ( | const uint8_t * | buf, |
uint16_t | len, | ||
uint8_t * | resp, | ||
uint16_t * | resp_len, | ||
uint8_t | gpio_pin | ||
) |
uint16_t pldm_state_effecter_index = 0 |
struct pldm_state_effecter_info* state_effecter_table |