blob: b9ea81b55b29a8840a912d244ca0d6b43dc21e09 [file] [log] [blame]
Ioannis Valasakisf5e4e5e2018-11-09 13:54:00 +00001/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
Johan Hovold7d0e76d2016-08-10 12:58:41 +02002/*
Greg Kroah-Hartmanb3136a72016-08-10 17:02:05 +02003 * Copyright(c) 2016 Google Inc. All rights reserved.
4 * Copyright(c) 2016 Linaro Ltd. All rights reserved.
Johan Hovold7d0e76d2016-08-10 12:58:41 +02005 */
6
7#ifndef __ARPC_H
8#define __ARPC_H
9
10/* APBridgeA RPC (ARPC) */
11
12enum arpc_result {
13 ARPC_SUCCESS = 0x00,
14 ARPC_NO_MEMORY = 0x01,
15 ARPC_INVALID = 0x02,
16 ARPC_TIMEOUT = 0x03,
17 ARPC_UNKNOWN_ERROR = 0xff,
18};
19
20struct arpc_request_message {
21 __le16 id; /* RPC unique id */
22 __le16 size; /* Size in bytes of header + payload */
23 __u8 type; /* RPC type */
Gustavo A. R. Silva84c1e512020-05-07 13:53:18 -050024 __u8 data[]; /* ARPC data */
Johan Hovold7d0e76d2016-08-10 12:58:41 +020025} __packed;
26
27struct arpc_response_message {
28 __le16 id; /* RPC unique id */
29 __u8 result; /* Result of RPC */
30} __packed;
31
Johan Hovold7d0e76d2016-08-10 12:58:41 +020032/* ARPC requests */
Johan Hovolda9dc1cf2016-08-10 12:58:42 +020033#define ARPC_TYPE_CPORT_CONNECTED 0x01
Johan Hovold0e7cd0d2016-08-10 12:58:43 +020034#define ARPC_TYPE_CPORT_QUIESCE 0x02
Johan Hovold6471c002016-08-10 12:58:44 +020035#define ARPC_TYPE_CPORT_CLEAR 0x03
Johan Hovoldd2dee942016-08-26 12:55:47 +020036#define ARPC_TYPE_CPORT_FLUSH 0x04
Johan Hovold77e52b32016-08-26 12:55:48 +020037#define ARPC_TYPE_CPORT_SHUTDOWN 0x05
Johan Hovold7d0e76d2016-08-10 12:58:41 +020038
Johan Hovolda9dc1cf2016-08-10 12:58:42 +020039struct arpc_cport_connected_req {
40 __le16 cport_id;
41} __packed;
42
Johan Hovold0e7cd0d2016-08-10 12:58:43 +020043struct arpc_cport_quiesce_req {
44 __le16 cport_id;
45 __le16 peer_space;
46 __le16 timeout;
47} __packed;
48
Johan Hovold6471c002016-08-10 12:58:44 +020049struct arpc_cport_clear_req {
50 __le16 cport_id;
51} __packed;
52
Johan Hovoldd2dee942016-08-26 12:55:47 +020053struct arpc_cport_flush_req {
54 __le16 cport_id;
55} __packed;
Johan Hovolda9dc1cf2016-08-10 12:58:42 +020056
Johan Hovold77e52b32016-08-26 12:55:48 +020057struct arpc_cport_shutdown_req {
58 __le16 cport_id;
59 __le16 timeout;
60 __u8 phase;
61} __packed;
62
Johan Hovold7d0e76d2016-08-10 12:58:41 +020063#endif /* __ARPC_H */