fix releasing client ids after explicit set
authorFelix Fietkau <nbd@openwrt.org>
Sun, 9 Jun 2013 18:31:20 +0000 (20:31 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 9 Jun 2013 18:31:25 +0000 (20:31 +0200)
dev.c
uqmi.h

diff --git a/dev.c b/dev.c
index 68d404c2cbc0235a936c90356c4ce62c192953e3..4e48179356c70a70fa2bb3dee7e1e4b15a8c77fb 100644 (file)
--- 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 4c899b63af33eee42a804b2820da71171691e314..de212fcd8da195b59ea1eff925a92f469f375147 100644 (file)
--- 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;
 };