Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
0002 /*
0003  * Copyright(c) 2016 Google Inc. All rights reserved.
0004  * Copyright(c) 2016 Linaro Ltd. All rights reserved.
0005  */
0006 
0007 #ifndef __ARPC_H
0008 #define __ARPC_H
0009 
0010 /* APBridgeA RPC (ARPC) */
0011 
0012 enum arpc_result {
0013     ARPC_SUCCESS        = 0x00,
0014     ARPC_NO_MEMORY      = 0x01,
0015     ARPC_INVALID        = 0x02,
0016     ARPC_TIMEOUT        = 0x03,
0017     ARPC_UNKNOWN_ERROR  = 0xff,
0018 };
0019 
0020 struct arpc_request_message {
0021     __le16  id;     /* RPC unique id */
0022     __le16  size;       /* Size in bytes of header + payload */
0023     __u8    type;       /* RPC type */
0024     __u8    data[]; /* ARPC data */
0025 } __packed;
0026 
0027 struct arpc_response_message {
0028     __le16  id;     /* RPC unique id */
0029     __u8    result;     /* Result of RPC */
0030 } __packed;
0031 
0032 /* ARPC requests */
0033 #define ARPC_TYPE_CPORT_CONNECTED       0x01
0034 #define ARPC_TYPE_CPORT_QUIESCE         0x02
0035 #define ARPC_TYPE_CPORT_CLEAR           0x03
0036 #define ARPC_TYPE_CPORT_FLUSH           0x04
0037 #define ARPC_TYPE_CPORT_SHUTDOWN        0x05
0038 
0039 struct arpc_cport_connected_req {
0040     __le16 cport_id;
0041 } __packed;
0042 
0043 struct arpc_cport_quiesce_req {
0044     __le16 cport_id;
0045     __le16 peer_space;
0046     __le16 timeout;
0047 } __packed;
0048 
0049 struct arpc_cport_clear_req {
0050     __le16 cport_id;
0051 } __packed;
0052 
0053 struct arpc_cport_flush_req {
0054     __le16 cport_id;
0055 } __packed;
0056 
0057 struct arpc_cport_shutdown_req {
0058     __le16 cport_id;
0059     __le16 timeout;
0060     __u8 phase;
0061 } __packed;
0062 
0063 #endif  /* __ARPC_H */