Ioannis Valasakis | f5e4e5e | 2018-11-09 13:54:00 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
Johan Hovold | 7d0e76d | 2016-08-10 12:58:41 +0200 | [diff] [blame] | 2 | /* |
Greg Kroah-Hartman | b3136a7 | 2016-08-10 17:02:05 +0200 | [diff] [blame] | 3 | * Copyright(c) 2016 Google Inc. All rights reserved. |
| 4 | * Copyright(c) 2016 Linaro Ltd. All rights reserved. |
Johan Hovold | 7d0e76d | 2016-08-10 12:58:41 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __ARPC_H |
| 8 | #define __ARPC_H |
| 9 | |
| 10 | /* APBridgeA RPC (ARPC) */ |
| 11 | |
| 12 | enum 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 | |
| 20 | struct 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. Silva | 84c1e51 | 2020-05-07 13:53:18 -0500 | [diff] [blame] | 24 | __u8 data[]; /* ARPC data */ |
Johan Hovold | 7d0e76d | 2016-08-10 12:58:41 +0200 | [diff] [blame] | 25 | } __packed; |
| 26 | |
| 27 | struct arpc_response_message { |
| 28 | __le16 id; /* RPC unique id */ |
| 29 | __u8 result; /* Result of RPC */ |
| 30 | } __packed; |
| 31 | |
Johan Hovold | 7d0e76d | 2016-08-10 12:58:41 +0200 | [diff] [blame] | 32 | /* ARPC requests */ |
Johan Hovold | a9dc1cf | 2016-08-10 12:58:42 +0200 | [diff] [blame] | 33 | #define ARPC_TYPE_CPORT_CONNECTED 0x01 |
Johan Hovold | 0e7cd0d | 2016-08-10 12:58:43 +0200 | [diff] [blame] | 34 | #define ARPC_TYPE_CPORT_QUIESCE 0x02 |
Johan Hovold | 6471c00 | 2016-08-10 12:58:44 +0200 | [diff] [blame] | 35 | #define ARPC_TYPE_CPORT_CLEAR 0x03 |
Johan Hovold | d2dee94 | 2016-08-26 12:55:47 +0200 | [diff] [blame] | 36 | #define ARPC_TYPE_CPORT_FLUSH 0x04 |
Johan Hovold | 77e52b3 | 2016-08-26 12:55:48 +0200 | [diff] [blame] | 37 | #define ARPC_TYPE_CPORT_SHUTDOWN 0x05 |
Johan Hovold | 7d0e76d | 2016-08-10 12:58:41 +0200 | [diff] [blame] | 38 | |
Johan Hovold | a9dc1cf | 2016-08-10 12:58:42 +0200 | [diff] [blame] | 39 | struct arpc_cport_connected_req { |
| 40 | __le16 cport_id; |
| 41 | } __packed; |
| 42 | |
Johan Hovold | 0e7cd0d | 2016-08-10 12:58:43 +0200 | [diff] [blame] | 43 | struct arpc_cport_quiesce_req { |
| 44 | __le16 cport_id; |
| 45 | __le16 peer_space; |
| 46 | __le16 timeout; |
| 47 | } __packed; |
| 48 | |
Johan Hovold | 6471c00 | 2016-08-10 12:58:44 +0200 | [diff] [blame] | 49 | struct arpc_cport_clear_req { |
| 50 | __le16 cport_id; |
| 51 | } __packed; |
| 52 | |
Johan Hovold | d2dee94 | 2016-08-26 12:55:47 +0200 | [diff] [blame] | 53 | struct arpc_cport_flush_req { |
| 54 | __le16 cport_id; |
| 55 | } __packed; |
Johan Hovold | a9dc1cf | 2016-08-10 12:58:42 +0200 | [diff] [blame] | 56 | |
Johan Hovold | 77e52b3 | 2016-08-26 12:55:48 +0200 | [diff] [blame] | 57 | struct arpc_cport_shutdown_req { |
| 58 | __le16 cport_id; |
| 59 | __le16 timeout; |
| 60 | __u8 phase; |
| 61 | } __packed; |
| 62 | |
Johan Hovold | 7d0e76d | 2016-08-10 12:58:41 +0200 | [diff] [blame] | 63 | #endif /* __ARPC_H */ |