Merge commit 'origin/master' into enable-split
This commit is contained in:
@@ -108,16 +108,27 @@ grab_port (MMPluginBase *base,
|
||||
{
|
||||
GUdevDevice *port = NULL, *physdev = NULL;
|
||||
MMModem *modem = NULL;
|
||||
const char *name, *subsys, *devfile, *sysfs_path;
|
||||
const char *name, *subsys, *devfile, *sysfs_path, *driver;
|
||||
guint32 caps;
|
||||
|
||||
port = mm_plugin_base_supports_task_get_port (task);
|
||||
g_assert (port);
|
||||
|
||||
subsys = g_udev_device_get_subsystem (port);
|
||||
name = g_udev_device_get_name (port);
|
||||
|
||||
devfile = g_udev_device_get_device_file (port);
|
||||
if (!devfile) {
|
||||
g_set_error (error, 0, 0, "Could not get port's sysfs file.");
|
||||
return NULL;
|
||||
driver = mm_plugin_base_supports_task_get_driver (task);
|
||||
if (!driver || strcmp (driver, "bluetooth")) {
|
||||
g_set_error (error, 0, 0, "Could not get port's sysfs file.");
|
||||
return NULL;
|
||||
} else {
|
||||
g_message ("%s: (%s/%s) WARNING: missing udev 'device' file",
|
||||
mm_plugin_get_name (MM_PLUGIN (base)),
|
||||
subsys,
|
||||
name);
|
||||
}
|
||||
}
|
||||
|
||||
physdev = mm_plugin_base_supports_task_get_physdev (task);
|
||||
@@ -128,9 +139,6 @@ grab_port (MMPluginBase *base,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
subsys = g_udev_device_get_subsystem (port);
|
||||
name = g_udev_device_get_name (port);
|
||||
|
||||
caps = mm_plugin_base_supports_task_get_probed_capabilities (task);
|
||||
if (!existing) {
|
||||
if (caps & MM_PLUGIN_BASE_PORT_CAP_GSM) {
|
||||
|
||||
+1
-1
@@ -612,7 +612,7 @@ handle_uevent (GUdevClient *client,
|
||||
/* We only care about tty/net devices when adding modem ports,
|
||||
* but for remove, also handle usb parent device remove events
|
||||
*/
|
||||
if (!strcmp (action, "add") && strcmp (subsys, "usb") !=0 )
|
||||
if ((!strcmp (action, "add") || !strcmp (action, "move")) && strcmp (subsys, "usb") !=0 )
|
||||
device_added (self, device);
|
||||
else if (!strcmp (action, "remove"))
|
||||
device_removed (self, device);
|
||||
|
||||
+11
-2
@@ -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)
|
||||
@@ -694,7 +703,7 @@ real_find_physical_device (MMPluginBase *plugin, GUdevDevice *child)
|
||||
g_return_val_if_fail (child != NULL, NULL);
|
||||
|
||||
iter = g_object_ref (child);
|
||||
while (iter && i++ < 5) {
|
||||
while (iter && i++ < 8) {
|
||||
subsys = g_udev_device_get_subsystem (iter);
|
||||
if (subsys) {
|
||||
if (is_usb || !strcmp (subsys, "usb")) {
|
||||
|
||||
Reference in New Issue
Block a user