aboutsummaryrefslogtreecommitdiff
path: root/src/mm-manager.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-02-13 15:18:16 -0600
committerDan Williams <dcbw@redhat.com>2014-02-13 15:18:16 -0600
commit42ad7b758a09b91bba6cda7fe9ac06525aa86f6a (patch)
treec3e32c7d533ce06eb3029017cd888f1301e411b7 /src/mm-manager.c
parentfbb35628d525a7072ef87a9968cbc2ab1a705a6b (diff)
manager: make Bluetooth rfcomm ports work again
At some point rfcomm serial ports stopped having parents in sysfs, so checks to get the physical device fail because the rfcomm port is /sys/devices/virtual/rfcommX and has no parents. So we have to fall back on checking the interface name.
Diffstat (limited to 'src/mm-manager.c')
-rw-r--r--src/mm-manager.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mm-manager.c b/src/mm-manager.c
index 8c7969ee..3d5eea8b 100644
--- a/src/mm-manager.c
+++ b/src/mm-manager.c
@@ -170,13 +170,20 @@ find_physical_device (GUdevDevice *child)
{
GUdevDevice *iter, *old = NULL;
GUdevDevice *physdev = NULL;
- const char *subsys, *type;
+ const char *subsys, *type, *name;
guint32 i = 0;
gboolean is_usb = FALSE, is_pci = FALSE, is_pcmcia = FALSE, is_platform = FALSE;
gboolean is_pnp = FALSE;
g_return_val_if_fail (child != NULL, NULL);
+ /* Bluetooth rfcomm devices are "virtual" and don't necessarily have
+ * parents at all.
+ */
+ name = g_udev_device_get_name (child);
+ if (name && strncmp (name, "rfcomm", 6) == 0)
+ return g_object_ref (child);
+
iter = g_object_ref (child);
while (iter && i++ < 8) {
subsys = g_udev_device_get_subsystem (iter);