aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/udevng.c
diff options
context:
space:
mode:
authorJonas Bonn <jonas@southpole.se>2017-09-12 10:11:19 +0200
committerDenis Kenzior <denkenz@gmail.com>2017-09-12 12:28:36 -0500
commit29c5cd238b8b301320f2b2f957fbc70d868e0084 (patch)
tree768c40e8d6511c639ca5572487fb56b64e7998bd /plugins/udevng.c
parenta18c892c6455dddf2c3fdd0001c8a50dcd6629bb (diff)
downloadandroid_external_ofono-29c5cd238b8b301320f2b2f957fbc70d868e0084.tar.gz
android_external_ofono-29c5cd238b8b301320f2b2f957fbc70d868e0084.tar.bz2
android_external_ofono-29c5cd238b8b301320f2b2f957fbc70d868e0084.zip
udev: fixes for detection of non-USB modems
This patch fixes up some fallout from the merging of the udev and udevng modules. i) The 'serial' modems in question are not necessarily serial modems at all; for example, the N900 ISI modems appear as network devices and don't have a devnode. This patch relaxes the requirement that a devnode exist. ii) The modem driver was being set to 'legacy', which is a remnant of an earlier approach to merging these modules. The driver needs to be properly set to the value of the OFONO_DRIVER property in order for the setup function to be found. iii) The serial modem's private data was being added to the modem structure incorrectly... In particular point iii) above shows that there is essentially nobody using these devices which makes modifications in this area tricky.
Diffstat (limited to 'plugins/udevng.c')
-rw-r--r--plugins/udevng.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 518eda8e..9d00bb85 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -1325,7 +1325,7 @@ static void add_serial_device(struct udev_device *dev)
devnode = udev_device_get_devnode(dev);
- if (!syspath || !devname || !devpath || !devnode)
+ if (!syspath || !devpath)
return;
modem = g_hash_table_lookup(modem_list, syspath);
@@ -1337,7 +1337,7 @@ static void add_serial_device(struct udev_device *dev)
modem->type = MODEM_TYPE_SERIAL;
modem->syspath = g_strdup(syspath);
modem->devname = g_strdup(devname);
- modem->driver = g_strdup("legacy");
+ modem->driver = g_strdup(driver);
g_hash_table_replace(modem_list, modem->syspath, modem);
}
@@ -1357,7 +1357,7 @@ static void add_serial_device(struct udev_device *dev)
info->subsystem = g_strdup(subsystem);
info->dev = udev_device_ref(dev);
- modem->devices = g_slist_append(modem->devices, info);
+ modem->serial = info;
}
static void add_device(const char *syspath, const char *devname,