Some gemalto modems, including ELS81x, may provide more than one
USB ethernet interface. Detect and save both network interfaces
rather than only the last one.

Signed-off-by: Sergey Matyukevich <[email protected]>
---
 plugins/udevng.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index 7e6a3ab7..839fabdb 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -1162,7 +1162,7 @@ static gboolean setup_ublox(struct modem_info *modem)
 static gboolean setup_gemalto(struct modem_info* modem)
 {
        const char *app = NULL, *gps = NULL, *mdm = NULL,
-               *net = NULL, *qmi = NULL;
+               *net = NULL, *qmi = NULL, *net2 = NULL;
 
        GSList *list;
 
@@ -1197,9 +1197,14 @@ static gboolean setup_gemalto(struct modem_info* modem)
                        else if (g_strcmp0(info->number, "04") == 0)
                                gps = info->devnode;
                }
+
                if (g_strcmp0(info->interface, "2/6/0") == 0) {
-                       if (g_strcmp0(info->subsystem, "net") == 0)
-                               net = info->devnode;
+                       if (g_strcmp0(info->subsystem, "net") == 0) {
+                               if (g_strcmp0(info->number, "0a") == 0)
+                                       net = info->devnode;
+                               if (g_strcmp0(info->number, "0c") == 0)
+                                       net2 = info->devnode;
+                       }
                }
        }
 
@@ -1216,6 +1221,9 @@ static gboolean setup_gemalto(struct modem_info* modem)
        ofono_modem_set_string(modem->modem, "Model", modem->model);
        ofono_modem_set_string(modem->modem, "NetworkInterface", net);
 
+       if (net2)
+               ofono_modem_set_string(modem->modem, "NetworkInterface2", net2);
+
        return TRUE;
 }
 
-- 
2.28.0
_______________________________________________
ofono mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to