uqmi: commands-uim: fix uninitialized use of card_application_state
[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 #include <libubox/utils.h>
26 #include <stdint.h>
27
28 struct qmux {
29 uint16_t len;
30 uint8_t flags;
31 uint8_t service;
32 uint8_t client;
33 } __packed;
34
35 struct tlv {
36 uint8_t type;
37 uint16_t len;
38 uint8_t data[];
39 } __packed;
40
41 struct qmi_ctl {
42 uint8_t transaction;
43 uint16_t message;
44 uint16_t tlv_len;
45 struct tlv tlv[];
46 } __packed;
47
48 struct qmi_svc {
49 uint16_t transaction;
50 uint16_t message;
51 uint16_t tlv_len;
52 struct tlv tlv[];
53 } __packed;
54
55 struct qmi_msg {
56 uint8_t marker;
57 struct qmux qmux;
58 uint8_t flags;
59 union {
60 struct qmi_ctl ctl;
61 struct qmi_svc svc;
62 };
63 } __packed;
64
65 #endif