diff --git a/include/ModemManager-tags.h b/include/ModemManager-tags.h index 2d14ce44..59c31f12 100644 --- a/include/ModemManager-tags.h +++ b/include/ModemManager-tags.h @@ -337,6 +337,19 @@ */ #define ID_MM_INITIAL_QMAP_MUX_ID "ID_MM_INITIAL_QMAP_MUX_ID" +/** + * ID_MM_AT_NETWORK_TIME_BROKEN: + * + * This is a device-specific tag that allows users to prevent ModemManager from + * attempting to read network time using AT commands, even if the device + * supports them. + * + * An integer value of 1 prevents reading network time with AT commands. + * + * Since: 1.26 + */ +#define ID_MM_AT_NETWORK_TIME_BROKEN "ID_MM_AT_NETWORK_TIME_BROKEN" + /* * The following symbols are deprecated. We don't add them to -compat * because this -tags file is not really part of the installed API. diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index b36f4896..9364a20b 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -28,6 +28,7 @@ #include #define _LIBMM_INSIDE_MM #include +#include #include "mm-base-modem-at.h" #include "mm-broadband-modem.h" @@ -10968,6 +10969,27 @@ modem_time_check_support (MMIfaceModemTime *self, GAsyncReadyCallback callback, gpointer user_data) { + MMIfacePortAt *port; + GError *error = NULL; + + port = mm_base_modem_peek_best_at_port (MM_BASE_MODEM (self), &error); + if (!port) { + g_task_report_error (self, callback, user_data, modem_time_check_support, error); + return; + } + + if (mm_kernel_device_get_global_property_as_boolean (mm_port_peek_kernel_device (MM_PORT (port)), + ID_MM_AT_NETWORK_TIME_BROKEN)) { + g_task_report_new_error (self, + callback, + user_data, + modem_time_check_support, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED, + "AT network time tagged as broken"); + return; + } + mm_base_modem_at_sequence (MM_BASE_MODEM (self), time_check_sequence, NULL, /* response_processor_context */ diff --git a/src/plugins/meson.build b/src/plugins/meson.build index 97f0b6a9..47f12bd5 100644 --- a/src/plugins/meson.build +++ b/src/plugins/meson.build @@ -857,6 +857,8 @@ if plugins_options['pantech'] 'plugin': true, 'module': {'sources': sources, 'include_directories': plugins_incs, 'c_args': '-DMM_MODULE_NAME="pantech"'}, }} + + plugins_udev_rules += files('pantech/77-mm-pantech.rules') endif # plugin: qcom-soc diff --git a/src/plugins/pantech/77-mm-pantech.rules b/src/plugins/pantech/77-mm-pantech.rules new file mode 100644 index 00000000..1f5530a6 --- /dev/null +++ b/src/plugins/pantech/77-mm-pantech.rules @@ -0,0 +1,14 @@ + +# do not edit this file, it will be overwritten on update +ACTION!="add|change|move|bind", GOTO="mm_pantech_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="106c", GOTO="mm_pantech_generic" +GOTO="mm_pantech_end" + +LABEL="mm_pantech_generic" + +# UML290 software L0290VWBB12F.248 crashes when AT network time is requested +ATTRS{idVendor}=="106c", ATTRS{idProduct}=="3718", ENV{ID_MM_AT_NETWORK_TIME_BROKEN}="1" + +GOTO="mm_pantech_end" + +LABEL="mm_pantech_end"