From fedce7298bd6441526e07aec021687b173142022 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Wed, 15 Dec 2021 15:27:47 +0100 Subject: [PATCH] manager: start udev monitoring module conditionally The problem addressed by monitoring the modem status through udev seems tied to the specific USB controller used by the A64. On RK3399 devices, this quirk is apparently unneeded, and actually harmful as it resets the modem USB connection while ModemManager is already configuring it. This commit adds an optional config parameter for disabling this module (enabled by default). --- src/manager.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/manager.c b/src/manager.c index cba4e72..4b0ef59 100644 --- a/src/manager.c +++ b/src/manager.c @@ -314,6 +314,7 @@ int main(int argc, char *argv[]) struct EG25Manager manager; gchar *config_file = NULL; gboolean show_version = FALSE; + gboolean monitor_udev = TRUE; toml_table_t *toml_config[EG25_CONFIG_COUNT]; toml_table_t *manager_config[EG25_CONFIG_COUNT]; const GOptionEntry options[] = { @@ -363,6 +364,7 @@ int main(int argc, char *argv[]) if (!manager_config[EG25_CONFIG_SYS]) g_error("Default config file lacks the 'manager' section!"); + config_get_bool(manager_config, "monitor_udev", &monitor_udev); config_get_bool(manager_config, "need_libusb", &manager.use_libusb); config_get_uint(manager_config, "usb_vid", &manager.usb_vid); config_get_uint(manager_config, "usb_pid", &manager.usb_pid); @@ -375,7 +377,8 @@ int main(int argc, char *argv[]) #endif ofono_iface_init(&manager, toml_config); suspend_init(&manager, toml_config); - udev_init(&manager, toml_config); + if (monitor_udev) + udev_init(&manager, toml_config); gnss_init(&manager, toml_config); for (int i = 0; i < EG25_CONFIG_COUNT; i++) {