2021-06-06 17:11:05 +00:00
|
|
|
From 7045385547867b629c80cbcadf68c1586b98c51c Mon Sep 17 00:00:00 2001
|
2019-05-01 08:59:41 +00:00
|
|
|
From: Joey Hewitt <joey@joeyhewitt.com>
|
|
|
|
Date: Fri, 19 Jul 2019 22:02:07 +0200
|
|
|
|
Subject: [PATCH] support smdpkt
|
|
|
|
|
|
|
|
---
|
2021-06-06 17:11:05 +00:00
|
|
|
plugins/udevng.c | 66 +++++++++++++++++++++++++++---------------------
|
|
|
|
1 file changed, 37 insertions(+), 29 deletions(-)
|
2019-05-01 08:59:41 +00:00
|
|
|
|
|
|
|
diff --git a/plugins/udevng.c b/plugins/udevng.c
|
2021-06-06 17:11:05 +00:00
|
|
|
index 34ac1cc0..0d594998 100644
|
2019-05-01 08:59:41 +00:00
|
|
|
--- a/plugins/udevng.c
|
|
|
|
+++ b/plugins/udevng.c
|
2020-06-14 15:23:12 +00:00
|
|
|
@@ -203,41 +203,46 @@ static gboolean setup_gobi(struct modem_info *modem)
|
2018-03-11 15:59:09 +00:00
|
|
|
|
|
|
|
DBG("%s", modem->syspath);
|
|
|
|
|
|
|
|
- for (list = modem->devices; list; list = list->next) {
|
|
|
|
- struct device_info *info = list->data;
|
|
|
|
+ if (modem->type != MODEM_TYPE_SERIAL) {
|
|
|
|
+ for (list = modem->devices; list; list = list->next) {
|
|
|
|
+ struct device_info *info = list->data;
|
|
|
|
|
|
|
|
- DBG("%s %s %s %s %s %s", info->devnode, info->interface,
|
|
|
|
- info->number, info->label,
|
|
|
|
- info->sysattr, info->subsystem);
|
|
|
|
+ DBG("%s %s %s %s %s %s", info->devnode, info->interface,
|
|
|
|
+ info->number, info->label,
|
|
|
|
+ info->sysattr, info->subsystem);
|
|
|
|
|
|
|
|
- if (g_strcmp0(info->subsystem, "usbmisc") == 0) /* cdc-wdm */
|
|
|
|
- qmi = info->devnode;
|
|
|
|
- else if (g_strcmp0(info->subsystem, "net") == 0) /* wwan */
|
|
|
|
- net = info->devnode;
|
|
|
|
- else if (g_strcmp0(info->subsystem, "tty") == 0) {
|
|
|
|
- if (g_strcmp0(info->interface, "255/255/255") == 0) {
|
|
|
|
- if (g_strcmp0(info->number, "00") == 0)
|
|
|
|
- diag = info->devnode; /* ec20 */
|
|
|
|
- else if (g_strcmp0(info->number, "01") == 0)
|
|
|
|
- diag = info->devnode; /* gobi */
|
|
|
|
- else if (g_strcmp0(info->number, "02") == 0)
|
|
|
|
- mdm = info->devnode; /* gobi */
|
|
|
|
- else if (g_strcmp0(info->number, "03") == 0)
|
|
|
|
- gps = info->devnode; /* gobi */
|
|
|
|
- } else if (g_strcmp0(info->interface, "255/0/0") == 0) {
|
|
|
|
- if (g_strcmp0(info->number, "01") == 0)
|
|
|
|
- gps = info->devnode; /* ec20 */
|
|
|
|
- if (g_strcmp0(info->number, "02") == 0)
|
|
|
|
- mdm = info->devnode; /* ec20 */
|
|
|
|
- /* ignore the 3rd device second AT/mdm iface */
|
|
|
|
+ if (g_strcmp0(info->subsystem, "usbmisc") == 0) /* cdc-wdm */
|
|
|
|
+ qmi = info->devnode;
|
|
|
|
+ else if (g_strcmp0(info->subsystem, "net") == 0) /* wwan */
|
|
|
|
+ net = info->devnode;
|
|
|
|
+ else if (g_strcmp0(info->subsystem, "tty") == 0) {
|
|
|
|
+ if (g_strcmp0(info->interface, "255/255/255") == 0) {
|
|
|
|
+ if (g_strcmp0(info->number, "00") == 0)
|
|
|
|
+ diag = info->devnode; /* ec20 */
|
|
|
|
+ else if (g_strcmp0(info->number, "01") == 0)
|
|
|
|
+ diag = info->devnode; /* gobi */
|
|
|
|
+ else if (g_strcmp0(info->number, "02") == 0)
|
|
|
|
+ mdm = info->devnode; /* gobi */
|
|
|
|
+ else if (g_strcmp0(info->number, "03") == 0)
|
|
|
|
+ gps = info->devnode; /* gobi */
|
|
|
|
+ } else if (g_strcmp0(info->interface, "255/0/0") == 0) {
|
|
|
|
+ if (g_strcmp0(info->number, "01") == 0)
|
|
|
|
+ gps = info->devnode; /* ec20 */
|
|
|
|
+ if (g_strcmp0(info->number, "02") == 0)
|
|
|
|
+ mdm = info->devnode; /* ec20 */
|
|
|
|
+ /* ignore the 3rd device second AT/mdm iface */
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- }
|
|
|
|
|
2019-05-01 08:59:41 +00:00
|
|
|
- DBG("qmi=%s net=%s mdm=%s gps=%s diag=%s", qmi, net, mdm, gps, diag);
|
|
|
|
+ DBG("qmi=%s net=%s mdm=%s gps=%s diag=%s", qmi, net, mdm, gps, diag);
|
|
|
|
|
2018-03-11 15:59:09 +00:00
|
|
|
- if (qmi == NULL || mdm == NULL || net == NULL)
|
|
|
|
- return FALSE;
|
|
|
|
+ if (qmi == NULL || mdm == NULL || net == NULL)
|
|
|
|
+ return FALSE;
|
|
|
|
+ } else {
|
|
|
|
+ qmi = modem->serial->devnode;
|
2020-06-14 15:23:12 +00:00
|
|
|
+ net = udev_device_get_property_value(modem->serial->dev, "OFONO_NETWORK_INTERFACE");
|
2018-03-11 15:59:09 +00:00
|
|
|
+ }
|
|
|
|
|
|
|
|
|
2019-05-01 08:59:41 +00:00
|
|
|
ofono_modem_set_string(modem->modem, "Device", qmi);
|
2021-06-06 17:11:05 +00:00
|
|
|
@@ -2074,6 +2079,9 @@ static void enumerate_devices(struct udev *context)
|
2018-03-11 15:59:09 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
udev_enumerate_add_match_subsystem(enumerate, "tty");
|
2021-06-06 17:11:05 +00:00
|
|
|
+ udev_enumerate_add_match_subsystem(enumerate, "wwan");
|
2018-03-11 15:59:09 +00:00
|
|
|
+ udev_enumerate_add_match_subsystem(enumerate, "smdpkt");
|
2018-05-10 21:28:51 +00:00
|
|
|
+ udev_enumerate_add_match_subsystem(enumerate, "rpmsg");
|
2018-03-11 15:59:09 +00:00
|
|
|
udev_enumerate_add_match_subsystem(enumerate, "usb");
|
|
|
|
udev_enumerate_add_match_subsystem(enumerate, "usbmisc");
|
|
|
|
udev_enumerate_add_match_subsystem(enumerate, "net");
|
2019-05-01 08:59:41 +00:00
|
|
|
--
|
2021-06-06 17:11:05 +00:00
|
|
|
2.31.1
|
2019-05-01 08:59:41 +00:00
|
|
|
|