Skip to contentSkip to conversation

gemalto: USB ethernet data path for ELS81x

PATCH In review Sergey Matyukevich 2 participants 5 messages Aug 18, 2020 – Aug 19, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

v2 cover gemalto: USB ethernet data path for ELS81x

Hi Denis and all,

This patch series enables USB ethernet data path for gemalto modems that support this feature, in particular for ELS81x devices.

Regards,
Sergey

v1 -> v2

- replace g_try_new0 by use g_new0
- drop patch with incorrect fix for modem init

Sergey Matyukevich (3):
drivers: gemalto: add gprs-context driver
plugins: udevng: detect gemalto network interfaces
plugins: gemalto: alternative gprs-context driver

 Makefile.am                         |   3 +-
 drivers/gemaltomodem/gemaltomodem.c |   4 +-
 drivers/gemaltomodem/gemaltomodem.h |   3 +
 drivers/gemaltomodem/gprs-context.c | 278 ++++++++++++++++++++++++++++
 plugins/gemalto.c                   |  12 +-
 plugins/udevng.c                    |  14 +-
 6 files changed, 308 insertions(+), 6 deletions(-)
 create mode 100644 drivers/gemaltomodem/gprs-context.c
Signature · 1 line
2.28.0
#1 lore raw

PATCH v2 1/3 drivers: gemalto: add gprs-context driver

Some gemalto modems provide USB ethernet interfaces for data path. Implement gprs-context driver for such modems to send data via USB ethernet rather than fallback to PPP.

---
 Makefile.am                         |   3 +-
 drivers/gemaltomodem/gemaltomodem.c |   4 +-
 drivers/gemaltomodem/gemaltomodem.h |   3 +
 drivers/gemaltomodem/gprs-context.c | 278 ++++++++++++++++++++++++++++
 4 files changed, 286 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gemaltomodem/gprs-context.c
Makefile.am +2 -1
index fbb0eff4..67c3bcbf 100644
@@ -482,7 +482,8 @@ builtin_sources += drivers/atmodem/atutil.h \
 			drivers/gemaltomodem/gemaltomodem.h \
 			drivers/gemaltomodem/gemaltomodem.c \
 			drivers/gemaltomodem/location-reporting.c \
-			drivers/gemaltomodem/voicecall.c
+			drivers/gemaltomodem/voicecall.c \
+			drivers/gemaltomodem/gprs-context.c
 
 builtin_modules += xmm7modem
 builtin_sources += drivers/atmodem/atutil.h \
drivers/gemaltomodem/gemaltomodem.c +3 -1
index 4818ac66..4b20dd1b 100644
@@ -36,6 +36,7 @@
 static int gemaltomodem_init(void)
 {
 	gemalto_location_reporting_init();
+	gemalto_gprs_context_init();
 	gemalto_voicecall_init();
 
 	return 0;
@@ -43,8 +44,9 @@ static int gemaltomodem_init(void)
 
 static void gemaltomodem_exit(void)
 {
-	gemalto_voicecall_exit();
 	gemalto_location_reporting_exit();
+	gemalto_gprs_context_exit();
+	gemalto_voicecall_exit();
 }
 
 OFONO_PLUGIN_DEFINE(gemaltomodem, "Gemalto modem driver", VERSION,
drivers/gemaltomodem/gemaltomodem.h +3 -0
index 27b1460e..dc0d346b 100644
@@ -27,3 +27,6 @@ extern void gemalto_location_reporting_exit();
 
 extern void gemalto_voicecall_init();
 extern void gemalto_voicecall_exit();
+
+extern void gemalto_gprs_context_init();
+extern void gemalto_gprs_context_exit();
drivers/gemaltomodem/gprs-context.c new file +278 -0

278 lines not on this page · raw message

Signature · 1 line
2.28.0
#2 lore raw

PATCH v2 2/3 plugins: udevng: detect gemalto network interfaces

In reply to Sergey Matyukevich

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.

---
 plugins/udevng.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
plugins/udevng.c +11 -3
index 7e6a3ab7..839fabdb 100644
@@ -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;
 }
 
Signature · 1 line
2.28.0
#3 lore raw

PATCH v2 3/3 plugins: gemalto: alternative gprs-context driver

In reply to Sergey Matyukevich

Use alternative gprs context driver for gemalto modems that provide USB ethernet interfaces for data path.

---
 plugins/gemalto.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
plugins/gemalto.c +11 -1
index 13950742..238c7cc4 100644
@@ -588,6 +588,8 @@ static void gemalto_post_sim(struct ofono_modem *modem)
 	struct ofono_gprs *gprs;
 	struct ofono_gprs_context *gc;
 	const char *model = ofono_modem_get_string(modem, "Model");
+	const char *driver = NULL;
+	const char *iface = NULL;
 
 	DBG("%p", modem);
 
@@ -596,7 +598,15 @@ static void gemalto_post_sim(struct ofono_modem *modem)
 	ofono_sms_create(modem, OFONO_VENDOR_GEMALTO, "atmodem", data->app);
 
 	gprs = ofono_gprs_create(modem, 0, "atmodem", data->app);
-	gc = ofono_gprs_context_create(modem, 0, "atmodem", data->mdm);
+
+	iface = ofono_modem_get_string(modem, "NetworkInterface");
+	if (iface) {
+		driver = "gemaltomodem";
+	} else {
+		driver = "atmodem";
+	}
+
+	gc = ofono_gprs_context_create(modem, 0, driver, data->mdm);
 
 	if (gprs && gc)
 		ofono_gprs_add_context(gprs, gc);
Signature · 1 line
2.28.0
#4 lore raw
In reply to Sergey Matyukevich

Hi Sergey,

Quoted 4 lines · Sergey Matyukevich

Hi Denis and all,

This patch series enables USB ethernet data path for gemalto modems that support this feature, in particular for ELS81x devices.

All three applied (minus the S-o-B tags). Thanks!

Regards,
-Denis