QMI: 'not-registered' registration state not considered because no valid access tech available
---ascii Hello,
MM: 1.14.8, built with --with-at-command-via-dbus OS: BuildRoot embedded system Modem: EC20R1 QMI-mode
Problem: If the modem loses registration, the 3GPP "RegistrationState" property is not updated.
Reproduction:
- Register modem and connect bearer
- Pull out the antenna so that the modem loses reception.
- The modem sends a QMI indication, but this is not processed.
Debug log (note: "VD:" indicates additional outputs): Feb 10 10:46:42 VdLrp2 ModemManager [7152]: [/ dev / cdc-wdm0] received generic indication (translated) ... <<<<<< QMUX: <<<<<< length = 33 <<<<<< flags = 0x80 <<<<<< service = "nas" <<<<<< client = 3 <<<<<< QMI: <<<<<< flags = "indication" <<<<<< transaction = 0 <<<<<< tlv_length = 21 <<<<<< message = "Serving System" (0x0024) <<<<<< TLV: <<<<<< type = "Detailed Service Status" (0x22) <<<<<< length = 5 <<<<<< value = 00: 03: 04: 01: 00 <<<<<< translated = [status = 'none' capability = 'cs-ps' hdr_status = 'power-save' hdr_hybrid = 'yes' forbidden = 'no'] <<<<<< TLV: <<<<<< type = "Data Service Capability" (0x11) <<<<<< length = 1 <<<<<< value = 00 <<<<<< translated = {} <<<<<< TLV: <<<<<< type = "Serving System" (0x01) <<<<<< length = 6 <<<<<< value = 00: 01: 01: 00: 01: 00 <<<<<< translated = [registration_state = 'not-registered' cs_attach_state = 'attached' ps_attach_state = 'attached' selected_network = 'unknown' radio_interfaces = '{[0] =' none '}'] Feb 10 10:46:42 VdLrp2 ModemManager [7152]: [modem1] VD: Got mm_modem_accesstechnologies from radio_interface_array 0 Feb 10 10:46:42 VdLrp2 ModemManager [7152]: [modem1] no 3GPP info given ... VD: mm_access_technologies: 0 Feb 10 10:46:42 VdLrp2 ModemManager [7152]: [modem1] couldn't load operator code: Current operator MCC / MNC is still unknown Feb 10 10:46:42 VdLrp2 ModemManager [7152]: [modem1] couldn't load operator name: Current operator description is still unknown
This is my PropertiesChanged handler:
Feb 10 10:46:42 VdLrp2 otad.py [7212]: (RmdModemPropertiesChangedHandler / 3452): Properties-Message / BearerLost (MPath: / org / freedesktop / ModemManager1 / Modem / 1 Object: org.freedesktop.ModemManager1.Modem.Modem3gpp :) { "OperatorCode": "" }
Guess: The problem lies in "mm-broadband-modem-qmi.c, common_process_serving_system_3gpp ()" in this area: / * Build access technologies mask * / data_service_capabilities = NULL; if (response_output) qmi_message_nas_get_serving_system_output_get_data_service_capability (response_output, & data_service_capabilities, NULL); else qmi_indication_nas_serving_system_output_get_data_service_capability (indication_output, & data_service_capabilities, NULL);
if (data_service_capabilities && data_service_capabilities-> len> 0)
mm_access_technologies =
mm_modem_access_technologies_from_qmi_data_capability_array (data_service_capabilities);
else
mm_access_technologies =
mm_modem_access_technologies_from_qmi_radio_interface_array (radio_interfaces);
/ * Only process 3GPP info.
* Seen the case already where 'selected_network' gives UNKNOWN but we still
* have valid LTE / 5GNR info around. * /
if (selected_network == QMI_NAS_NETWORK_TYPE_3GPP ||
(selected_network == QMI_NAS_NETWORK_TYPE_UNKNOWN &&
(mm_access_technologies & MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK))) {
mm_obj_dbg (self, "processing 3GPP info ...");
} else {
MMModem3gppRegistrationState reg_state_3gpp;
mm_obj_dbg (self, "no 3GPP info given ...");
if (self-> priv-> current_operator_id || self-> priv-> current_operator_description)
operator_updated = TRUE
;
The software runs through the branch "no 3GPP info given ...", but at this point it should be "processing 3GPP info ..." branch through.
The "no 3GPP info given ..." branch is selected because the "selected_network = 'unknown'", as well as the "radio_interfaces = '{[0] =' none '}'" are reported.
With the following, admittedly "stupid" change, the following behavior shows up: if (selected_network == QMI_NAS_NETWORK_TYPE_3GPP || selected_network == QMI_NAS_NETWORK_TYPE_UNKNOWN || << - Changed (selected_network == QMI_NAS_NETWORK_TYPE_UNKNOWN && (mm_access_technologies & MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK))) { mm_obj_dbg (self, "processing 3GPP info ...");
Feb 09 17:39:21 VdLrp2 ModemManager [6303]: [/ dev / cdc-wdm0] received generic indication (translated) ... <<<<<< QMUX: <<<<<< length = 33 <<<<<< flags = 0x80 <<<<<< service = "nas" <<<<<< client = 3 <<<<<< QMI: <<<<<< flags = "indication" <<<<<< transaction = 0 <<<<<< tlv_length = 21 <<<<<< message = "Serving System" (0x0024) <<<<<< TLV: <<<<<< type = "Detailed Service Status" (0x22) <<<<<< length = 5 <<<<<< value = 00: 03: 04: 01: 00 <<<<<< translated = [status = 'none' capability = 'cs-ps' hdr_status = 'power-save' hdr_hybrid = 'yes' forbidden = 'no'] <<<<<< TLV: <<<<<< type = "Data Service Capability" (0x11) <<<<<< length = 1 <<<<<< value = 00 <<<<<< translated = {} <<<<<< TLV: <<<<<< type = "Serving System" (0x01) <<<<<< length = 6 <<<<<< value = 00: 01: 01: 00: 01: 00 <<<<<< translated = [registration_state = 'not-registered' cs_attach_state = 'attached' ps_attach_state = 'attached' selected_network = 'unknown' radio_interfaces = '{[0] = 'none'} '] Feb 09 17:39:21 VdLrp2 ModemManager [6303]: [modem1] processing 3GPP info ... Feb 09 17:39:21 VdLrp2 ModemManager [6303]: [modem1] 3GPP registration state changed (home -> idle) Feb 09 17:39:21 VdLrp2 ModemManager [6303]: [modem1] consolidated registration state: cs 'idle', ps 'idle', eps 'unknown', 5gs 'unknown' -> 'idle' Feb 09 17:39:21 VdLrp2 ModemManager [6303]: [modem1] 3GPP location updated (MCC: '0', MNC: '0', location area code: '0', tracking area code: 'BBC0' , cell ID: '14CFE15') Feb 09 17:39:21 VdLrp2 ModemManager [6303]: [modem1 / bearer0] connected bearer not registered in 3GPP network Feb 09 17:39:21 VdLrp2 otad.py [6358]: (RmdModemPropertiesChangedHandler / 3452): Properties-Message / BearerLost (MPath: / org / freedesktop / ModemManager1 / Modem / 1 Object: org.freedesktop.ModemManager1.Modem.Modem3g :) { "RegistrationState": 0, "OperatorName": "", "OperatorCode": "" }
Since I am not the ModemManager "specialist", I unfortunately cannot deliver a patch. Because I believe that my stupid change is definitely not the right solution.
Thanks in advance
Poldi ---ascii