From 42a664f5d9d6f725f8925a7e870b5df8d544a985 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 9 Jun 2013 20:31:20 +0200 Subject: [PATCH] fix releasing client ids after explicit set --- dev.c | 3 ++- uqmi.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dev.c b/dev.c index 68d404c..4e48179 100644 --- a/dev.c +++ b/dev.c @@ -266,7 +266,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; } @@ -275,6 +275,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; diff --git a/uqmi.h b/uqmi.h index 4c899b6..de212fc 100644 --- a/uqmi.h +++ b/uqmi.h @@ -62,6 +62,7 @@ struct qmi_dev { uint32_t service_connected; uint32_t service_keep_cid; + uint32_t service_release_cid; uint8_t ctl_tid; }; -- 2.25.1