2 * Copyright (C) 2014 John Crispin <blogic@openwrt.org>
3 * Copyright (C) 2016 Bjørn Mork <bjorn@mork.no>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA.
24 #include <libubox/utils.h>
28 #define MBIM_MESSAGE_TYPE_COMMAND 0x00000003
29 #define MBIM_MESSAGE_TYPE_COMMAND_DONE 0x80000003
30 #define MBIM_MESSAGE_COMMAND_TYPE_SET 1
31 #define MBIM_CID_QMI_MSG 1
33 struct mbim_message_header {
36 uint32_t transaction_id;
39 struct mbim_fragment_header {
44 struct mbim_command_message {
45 struct mbim_message_header header;
46 struct mbim_fragment_header fragment_header;
47 uint8_t service_id[16];
49 uint32_t command_type;
50 uint32_t buffer_length;
53 bool is_mbim_qmi(struct mbim_command_message *msg);
54 void mbim_qmi_cmd(struct mbim_command_message *msg, int len, uint16_t tid);