^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright(c) 2016 Google Inc. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright(c) 2016 Linaro Ltd. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #ifndef __ARPC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define __ARPC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) /* APBridgeA RPC (ARPC) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) enum arpc_result {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) ARPC_SUCCESS = 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) ARPC_NO_MEMORY = 0x01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) ARPC_INVALID = 0x02,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ARPC_TIMEOUT = 0x03,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) ARPC_UNKNOWN_ERROR = 0xff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct arpc_request_message {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) __le16 id; /* RPC unique id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) __le16 size; /* Size in bytes of header + payload */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) __u8 type; /* RPC type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) __u8 data[]; /* ARPC data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct arpc_response_message {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) __le16 id; /* RPC unique id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) __u8 result; /* Result of RPC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) /* ARPC requests */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define ARPC_TYPE_CPORT_CONNECTED 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define ARPC_TYPE_CPORT_QUIESCE 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define ARPC_TYPE_CPORT_CLEAR 0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define ARPC_TYPE_CPORT_FLUSH 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define ARPC_TYPE_CPORT_SHUTDOWN 0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct arpc_cport_connected_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) __le16 cport_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct arpc_cport_quiesce_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) __le16 cport_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) __le16 peer_space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) __le16 timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) struct arpc_cport_clear_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) __le16 cport_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) struct arpc_cport_flush_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) __le16 cport_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) struct arpc_cport_shutdown_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) __le16 cport_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) __le16 timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) __u8 phase;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #endif /* __ARPC_H */