X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=dev.c;h=c25900bb9f4abb377d05e2912fa109df83a1bf4a;hb=ae8c4b22b905136967b89438e958526ac5a37604;hp=76a8f30a0c08b304b4771ddd3c61702689c7806a;hpb=0d7aa128d0bbf290b958f50851085a1586d63efa;p=project%2Fuqmi.git diff --git a/dev.c b/dev.c index 76a8f30..c25900b 100644 --- a/dev.c +++ b/dev.c @@ -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. + */ + #include #include #include @@ -230,6 +251,8 @@ int qmi_service_connect(struct qmi_dev *qmi, QmiService svc, int client_id) return req.req.ret; client_id = req.cid; + } else { + qmi->service_keep_cid |= (1 << idx); } qmi->service_data[idx].connected = true; @@ -264,7 +287,7 @@ static void __qmi_service_disconnect(struct qmi_dev *qmi, int idx) int qmi_service_release_client_id(struct qmi_dev *qmi, QmiService svc) { int idx = qmi_get_service_idx(svc); - qmi->service_keep_cid &= ~(1 << idx); + qmi->service_release_cid |= 1 << idx; return 0; } @@ -273,6 +296,7 @@ static void qmi_close_all_services(struct qmi_dev *qmi) uint32_t connected = qmi->service_connected; int idx; + qmi->service_keep_cid &= ~qmi->service_release_cid; for (idx = 0; connected; idx++, connected >>= 1) { if (!(connected & 1)) continue; @@ -339,6 +363,7 @@ QmiService qmi_service_get_by_name(const char *str) { "pds", QMI_SERVICE_PDS }, { "wds", QMI_SERVICE_WDS }, { "wms", QMI_SERVICE_WMS }, + { "wda", QMI_SERVICE_WDA }, }; int i;