uqmi: print radio interfaces in serving system command
[project/uqmi.git] / qmi-struct.h
1 /*
2 * uqmi -- tiny QMI support implementation
3 *
4 * Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA.
20 */
21
22 #ifndef __QMI_STRUCT_H
23 #define __QMI_STRUCT_H
24
25 struct qmux {
26 uint16_t len;
27 uint8_t flags;
28 uint8_t service;
29 uint8_t client;
30 } __packed;
31
32 struct tlv {
33 uint8_t type;
34 uint16_t len;
35 uint8_t data[];
36 } __packed;
37
38 struct qmi_ctl {
39 uint8_t transaction;
40 uint16_t message;
41 uint16_t tlv_len;
42 struct tlv tlv[];
43 } __packed;
44
45 struct qmi_svc {
46 uint16_t transaction;
47 uint16_t message;
48 uint16_t tlv_len;
49 struct tlv tlv[];
50 } __packed;
51
52 struct qmi_msg {
53 uint8_t marker;
54 struct qmux qmux;
55 uint8_t flags;
56 union {
57 struct qmi_ctl ctl;
58 struct qmi_svc svc;
59 };
60 } __packed;
61
62 #endif