arpc.h 1.3 KB

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