blob: 13a2da998af5f0a4e208fc0a6550fb279c284699 [file] [log] [blame]
Holger Hans Peter Freythera7d50bf2013-12-23 14:26:36 +01001#ifndef protocol_h
2#define protocol_h
3
4#include <stdint.h>
5
6/*
7 * 79 00 03 00 06 00 9C 76 B6 07 00 00 D4 00 00 00 y......v¶...Ô...
8 * 02 00 00 00 39 00 00 00 63 F9 FF FF 00 00 00 00 ....9...cùÿÿ....
9 * 41 43 51 20 53 74 61 72 74 65 64 2C 20 41 52 46 ACQ.Started,.ARF
10 * 43 4E 3D 25 64 2C 20 52 78 50 57 52 78 31 36 3D CN=%d,.RxPWRx16=
11 * 25 64 00 6C 31 5F 61 63 71 2E 63 00 %d.l1_acq.c.
12 */
13
14struct ext_log_msg {
15 uint8_t type;
16 uint16_t unknown1; /* 0x00 0x03 type??? */
17 uint16_t unknown2; /* 0x00 0x06 type??? */
18 uint64_t timestamp; /* More 32 bit but dm-commands.h */
19 uint8_t unknown3[3]; /* 0x00 0x00 0x00 */
20 uint32_t unknown4; /* 0x02 0x00 0x00 0x00 */
21 int32_t params[3]; /* three params */
22 uint8_t data[0]; /* two NULL terminated strings from here */
23} __attribute__((packed));
24
Harald Weltef5d6fee2016-01-13 22:29:10 +010025
26/* message header */
27struct diag_msg_hdr {
28 uint8_t cmd_code;
29 uint8_t timestamp_type;
30 uint8_t num_args;
31 uint8_t drop_count;
32 uint64_t ts;
33} __attribute__((packed));
34
35/* message descriptor */
36struct diag_msg_desc {
37 uint16_t line;
38 uint16_t subsys_id;
39 uint16_t subsys_mask;
40} __attribute__((packed));
41
42/* message header for DIAG_EXT_MSG_F */
43struct diag_msg_ext {
44 struct diag_msg_hdr hdr;
45 struct diag_msg_desc desc;
46 uint32_t args[0]; /* see hdr.num_args */
47 /* followed by null-terminated strings */
48} __attribute__((packed));
49
50
51/* message header for DIAG_LOG_F */
52struct diag_log_hdr {
53 uint8_t cmd_code;
54 uint8_t more;
55 uint16_t len;
56 uint8_t data[0];
57} __attribute__((packed));
58
59struct log_hdr {
60 uint16_t len;
61 uint16_t code;
62 uint64_t ts;
63 uint8_t data[0];
64} __attribute__((packed));
65
66
67/* extended DIAG packet, */
68struct diagpkt_subsys_hdr {
69 uint8_t command; /* DIAG_SUBSYS_CMD_F */
70 uint8_t subsys_id;
71 uint8_t subsys_cmd_code;
72} __attribute__((packed));
73
74int diag_push_subsys_hdr(struct msgb *msg, uint8_t subsys, uint8_t code);
75
Holger Hans Peter Freythera7d50bf2013-12-23 14:26:36 +010076#endif