src: add udev watcher to improve modem recovery

Most of the modem issues follow a (incomplete) USB device reset. Instead 
of relying solely on the existing timer, this patch adds a udev monitor 
which resets the modem as soon as its associated USB device is reset, 
which greatly improves recovery time.
This commit is contained in:
Arnaud Ferraris
2020-12-18 01:37:06 +01:00
parent 74b91c7d58
commit 62a07f9c51
7 changed files with 64 additions and 0 deletions

View File

@@ -158,6 +158,10 @@ void suspend_init(struct EG25Manager *manager)
void suspend_destroy(struct EG25Manager *manager)
{
drop_inhibitor(manager);
if (manager->suspend_source) {
g_source_remove(manager->suspend_source);
manager->suspend_source = 0;
}
if (manager->suspend_proxy) {
g_object_unref(manager->suspend_proxy);
manager->suspend_proxy = NULL;