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).
This commit is contained in:
Arnaud Ferraris
2021-12-15 15:27:47 +01:00
committed by Arnaud Ferraris
parent 8665f8a4a6
commit fedce7298b

View File

@@ -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++) {