Merge request !1348 from '1-24-cherry-picks-05-08-25'
[1.24] stable cherry-picks 2025-05-08 https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1348
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
This object also controls any process-wide operation, such as the log
|
||||
level being used by the daemon.
|
||||
</para>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.xml"/>
|
||||
</chapter>
|
||||
|
||||
<chapter id="ref-dbus-object-modem">
|
||||
@@ -129,22 +129,22 @@
|
||||
or the
|
||||
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.ModemCdma">CDMA interface</link>.
|
||||
</para>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Voice.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.CellBroadcast.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Sar.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml"/>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml"/>
|
||||
<!--xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Contacts.xml"/-->
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Voice.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.CellBroadcast.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Sar.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml"/>
|
||||
<!--xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Contacts.xml"/-->
|
||||
</chapter>
|
||||
|
||||
<chapter id="ref-dbus-object-bearer">
|
||||
@@ -155,7 +155,7 @@
|
||||
may expose one or more Bearer objects, which can then be used to get the
|
||||
modem into connected state.
|
||||
</para>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml"/>
|
||||
</chapter>
|
||||
|
||||
<chapter id="ref-dbus-object-sim">
|
||||
@@ -166,7 +166,7 @@
|
||||
expose up to one SIM object, which allows SIM-specific actions such as PIN
|
||||
unlocking.
|
||||
</para>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Sim.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Sim.xml"/>
|
||||
</chapter>
|
||||
|
||||
<chapter id="ref-dbus-object-sms">
|
||||
@@ -176,7 +176,7 @@
|
||||
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.Messaging">Messaging interface</link>
|
||||
will export one SMS object for each SMS stored in the device.
|
||||
</para>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml"/>
|
||||
</chapter>
|
||||
|
||||
<chapter id="ref-dbus-object-call">
|
||||
@@ -186,17 +186,17 @@
|
||||
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.Voice">Voice interface</link>
|
||||
will export one Call object for each Call managed in the device.
|
||||
</para>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Call.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Call.xml"/>
|
||||
</chapter>
|
||||
|
||||
<chapter id="ref-dbus-object-call">
|
||||
<chapter id="ref-dbus-object-cbm">
|
||||
<title>The <literal>/org/freedesktop/ModemManager/CBM</literal> objects</title>
|
||||
<para>
|
||||
Modems implementing the
|
||||
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.CellBroadcast">Cell Broadcast interface</link>
|
||||
will export one CBM object for each Cell Broadcast message received by the device.
|
||||
</para>
|
||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Call.xml"/>
|
||||
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Cbm.xml"/>
|
||||
</chapter>
|
||||
|
||||
</part>
|
||||
|
||||
@@ -22,6 +22,9 @@ expand_content_files = [
|
||||
'ModemManager-overview.xml',
|
||||
# FIXME: workaround because only strings can be included and not custom targets (gen_docs)
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Call.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Cbm.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.CellBroadcast.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml',
|
||||
@@ -30,9 +33,11 @@ expand_content_files = [
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Sar.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Voice.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Sim.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml',
|
||||
|
||||
@@ -768,11 +768,14 @@ parse_caps_cgmm (MMBaseModem *self,
|
||||
if (!response)
|
||||
return MM_BASE_MODEM_AT_RESPONSE_PROCESSOR_RESULT_CONTINUE;
|
||||
|
||||
/* This check detects some really old Motorola GPRS dongles and phones */
|
||||
/* This check detects some really old Motorola and Mediatek GPRS dongles
|
||||
* and phones.
|
||||
*/
|
||||
if (strstr (response, "GSM900") ||
|
||||
strstr (response, "GSM1800") ||
|
||||
strstr (response, "GSM1900") ||
|
||||
strstr (response, "GSM850")) {
|
||||
strstr (response, "GSM850") ||
|
||||
strstr (response, "MTK2")) {
|
||||
/* At least, it's a GSM modem */
|
||||
*result = g_variant_new_uint32 (MM_MODEM_CAPABILITY_GSM_UMTS);
|
||||
return MM_BASE_MODEM_AT_RESPONSE_PROCESSOR_RESULT_SUCCESS;
|
||||
@@ -5591,6 +5594,21 @@ modem_3gpp_run_registration_checks_finish (MMIfaceModem3gpp *self,
|
||||
return g_task_propagate_boolean (G_TASK (res), error);
|
||||
}
|
||||
|
||||
static void
|
||||
run_registration_checks_reload_current_registration_info_ready (MMIfaceModem3gpp *modem,
|
||||
GAsyncResult *res,
|
||||
GTask *task)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
mm_iface_modem_3gpp_reload_current_registration_info_finish (modem, res, &error);
|
||||
if (error)
|
||||
g_task_return_error (task, error);
|
||||
else
|
||||
g_task_return_boolean (task, TRUE);
|
||||
g_object_unref (task);
|
||||
}
|
||||
|
||||
static void run_registration_checks_context_step (GTask *task);
|
||||
|
||||
static void
|
||||
@@ -5832,13 +5850,17 @@ run_registration_checks_context_step (GTask *task)
|
||||
error = g_steal_pointer (&ctx->error_cs);
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
|
||||
g_task_return_error (task, error);
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
if (error)
|
||||
g_task_return_error (task, error);
|
||||
else
|
||||
g_task_return_boolean (task, TRUE);
|
||||
g_object_unref (task);
|
||||
/* When everything is done, recheck operator info as it may have changed */
|
||||
mm_iface_modem_3gpp_reload_current_registration_info (
|
||||
MM_IFACE_MODEM_3GPP (self),
|
||||
(GAsyncReadyCallback)run_registration_checks_reload_current_registration_info_ready,
|
||||
task);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -32,6 +32,10 @@ static GQuark in_call_event_context_quark;
|
||||
|
||||
G_DEFINE_INTERFACE (MMIfaceModemVoice, mm_iface_modem_voice, MM_TYPE_IFACE_MODEM)
|
||||
|
||||
static void setup_call_list_polling (MMCallList *call_list,
|
||||
const gchar *call_path_added,
|
||||
MMIfaceModemVoice *self);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
@@ -1781,6 +1785,7 @@ typedef enum {
|
||||
IN_CALL_SETUP_STEP_FIRST,
|
||||
IN_CALL_SETUP_STEP_UNSOLICITED_EVENTS,
|
||||
IN_CALL_SETUP_STEP_AUDIO_CHANNEL,
|
||||
IN_CALL_SETUP_STEP_CHECK_POLLING,
|
||||
IN_CALL_SETUP_STEP_LAST,
|
||||
} InCallSetupStep;
|
||||
|
||||
@@ -1908,6 +1913,10 @@ in_call_setup_context_step (GTask *task)
|
||||
}
|
||||
ctx->step++;
|
||||
/* fall-through */
|
||||
case IN_CALL_SETUP_STEP_CHECK_POLLING:
|
||||
setup_call_list_polling (NULL, NULL, self);
|
||||
ctx->step++;
|
||||
/* fall-through */
|
||||
case IN_CALL_SETUP_STEP_LAST:
|
||||
g_task_return_boolean (task, TRUE);
|
||||
g_object_unref (task);
|
||||
|
||||
@@ -1218,8 +1218,9 @@ get_mm_access_tech_from_etsi_access_tech (guint val,
|
||||
return MM_MODEM_ACCESS_TECHNOLOGY_HSUPA;
|
||||
case 6:
|
||||
return MM_MODEM_ACCESS_TECHNOLOGY_HSPA;
|
||||
case 7: /* E-UTRAN */
|
||||
case 9: /* E-UTRAN (NB-S1) */
|
||||
return MM_MODEM_ACCESS_TECHNOLOGY_LTE_NB_IOT;
|
||||
case 7: /* E-UTRAN */
|
||||
case 10: /* E-UTRA connected to a 5GCN */
|
||||
return MM_MODEM_ACCESS_TECHNOLOGY_LTE;
|
||||
case 11: /* NR connected to a 5G CN */
|
||||
@@ -4160,11 +4161,11 @@ mm_string_to_access_tech (const gchar *string)
|
||||
* are included in other strings too.
|
||||
*/
|
||||
len = strlen (string);
|
||||
if (strncmp (string, "EVDO", 4) && (len >= 4 && !isalnum (string[4])))
|
||||
if (!strncmp (string, "EVDO", 4) && (len >= 4 && !isalnum (string[4])))
|
||||
act |= MM_MODEM_ACCESS_TECHNOLOGY_EVDO0;
|
||||
if (strncmp (string, "CDMA", 4) && (len >= 4 && !isalnum (string[4])))
|
||||
if (!strncmp (string, "CDMA", 4) && (len >= 4 && !isalnum (string[4])))
|
||||
act |= MM_MODEM_ACCESS_TECHNOLOGY_1XRTT;
|
||||
if (strncmp (string, "CDMA-EVDO", 9) && (len >= 9 && !isalnum (string[9])))
|
||||
if (!strncmp (string, "CDMA-EVDO", 9) && (len >= 9 && !isalnum (string[9])))
|
||||
act |= MM_MODEM_ACCESS_TECHNOLOGY_1XRTT | MM_MODEM_ACCESS_TECHNOLOGY_EVDO0;
|
||||
|
||||
return act;
|
||||
|
||||
@@ -794,7 +794,7 @@ mm_cinterion_parse_sxrat_test (const gchar *response,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
r = g_regex_new ("\\^SXRAT:\\s*\\(([^\\)]*)\\),\\(([^\\)]*)\\)(,\\(([^\\)]*)\\))?(?:\\r\\n)?",
|
||||
r = g_regex_new ("\\^SXRAT:\\s*\\(([^\\)]*)\\),\\s*\\(([^\\)]*)\\)(,\\s*\\(([^\\)]*)\\))?(?:\\r\\n)?",
|
||||
G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW,
|
||||
0, NULL);
|
||||
|
||||
|
||||
@@ -1826,6 +1826,38 @@ test_sxrat_response_els61 (void)
|
||||
g_array_unref (expected_pref2);
|
||||
}
|
||||
|
||||
static void
|
||||
test_sxrat_response_pls63_w (void)
|
||||
{
|
||||
GArray *expected_rat;
|
||||
GArray *expected_pref1;
|
||||
GArray *expected_pref2;
|
||||
const guint vals[] = { 0, 2, 3 };
|
||||
guint val;
|
||||
const gchar *response =
|
||||
"^SXRAT: (0-6), (0,2,3), (0,2,3)\r\n"
|
||||
"\r\n";
|
||||
|
||||
expected_rat = g_array_sized_new (FALSE, FALSE, sizeof (guint), 7);
|
||||
for (val = 0; val < 7; val++)
|
||||
g_array_append_val (expected_rat, val);
|
||||
|
||||
expected_pref1 = g_array_sized_new (FALSE, FALSE, sizeof (guint), 3);
|
||||
g_array_append_vals (expected_pref1, &vals, 3);
|
||||
|
||||
expected_pref2 = g_array_sized_new (FALSE, FALSE, sizeof (guint), 3);
|
||||
g_array_append_vals (expected_pref2, &vals, 3);
|
||||
|
||||
common_test_sxrat (response,
|
||||
expected_rat,
|
||||
expected_pref1,
|
||||
expected_pref2);
|
||||
|
||||
g_array_unref (expected_rat);
|
||||
g_array_unref (expected_pref1);
|
||||
g_array_unref (expected_pref2);
|
||||
}
|
||||
|
||||
static void
|
||||
test_sxrat_response_other (void)
|
||||
{
|
||||
@@ -2177,6 +2209,7 @@ int main (int argc, char **argv)
|
||||
g_test_add_func ("/MM/cinterion/sgauth", test_sgauth_response);
|
||||
g_test_add_func ("/MM/cinterion/sxrat", test_sxrat);
|
||||
g_test_add_func ("/MM/cinterion/sxrat/response/els61", test_sxrat_response_els61);
|
||||
g_test_add_func ("/MM/cinterion/sxrat/response/pls63w", test_sxrat_response_pls63_w);
|
||||
g_test_add_func ("/MM/cinterion/sxrat/response/other", test_sxrat_response_other);
|
||||
g_test_add_func ("/MM/cinterion/cops/only-mode-2g", test_cops_only_mode_2g);
|
||||
g_test_add_func ("/MM/cinterion/cops/only-mode-3g", test_cops_only_mode_3g);
|
||||
|
||||
@@ -75,8 +75,8 @@ get_private (MMSharedFibocom *self)
|
||||
priv->class_parent = MM_SHARED_FIBOCOM_GET_IFACE (self)->peek_parent_class (self);
|
||||
|
||||
/* Setup firmware interface of parent class */
|
||||
g_assert (MM_SHARED_FIBOCOM_GET_IFACE (self)->peek_parent_firmware_interface);
|
||||
priv->iface_modem_firmware_parent = MM_SHARED_FIBOCOM_GET_IFACE (self)->peek_parent_firmware_interface (self);
|
||||
if (MM_SHARED_FIBOCOM_GET_IFACE (self)->peek_parent_firmware_interface)
|
||||
priv->iface_modem_firmware_parent = MM_SHARED_FIBOCOM_GET_IFACE (self)->peek_parent_firmware_interface (self);
|
||||
|
||||
g_object_set_qdata_full (G_OBJECT (self), private_quark, priv, (GDestroyNotify)private_free);
|
||||
}
|
||||
|
||||
@@ -4866,6 +4866,29 @@ test_mnc_length (void)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
const gchar *str;
|
||||
const MMModemAccessTechnology act;
|
||||
} TestActData;
|
||||
|
||||
static const TestActData test_act_data[] = {
|
||||
{ "EDGE", MM_MODEM_ACCESS_TECHNOLOGY_EDGE },
|
||||
/* Ensure WCDMA does not get counted as 3GPP2 CDMA */
|
||||
{ "WCDMA", MM_MODEM_ACCESS_TECHNOLOGY_UMTS },
|
||||
{ "CDMA-EVDO", MM_MODEM_ACCESS_TECHNOLOGY_1XRTT | MM_MODEM_ACCESS_TECHNOLOGY_EVDO0 },
|
||||
};
|
||||
|
||||
static void
|
||||
test_string_to_access_tech (void)
|
||||
{
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (test_act_data); i++)
|
||||
g_assert_cmpint (mm_string_to_access_tech (test_act_data[i].str), ==, test_act_data[i].act);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (GTestFixtureFunc) t, NULL)
|
||||
|
||||
int main (int argc, char **argv)
|
||||
@@ -5111,6 +5134,8 @@ int main (int argc, char **argv)
|
||||
g_test_suite_add (suite, TESTCASE (test_spn_to_utf8, NULL));
|
||||
g_test_suite_add (suite, TESTCASE (test_mnc_length, NULL));
|
||||
|
||||
g_test_suite_add (suite, TESTCASE (test_string_to_access_tech, NULL));
|
||||
|
||||
result = g_test_run ();
|
||||
|
||||
reg_test_data_free (reg_data);
|
||||
|
||||
Reference in New Issue
Block a user