Blame view

drivers/greybus/arpc.h 1.27 KB
f5e4e5e7a   Ioannis Valasakis   staging: greybus:...
1
  /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
7d0e76d6c   Johan Hovold   greybus: arpc: mo...
2
  /*
b3136a77a   Greg Kroah-Hartman   greybus: fix up c...
3
4
   * Copyright(c) 2016 Google Inc. All rights reserved.
   * Copyright(c) 2016 Linaro Ltd. All rights reserved.
7d0e76d6c   Johan Hovold   greybus: arpc: mo...
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   */
  
  #ifndef __ARPC_H
  #define __ARPC_H
  
  /* APBridgeA RPC (ARPC) */
  
  enum arpc_result {
  	ARPC_SUCCESS		= 0x00,
  	ARPC_NO_MEMORY		= 0x01,
  	ARPC_INVALID		= 0x02,
  	ARPC_TIMEOUT		= 0x03,
  	ARPC_UNKNOWN_ERROR	= 0xff,
  };
  
  struct arpc_request_message {
  	__le16	id;		/* RPC unique id */
  	__le16	size;		/* Size in bytes of header + payload */
  	__u8	type;		/* RPC type */
  	__u8	data[0];	/* ARPC data */
  } __packed;
  
  struct arpc_response_message {
  	__le16	id;		/* RPC unique id */
  	__u8	result;		/* Result of RPC */
  } __packed;
7d0e76d6c   Johan Hovold   greybus: arpc: mo...
31
  /* ARPC requests */
a9dc1cf5b   Johan Hovold   greybus: hd/es2: ...
32
  #define ARPC_TYPE_CPORT_CONNECTED		0x01
0e7cd0d25   Johan Hovold   greybus: hd/es2: ...
33
  #define ARPC_TYPE_CPORT_QUIESCE			0x02
6471c0039   Johan Hovold   greybus: hd/es2: ...
34
  #define ARPC_TYPE_CPORT_CLEAR			0x03
d2dee94b6   Johan Hovold   greybus: es2: imp...
35
  #define ARPC_TYPE_CPORT_FLUSH			0x04
77e52b3b0   Johan Hovold   greybus: es2: imp...
36
  #define ARPC_TYPE_CPORT_SHUTDOWN		0x05
7d0e76d6c   Johan Hovold   greybus: arpc: mo...
37

a9dc1cf5b   Johan Hovold   greybus: hd/es2: ...
38
39
40
  struct arpc_cport_connected_req {
  	__le16 cport_id;
  } __packed;
0e7cd0d25   Johan Hovold   greybus: hd/es2: ...
41
42
43
44
45
  struct arpc_cport_quiesce_req {
  	__le16 cport_id;
  	__le16 peer_space;
  	__le16 timeout;
  } __packed;
6471c0039   Johan Hovold   greybus: hd/es2: ...
46
47
48
  struct arpc_cport_clear_req {
  	__le16 cport_id;
  } __packed;
d2dee94b6   Johan Hovold   greybus: es2: imp...
49
50
51
  struct arpc_cport_flush_req {
  	__le16 cport_id;
  } __packed;
a9dc1cf5b   Johan Hovold   greybus: hd/es2: ...
52

77e52b3b0   Johan Hovold   greybus: es2: imp...
53
54
55
56
57
  struct arpc_cport_shutdown_req {
  	__le16 cport_id;
  	__le16 timeout;
  	__u8 phase;
  } __packed;
7d0e76d6c   Johan Hovold   greybus: arpc: mo...
58
  #endif	/* __ARPC_H */