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

@@ -8,6 +8,7 @@
#include <glib.h>
#include <gpiod.h>
#include <gudev/gudev.h>
#include <libmm-glib.h>
enum EG25State {
@@ -44,6 +45,7 @@ struct EG25Manager {
int suspend_inhibit_fd;
guint suspend_source;
GUdevClient *udev;
struct gpiod_chip *gpiochip[2];
struct gpiod_line *gpio_out[5];