Skip to content

Commit da7653f

Browse files
anderssondavem330
authored andcommitted
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. Signed-off-by: Bjorn Andersson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2897871 commit da7653f

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

include/uapi/linux/qrtr.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,36 @@ struct sockaddr_qrtr {
1313
__u32 sq_port;
1414
};
1515

16+
enum 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+
30+
struct 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+
1648
#endif /* _LINUX_QRTR_H */

net/qrtr/qrtr.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,6 @@
2626
#define QRTR_MIN_EPH_SOCKET 0x4000
2727
#define QRTR_MAX_EPH_SOCKET 0x7fff
2828

29-
enum 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-
4129
/**
4230
* struct qrtr_hdr - (I|R)PCrouter packet header
4331
* @version: protocol version

0 commit comments

Comments
 (0)