History

net: qrtr: Add control packet definition to uapi

The QMUX protocol specification defines structure of the special control packet messages being sent between handlers of the control port. Add these to the uapi header, as this structure and the associated types are shared between the kernel and all userspace handlers of control messages.

Bjorn Andersson committed 9 years ago

Commit da7653f1 parent 28978712 files · +32 −12Browse files

Unified · Split

2 files
  1. include/uapi/linux/qrtr.h +32 −0
  2. net/qrtr/qrtr.c +0 −12
include/uapi/linux/qrtr.h+32−0
@@ -13,4 +13,36 @@ struct sockaddr_qrtr { · 12 unmodified lines
13 __u32 sq_port;13 __u32 sq_port;
14};14};
15 15
16enum qrtr_pkt_type {
17 QRTR_TYPE_DATA = 1,
18 QRTR_TYPE_HELLO = 2,
19 QRTR_TYPE_BYE = 3,
20 QRTR_TYPE_NEW_SERVER = 4,
21 QRTR_TYPE_DEL_SERVER = 5,
22 QRTR_TYPE_DEL_CLIENT = 6,
23 QRTR_TYPE_RESUME_TX = 7,
24 QRTR_TYPE_EXIT = 8,
25 QRTR_TYPE_PING = 9,
26 QRTR_TYPE_NEW_LOOKUP = 10,
27 QRTR_TYPE_DEL_LOOKUP = 11,
28};
29
30struct qrtr_ctrl_pkt {
31 __le32 cmd;
32
33 union {
34 struct {
35 __le32 service;
36 __le32 instance;
37 __le32 node;
38 __le32 port;
39 } server;
40
41 struct {
42 __le32 node;
43 __le32 port;
44 } client;
45 };
46} __packed;
47
16#endif /* _LINUX_QRTR_H */48#endif /* _LINUX_QRTR_H */
net/qrtr/qrtr.c+0−12
@@ -26,18 +26,6 @@ · 25 unmodified lines
26#define QRTR_MIN_EPH_SOCKET 0x400026#define QRTR_MIN_EPH_SOCKET 0x4000
27#define QRTR_MAX_EPH_SOCKET 0x7fff27#define QRTR_MAX_EPH_SOCKET 0x7fff
28 28
29enum qrtr_pkt_type {
30 QRTR_TYPE_DATA = 1,
31 QRTR_TYPE_HELLO = 2,
32 QRTR_TYPE_BYE = 3,
33 QRTR_TYPE_NEW_SERVER = 4,
34 QRTR_TYPE_DEL_SERVER = 5,
35 QRTR_TYPE_DEL_CLIENT = 6,
36 QRTR_TYPE_RESUME_TX = 7,
37 QRTR_TYPE_EXIT = 8,
38 QRTR_TYPE_PING = 9,
39};
40
41/**29/**
42 * struct qrtr_hdr - (I|R)PCrouter packet header30 * struct qrtr_hdr - (I|R)PCrouter packet header
43 * @version: protocol version31 * @version: protocol version