From 210fa8bf354f5455a4e75dadbf69e72940b19d70 Mon Sep 17 00:00:00 2001 From: Sven Schwermer Date: Wed, 30 Mar 2022 08:37:53 +0200 Subject: [PATCH] qmi: Fall back to NAS SSP/NAS TP capabilities If no DMS capabilities are reported, we fall back to the capabilities reported by NAS SSP or NAS TP. Signed-off-by: Sven Schwermer --- src/mm-modem-helpers-qmi.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c index b0177933..ce3967f3 100644 --- a/src/mm-modem-helpers-qmi.c +++ b/src/mm-modem-helpers-qmi.c @@ -1842,9 +1842,17 @@ mm_current_capability_from_qmi_current_capabilities_context (MMQmiCurrentCapabil g_autofree gchar *tmp_str = NULL; /* If not a multimode device, we're done */ - if (!ctx->multimode) - tmp = ctx->dms_capabilities; - else { + if (!ctx->multimode) { + if (ctx->dms_capabilities != MM_MODEM_CAPABILITY_NONE) + tmp = ctx->dms_capabilities; + /* SSP logic to gather capabilities uses the Mode Preference TLV if available */ + else if (ctx->nas_ssp_mode_preference_mask) + tmp = mm_modem_capability_from_qmi_rat_mode_preference (ctx->nas_ssp_mode_preference_mask); + /* If no value retrieved from SSP, check TP. We only process TP + * values if not 'auto' (0). */ + else if (ctx->nas_tp_mask != QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_AUTO) + tmp = mm_modem_capability_from_qmi_radio_technology_preference (ctx->nas_tp_mask); + } else { /* We have a multimode CDMA/EVDO+GSM/UMTS device, check SSP and TP */ /* SSP logic to gather capabilities uses the Mode Preference TLV if available */