diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2014-10-01 12:02:36 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-11-01 20:07:30 +0100 |
commit | b8cd5ae838b1a17ce1bb6f01e6491c7b887e8474 (patch) | |
tree | 41fa38c558ef36465f030b8f58155a890251f215 /src/mm-device.c | |
parent | 98f21ec195a090618139c601870bcc4b1883c33f (diff) |
device: Keep track of devices as they are move across sysfs
For certain devices the name changes with their status. Notably, RFCOMM
devices move from /devices/virtual/ to underneath the HCI that is used
for the connection as the session is estabilished, and return back when
it's torn down.
Diffstat (limited to 'src/mm-device.c')
-rw-r--r-- | src/mm-device.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mm-device.c b/src/mm-device.c index 3e2e46f6..9c2a6e25 100644 --- a/src/mm-device.c +++ b/src/mm-device.c @@ -96,6 +96,11 @@ device_find_probe_with_device (MMDevice *self, for (l = self->priv->port_probes; l; l = g_list_next (l)) { MMPortProbe *probe = MM_PORT_PROBE (l->data); + if ( g_udev_device_has_property (udev_port, "DEVPATH_OLD") + && g_str_has_suffix (g_udev_device_get_sysfs_path (mm_port_probe_peek_port (probe)), + g_udev_device_get_property (udev_port, "DEVPATH_OLD"))) + return probe; + if (g_str_equal (g_udev_device_get_sysfs_path (mm_port_probe_peek_port (probe)), g_udev_device_get_sysfs_path (udev_port))) return probe; @@ -107,6 +112,11 @@ device_find_probe_with_device (MMDevice *self, for (l = self->priv->ignored_port_probes; l; l = g_list_next (l)) { MMPortProbe *probe = MM_PORT_PROBE (l->data); + if ( g_udev_device_has_property (udev_port, "DEVPATH_OLD") + && g_str_has_suffix (g_udev_device_get_sysfs_path (mm_port_probe_peek_port (probe)), + g_udev_device_get_property (udev_port, "DEVPATH_OLD"))) + return probe; + if (g_str_equal (g_udev_device_get_sysfs_path (mm_port_probe_peek_port (probe)), g_udev_device_get_sysfs_path (udev_port))) return probe; |