blob: c81c7954e622eceea383ccdddc87b53d00c18859 [file] [log] [blame]
Raef Coles734aaac2022-06-15 14:37:22 +01001/*
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 Coles734aaac2022-06-15 14:37:22 +010013#include <psa/client.h>
14
15#include <platform_def.h>
16
Tamas Banff0aa682022-09-08 17:04:49 +020017
Raef Coles734aaac2022-06-15 14:37:22 +010018
19struct __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 Ban9cc87142022-10-05 11:56:04 +020023 uint8_t trailer[PLAT_RSS_COMMS_PAYLOAD_MAX_SIZE];
Raef Coles734aaac2022-06-15 14:37:22 +010024};
25
26struct __packed rss_embed_reply_t {
27 int32_t return_val;
28 uint16_t out_size[PSA_MAX_IOVEC];
Tamas Ban9cc87142022-10-05 11:56:04 +020029 uint8_t trailer[PLAT_RSS_COMMS_PAYLOAD_MAX_SIZE];
Raef Coles734aaac2022-06-15 14:37:22 +010030};
31
32psa_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
41psa_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__ */