diff options
author | Dan Williams <dcbw@redhat.com> | 2009-10-02 22:31:16 -0700 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2009-10-02 22:31:16 -0700 |
commit | e5441115a2dda5d81de2e9a336fc34e23d20b309 (patch) | |
tree | c3f479a63ff9b457749041c8b82e2304a2c8ddbc /src | |
parent | f2a3825f9d10ecebc63ce3c8602473cbbb6ab72c (diff) |
bluetooth: recognize rfcomm devices
Two hacks here:
1) rfcomm ports don't have an easily accessible driver name, so we just
match the parent's subsystem to 'bluetooth' and use that
2) libgudev doesn't seem be be able to get the rfcomm device's device file,
which would normally be /dev/rfcommX. Oh well, we don't use the device file
yet anyway
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-plugin-base.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c index 7adbe2a2..92694f50 100644 --- a/src/mm-plugin-base.c +++ b/src/mm-plugin-base.c @@ -664,7 +664,7 @@ static char * get_driver_name (GUdevDevice *device) { GUdevDevice *parent = NULL; - const char *driver; + const char *driver, *subsys; char *ret = NULL; driver = g_udev_device_get_driver (device); @@ -672,6 +672,15 @@ get_driver_name (GUdevDevice *device) parent = g_udev_device_get_parent (device); if (parent) driver = g_udev_device_get_driver (parent); + + /* Check for bluetooth; it's driver is a bunch of levels up so we + * just check for the subsystem of the parent being bluetooth. + */ + if (!driver && parent) { + subsys = g_udev_device_get_subsystem (parent); + if (subsys && !strcmp (subsys, "bluetooth")) + driver = "bluetooth"; + } } if (driver) |