X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuqmi.git;a=blobdiff_plain;f=qmi-message.h;h=ed2338760c8701a72be79f2a0c7d22f0dca7097f;hp=02cd8810d45ad51dd579e6c8f255502b33e9ce8f;hb=HEAD;hpb=1803bd8512f72b6bb61b8c462e68fcfabc319f62 diff --git a/qmi-message.h b/qmi-message.h index 02cd881..ed23387 100644 --- a/qmi-message.h +++ b/qmi-message.h @@ -1,3 +1,24 @@ +/* + * uqmi -- tiny QMI support implementation + * + * Copyright (C) 2014-2015 Felix Fietkau + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + */ + #ifndef __UQMI_MESSAGE_H #define __UQMI_MESSAGE_H @@ -27,6 +48,12 @@ #include "qmi-enums-wms.h" #include "qmi-message-wms.h" +#include "qmi-enums-wda.h" +#include "qmi-message-wda.h" + +#include "qmi-enums-uim.h" +#include "qmi-message-uim.h" + #define qmi_set(_data, _field, _val) \ do { \ (_data)->set._field = 1; \ @@ -79,21 +106,21 @@ enum { #define QMI_BUFFER_LEN 2048 void __qmi_alloc_reset(void); -void *__qmi_alloc_static(int len); -char *__qmi_copy_string(void *data, int len); -uint8_t *__qmi_get_buf(int *ofs); +void *__qmi_alloc_static(unsigned int len); +char *__qmi_copy_string(void *data, unsigned int len); +uint8_t *__qmi_get_buf(unsigned int *ofs); static inline int tlv_data_len(struct tlv *tlv) { return le16_to_cpu(tlv->len); } -struct tlv *tlv_get_next(void **buf, int *buflen); +struct tlv *tlv_get_next(void **buf, unsigned int *buflen); void tlv_new(struct qmi_msg *qm, uint8_t type, uint16_t len, void *data); void qmi_init_request_message(struct qmi_msg *qm, QmiService service); int qmi_complete_request_message(struct qmi_msg *qm); -int qmi_check_message_status(void *buf, int len); +int qmi_check_message_status(void *buf, unsigned int len); void *qmi_msg_get_tlv_buf(struct qmi_msg *qm, int *len); #endif