X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=uqmi.h;h=dd88151045b5932aeb8a649408f65955389d948d;hb=HEAD;hp=213dbc55a164bc4a753f8c3fe67c0fcbc3f76bbf;hpb=f38d620f4c172feb435d332ad7aba353fe7326d9;p=project%2Fuqmi.git diff --git a/uqmi.h b/uqmi.h index 213dbc5..dd88151 100644 --- a/uqmi.h +++ b/uqmi.h @@ -1,8 +1,32 @@ +/* + * 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_H #define __UQMI_H +#include + #include #include + #include "qmi-message.h" #ifdef DEBUG_PACKET @@ -31,7 +55,8 @@ static inline void dump_packet(const char *prefix, void *ptr, int len) __qmi_service(QMI_SERVICE_RMTFS), \ __qmi_service(QMI_SERVICE_CAT), \ __qmi_service(QMI_SERVICE_RMS), \ - __qmi_service(QMI_SERVICE_OMA) + __qmi_service(QMI_SERVICE_OMA), \ + __qmi_service(QMI_SERVICE_WDA) #define __qmi_service(_n) __##_n enum { @@ -59,8 +84,12 @@ struct qmi_dev { uint32_t service_connected; uint32_t service_keep_cid; + uint32_t service_release_cid; uint8_t ctl_tid; + void *buf; + + bool is_mbim; }; struct qmi_request { @@ -76,10 +105,11 @@ struct qmi_request { int ret; }; +extern bool cancel_all_requests; int qmi_device_open(struct qmi_dev *qmi, const char *path); void qmi_device_close(struct qmi_dev *qmi); -int qmi_request_start(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, request_cb cb); +int qmi_request_start(struct qmi_dev *qmi, struct qmi_request *req, request_cb cb); void qmi_request_cancel(struct qmi_dev *qmi, struct qmi_request *req); int qmi_request_wait(struct qmi_dev *qmi, struct qmi_request *req); @@ -90,6 +120,7 @@ static inline bool qmi_request_pending(struct qmi_request *req) int qmi_service_connect(struct qmi_dev *qmi, QmiService svc, int client_id); int qmi_service_get_client_id(struct qmi_dev *qmi, QmiService svc); +int qmi_service_release_client_id(struct qmi_dev *qmi, QmiService svc); QmiService qmi_service_get_by_name(const char *str); const char *qmi_get_error_str(int code);