[PATCH 1/2] broadband-modem-qmi: LAC/CID not given in all serving system indications

Aleksander Morgado aleksander at aleksander.es
Wed Oct 14 11:01:28 PDT 2015


LAC/CID may only be given in the serving system indications when the values
change, and therefore we shouldn't reset the values to 0 whenever they're not
reported.

This seems to happen in newer devices; older devices like the MC7710 did always
report the values in the indications.
---
 src/mm-broadband-modem-qmi.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index d306b0e..255cb21 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -4151,22 +4151,23 @@ common_process_serving_system_3gpp (MMBroadbandModemQmi *self,
                              mnc);
     }
 
+    /* Report new registration states */
+    mm_iface_modem_3gpp_update_cs_registration_state (MM_IFACE_MODEM_3GPP (self), mm_cs_registration_state);
+    mm_iface_modem_3gpp_update_ps_registration_state (MM_IFACE_MODEM_3GPP (self), mm_ps_registration_state);
+
     /* Get 3GPP location LAC and CI */
     lac = 0;
     cid = 0;
-    if (response_output) {
-        qmi_message_nas_get_serving_system_output_get_lac_3gpp (response_output, &lac, NULL);
-        qmi_message_nas_get_serving_system_output_get_cid_3gpp (response_output, &cid, NULL);
-    } else {
-        qmi_indication_nas_serving_system_output_get_lac_3gpp (indication_output, &lac, NULL);
-        qmi_indication_nas_serving_system_output_get_cid_3gpp (indication_output, &cid, NULL);
+    if ((response_output &&
+         qmi_message_nas_get_serving_system_output_get_lac_3gpp (response_output, &lac, NULL) &&
+         qmi_message_nas_get_serving_system_output_get_cid_3gpp (response_output, &cid, NULL)) ||
+        (indication_output &&
+         qmi_indication_nas_serving_system_output_get_lac_3gpp (indication_output, &lac, NULL) &&
+         qmi_indication_nas_serving_system_output_get_cid_3gpp (indication_output, &cid, NULL))) {
+        /* Only update info in the interface if we get something */
+        mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, cid);
     }
 
-    /* Report new registration states */
-    mm_iface_modem_3gpp_update_cs_registration_state (MM_IFACE_MODEM_3GPP (self), mm_cs_registration_state);
-    mm_iface_modem_3gpp_update_ps_registration_state (MM_IFACE_MODEM_3GPP (self), mm_ps_registration_state);
-    mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, cid);
-
     /* Note: don't update access technologies with the ones retrieved here; they
      * are not really the 'current' access technologies */
 }
-- 
2.6.1



More information about the ModemManager-devel mailing list