Lines Matching refs:msg

15 			   struct pldm_msg_hdr *msg)  in pack_pldm_header_errno()  argument
17 if (msg == NULL || hdr == NULL) { in pack_pldm_header_errno()
37 msg->request = PLDM_RESPONSE; in pack_pldm_header_errno()
40 msg->request = PLDM_REQUEST; in pack_pldm_header_errno()
42 msg->datagram = datagram; in pack_pldm_header_errno()
43 msg->reserved = 0; in pack_pldm_header_errno()
44 msg->instance_id = hdr->instance; in pack_pldm_header_errno()
45 msg->header_ver = PLDM_CURRENT_VERSION; in pack_pldm_header_errno()
46 msg->type = hdr->pldm_type; in pack_pldm_header_errno()
47 msg->command = hdr->command; in pack_pldm_header_errno()
52 int unpack_pldm_header_errno(const struct pldm_msg_hdr *msg, in unpack_pldm_header_errno() argument
55 if (msg == NULL) { in unpack_pldm_header_errno()
59 if (msg->request == PLDM_RESPONSE) { in unpack_pldm_header_errno()
62 hdr->msg_type = msg->datagram ? PLDM_ASYNC_REQUEST_NOTIFY : in unpack_pldm_header_errno()
66 hdr->instance = msg->instance_id; in unpack_pldm_header_errno()
67 hdr->pldm_type = msg->type; in unpack_pldm_header_errno()
68 hdr->command = msg->command; in unpack_pldm_header_errno()
75 struct pldm_msg_hdr *msg) in pack_pldm_header() argument
80 rc = pack_pldm_header_errno(hdr, msg); in pack_pldm_header()
96 uint8_t unpack_pldm_header(const struct pldm_msg_hdr *msg, in unpack_pldm_header() argument
102 rc = unpack_pldm_header_errno(msg, hdr); in unpack_pldm_header()
127 int encode_get_types_req(uint8_t instance_id, struct pldm_msg *msg) in encode_get_types_req() argument
129 if (msg == NULL) { in encode_get_types_req()
138 return pack_pldm_header(&header, &(msg->hdr)); in encode_get_types_req()
143 struct pldm_msg *msg) in encode_get_commands_req() argument
145 if (msg == NULL) { in encode_get_commands_req()
154 uint8_t rc = pack_pldm_header(&header, &(msg->hdr)); in encode_get_commands_req()
160 (struct pldm_get_commands_req *)msg->payload; in encode_get_commands_req()
170 const bitfield8_t *types, struct pldm_msg *msg) in encode_get_types_resp() argument
172 if (msg == NULL) { in encode_get_types_resp()
181 uint8_t rc = pack_pldm_header(&header, &(msg->hdr)); in encode_get_types_resp()
187 (struct pldm_get_types_resp *)msg->payload; in encode_get_types_resp()
200 int decode_get_commands_req(const struct pldm_msg *msg, size_t payload_length, in decode_get_commands_req() argument
203 if (msg == NULL || type == NULL || version == NULL) { in decode_get_commands_req()
212 (struct pldm_get_commands_req *)msg->payload; in decode_get_commands_req()
220 const bitfield8_t *commands, struct pldm_msg *msg) in encode_get_commands_resp() argument
222 if (msg == NULL) { in encode_get_commands_resp()
230 uint8_t rc = pack_pldm_header(&header, &(msg->hdr)); in encode_get_commands_resp()
236 (struct pldm_get_commands_resp *)msg->payload; in encode_get_commands_resp()
250 int decode_get_types_resp(const struct pldm_msg *msg, size_t payload_length, in decode_get_types_resp() argument
253 if (msg == NULL || types == NULL || completion_code == NULL) { in decode_get_types_resp()
257 *completion_code = msg->payload[0]; in decode_get_types_resp()
267 (struct pldm_get_types_resp *)msg->payload; in decode_get_types_resp()
275 int decode_get_commands_resp(const struct pldm_msg *msg, size_t payload_length, in decode_get_commands_resp() argument
278 if (msg == NULL || commands == NULL || completion_code == NULL) { in decode_get_commands_resp()
282 *completion_code = msg->payload[0]; in decode_get_commands_resp()
292 (struct pldm_get_commands_resp *)msg->payload; in decode_get_commands_resp()
303 struct pldm_msg *msg) in encode_get_version_req() argument
305 if (NULL == msg) { in encode_get_version_req()
315 uint8_t rc = pack_pldm_header(&header, &(msg->hdr)); in encode_get_version_req()
321 (struct pldm_get_version_req *)msg->payload; in encode_get_version_req()
334 size_t version_size, struct pldm_msg *msg) in encode_get_version_resp() argument
336 if (NULL == msg) { in encode_get_version_resp()
346 uint8_t rc = pack_pldm_header(&header, &(msg->hdr)); in encode_get_version_resp()
352 (struct pldm_get_version_resp *)msg->payload; in encode_get_version_resp()
364 int decode_get_version_req(const struct pldm_msg *msg, size_t payload_length, in decode_get_version_req() argument
373 (struct pldm_get_version_req *)msg->payload; in decode_get_version_req()
381 int decode_get_version_resp(const struct pldm_msg *msg, size_t payload_length, in decode_get_version_resp() argument
386 if (msg == NULL || next_transfer_handle == NULL || in decode_get_version_resp()
391 *completion_code = msg->payload[0]; in decode_get_version_resp()
401 (struct pldm_get_version_resp *)msg->payload; in decode_get_version_resp()
411 int encode_get_tid_req(uint8_t instance_id, struct pldm_msg *msg) in encode_get_tid_req() argument
413 if (msg == NULL) { in encode_get_tid_req()
422 return pack_pldm_header(&header, &(msg->hdr)); in encode_get_tid_req()
427 uint8_t tid, struct pldm_msg *msg) in encode_get_tid_resp() argument
429 if (msg == NULL) { in encode_get_tid_resp()
438 uint8_t rc = pack_pldm_header(&header, &(msg->hdr)); in encode_get_tid_resp()
444 (struct pldm_get_tid_resp *)msg->payload; in encode_get_tid_resp()
452 int decode_get_tid_resp(const struct pldm_msg *msg, size_t payload_length, in decode_get_tid_resp() argument
455 if (msg == NULL || tid == NULL || completion_code == NULL) { in decode_get_tid_resp()
459 *completion_code = msg->payload[0]; in decode_get_tid_resp()
469 (struct pldm_get_tid_resp *)msg->payload; in decode_get_tid_resp()
477 int encode_set_tid_req(uint8_t instance_id, uint8_t tid, struct pldm_msg *msg) in encode_set_tid_req() argument
479 if (msg == NULL) { in encode_set_tid_req()
492 uint8_t rc = pack_pldm_header(&header, &(msg->hdr)); in encode_set_tid_req()
498 (struct pldm_set_tid_req *)msg->payload; in encode_set_tid_req()
505 int decode_multipart_receive_req(const struct pldm_msg *msg, in decode_multipart_receive_req() argument
513 if (msg == NULL || pldm_type == NULL || transfer_opflag == NULL || in decode_multipart_receive_req()
524 (struct pldm_multipart_receive_req *)msg->payload; in decode_multipart_receive_req()
560 uint8_t cc, struct pldm_msg *msg) in encode_cc_only_resp() argument
562 if (msg == NULL) { in encode_cc_only_resp()
572 uint8_t rc = pack_pldm_header(&header, &msg->hdr); in encode_cc_only_resp()
577 msg->payload[0] = cc; in encode_cc_only_resp()
585 struct pldm_msg *msg) in encode_pldm_header_only() argument
587 if (msg == NULL) { in encode_pldm_header_only()
596 return pack_pldm_header(&header, &(msg->hdr)); in encode_pldm_header_only()