+/*
+ * uqmi -- tiny QMI support implementation
+ *
+ * Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
+ *
+ * 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 <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
return req.req.ret;
client_id = req.cid;
+ } else {
+ qmi->service_keep_cid |= (1 << idx);
}
qmi->service_data[idx].connected = true;
qmi_request_wait(qmi, &req);
}
+int qmi_service_release_client_id(struct qmi_dev *qmi, QmiService svc)
+{
+ int idx = qmi_get_service_idx(svc);
+ qmi->service_release_cid |= 1 << idx;
+ return 0;
+}
+
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;
{ "pds", QMI_SERVICE_PDS },
{ "wds", QMI_SERVICE_WDS },
{ "wms", QMI_SERVICE_WMS },
+ { "wda", QMI_SERVICE_WDA },
};
int i;