diff options
author | Dan Williams <dan@ioncontrol.co> | 2025-03-28 15:46:00 -0500 |
---|---|---|
committer | Dan Williams <dan@ioncontrol.co> | 2025-04-09 13:19:50 +0000 |
commit | f5ae14d0b2daae818b195366eaa9b16ecc964dfa (patch) | |
tree | 5e47ac5cd9399aabc3f3701aeb8d6696d98305e7 /src/mm-modem-helpers-qmi.c | |
parent | 467a53f189ddcec87ddba0aa0c72c7d3ca34e2e4 (diff) |
modem-helpers-qmi: better handle no supported modes
Dell Snapdragon X62 before FCC Unlock reports no radio interfaces
from QMI and no device capabilities from MBIM. Instead of asserting
in mm_filter_supported_modes() when called from
mm_supported_modes_from_qmi_supported_modes_context() gracefully
handle the lack of supported modes.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
Diffstat (limited to 'src/mm-modem-helpers-qmi.c')
-rw-r--r-- | src/mm-modem-helpers-qmi.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c index bc0be400..7a87454b 100644 --- a/src/mm-modem-helpers-qmi.c +++ b/src/mm-modem-helpers-qmi.c @@ -2541,13 +2541,22 @@ mm_supported_capabilities_from_qmi_supported_capabilities_context (MMQmiSupporte /* Utility to build list of supported modes */ GArray * -mm_supported_modes_from_qmi_supported_modes_context (MMQmiSupportedModesContext *ctx, - gpointer log_object) +mm_supported_modes_from_qmi_supported_modes_context (MMQmiSupportedModesContext *ctx, + gpointer log_object, + GError **error) { g_autoptr(GArray) combinations = NULL; g_autoptr(GArray) all = NULL; MMModemModeCombination mode; + if (ctx->all == MM_MODEM_MODE_NONE) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "No supported modes reported"); + return NULL; + } + /* Start with a mode including ALL */ mode.allowed = ctx->all; mode.preferred = MM_MODEM_MODE_NONE; |