Raef Coles | 734aaac | 2022-06-15 14:37:22 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2022, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __RSS_COMMS_PROTOCOL_EMBED_H__ |
| 9 | #define __RSS_COMMS_PROTOCOL_EMBED_H__ |
| 10 | |
| 11 | #include <cdefs.h> |
| 12 | |
Raef Coles | 734aaac | 2022-06-15 14:37:22 +0100 | [diff] [blame] | 13 | #include <psa/client.h> |
| 14 | |
| 15 | #include <platform_def.h> |
| 16 | |
Tamas Ban | ff0aa68 | 2022-09-08 17:04:49 +0200 | [diff] [blame] | 17 | |
Raef Coles | 734aaac | 2022-06-15 14:37:22 +0100 | [diff] [blame] | 18 | |
| 19 | struct __packed rss_embed_msg_t { |
| 20 | psa_handle_t handle; |
| 21 | uint32_t ctrl_param; /* type, in_len, out_len */ |
| 22 | uint16_t io_size[PSA_MAX_IOVEC]; |
Tamas Ban | 9cc8714 | 2022-10-05 11:56:04 +0200 | [diff] [blame] | 23 | uint8_t trailer[PLAT_RSS_COMMS_PAYLOAD_MAX_SIZE]; |
Raef Coles | 734aaac | 2022-06-15 14:37:22 +0100 | [diff] [blame] | 24 | }; |
| 25 | |
| 26 | struct __packed rss_embed_reply_t { |
| 27 | int32_t return_val; |
| 28 | uint16_t out_size[PSA_MAX_IOVEC]; |
Tamas Ban | 9cc8714 | 2022-10-05 11:56:04 +0200 | [diff] [blame] | 29 | uint8_t trailer[PLAT_RSS_COMMS_PAYLOAD_MAX_SIZE]; |
Raef Coles | 734aaac | 2022-06-15 14:37:22 +0100 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | psa_status_t rss_protocol_embed_serialize_msg(psa_handle_t handle, |
| 33 | int16_t type, |
| 34 | const psa_invec *in_vec, |
| 35 | uint8_t in_len, |
| 36 | const psa_outvec *out_vec, |
| 37 | uint8_t out_len, |
| 38 | struct rss_embed_msg_t *msg, |
| 39 | size_t *msg_len); |
| 40 | |
| 41 | psa_status_t rss_protocol_embed_deserialize_reply(psa_outvec *out_vec, |
| 42 | uint8_t out_len, |
| 43 | psa_status_t *return_val, |
| 44 | const struct rss_embed_reply_t *reply, |
| 45 | size_t reply_size); |
| 46 | |
| 47 | #endif /* __RSS_COMMS_PROTOCOL_EMBED_H__ */ |