aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mm-base-manager.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mm-base-manager.c b/src/mm-base-manager.c
index 48e2f25d..f909ce6f 100644
--- a/src/mm-base-manager.c
+++ b/src/mm-base-manager.c
@@ -240,6 +240,19 @@ device_removed (MMBaseManager *self,
return;
}
+#if defined WITH_UDEV
+ /* When a USB modem is switching its USB configuration, udev may deliver
+ * the remove events of USB interfaces associated with the old USB
+ * configuration and the add events of USB interfaces associated with the
+ * new USB configuration in an interleaved fashion. As we don't want a
+ * remove event of an USB interface trigger the removal of a MMDevice for
+ * the special case being handled here, we ignore any remove event with
+ * DEVTYPE != usb_device.
+ */
+ if (g_strcmp0 (mm_kernel_device_get_property (kernel_device, "DEVTYPE"), "usb_device") != 0)
+ return;
+#endif
+
/* This case is designed to handle the case where, at least with kernel 2.6.31, unplugging
* an in-use ttyACMx device results in udev generating remove events for the usb, but the
* ttyACMx device (subsystem tty) is not removed, since it was in-use. So if we have not