29#define SSIF_THREAD_STACK_SIZE 4096
30#define SSIF_POLLING_INTERVAL 100
31#define SSIF_MAX_IPMI_DATA_SIZE 32
32#define SSIF_BUFF_SIZE 50
34#define SSIF_TASK_NAME_LEN 32
36#define SSIF_MULTI_RD_KEY 0x0001
38#define CMD_SYS_INFO_FW_VERSION 0x01
40#define SSIF_ERR_RCD_SIZE 100
42typedef enum ssif_status {
43 SSIF_STATUS_WAIT_FOR_WR_START,
44 SSIF_STATUS_WAIT_FOR_WR_NEXT,
45 SSIF_STATUS_WAIT_FOR_RD_START,
46 SSIF_STATUS_WAIT_FOR_RD_NEXT,
48 SSIF_STATUS_WR_SINGLE_START = 0x10,
49 SSIF_STATUS_WR_MULTI_START,
50 SSIF_STATUS_WR_MIDDLE,
53 SSIF_STATUS_RD_START = 0x20,
54 SSIF_STATUS_RD_MIDDLE,
59typedef enum ssif_err_status {
61 SSIF_STATUS_INVALID_CMD,
62 SSIF_STATUS_INVALID_CMD_IN_CUR_STATUS,
63 SSIF_STATUS_INVALID_PEC,
64 SSIF_STATUS_INVALID_LEN,
65 SSIF_STATUS_ADDR_LCK_TIMEOUT,
66 SSIF_STATUS_ADDR_LOCK_ERR,
67 SSIF_STATUS_MUTEX_ERR,
68 SSIF_STATUS_RSP_MSG_TIMEOUT,
69 SSIF_STATUS_RSP_NOT_READY,
70 SSIF_STATUS_TARGET_WR_RD_ERROR,
71 SSIF_STATUS_UNKNOWN_ERR = 0xFF,
75 SSIF_WR_SINGLE = 0x02,
76 SSIF_WR_MULTI_START = 0x06,
77 SSIF_WR_MULTI_MIDDLE = 0x07,
78 SSIF_WR_MULTI_END = 0x08,
85typedef enum ssif_action {
93 uint8_t target_msgq_cnt;
96typedef struct _ssif_dev {
102 k_tid_t ssif_task_tid;
104 uint8_t task_name[SSIF_TASK_NAME_LEN];
105 struct k_thread task_thread;
106 struct k_mutex rsp_buff_mutex;
107 struct k_sem rsp_buff_sem;
109 uint16_t rsp_buf_len;
110 uint16_t remain_data_len;
112 uint16_t cur_rd_blck;
114 ssif_status_t cur_status;
115 ssif_err_status_t err_status_lst[SSIF_ERR_RCD_SIZE];
117 ssif_err_status_t err_status;
120struct ssif_wr_start {
124 uint8_t
data[SSIF_MAX_IPMI_DATA_SIZE - 2];
127struct ssif_wr_middle {
129 uint8_t
data[SSIF_MAX_IPMI_DATA_SIZE];
132struct ssif_rd_single {
137 uint8_t
data[SSIF_MAX_IPMI_DATA_SIZE - 3];
140struct ssif_rd_start {
146 uint8_t
data[SSIF_MAX_IPMI_DATA_SIZE - 5];
149struct ssif_rd_middle {
155void ssif_device_init(
struct ssif_init_cfg *config, uint8_t
size);
156ssif_err_status_t ssif_get_error_status();
157bool ssif_set_data(uint8_t channel,
ipmi_msg_cfg *msg_cfg);
158void ssif_error_record(uint8_t channel, ssif_err_status_t errcode);
159ssif_dev *ssif_inst_get_by_bus(uint8_t bus);
K_KERNEL_STACK_MEMBER(wdt_thread_stack, WDT_THREAD_STACK_SIZE)
uint8_t netfn
Definition: ipmb.h:1
#define IPMI_MSG_MAX_LENGTH
Definition: ipmb.h:71
uint8_t cmd
Definition: isl69259.c:1
uint8_t data[]
Definition: isl69259.c:2
uint8_t addr
Definition: isl69259.c:0
typedef __attribute__
Definition: mctp_ctrl.h:109
uint8_t status
Definition: mctp_ctrl.h:1
uint16_t size
Definition: pldm_oem.h:0