aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Mazur <michamazur@google.com>2024-12-19 09:42:26 +0000
committerMichal Mazur <michamazur@google.com>2024-12-19 09:42:26 +0000
commit66aa3d16e5e733064b1ffde809c455d612d8b241 (patch)
tree2475d8c4572d09ce8c5d5ed8ec91e13d79fe525a
parent1e865d76a80d4c999eacd1c3c110605c45ef9f04 (diff)
device,plugin: reset MMDevice's hotplugged after creating the modem
The hotplugged flag was added to simplify modem probe on first time it is created. Before the re-probe it must be set to FALSE to destroy all existing netlink interfaces and force full reconfiguration.
-rw-r--r--src/mm-device.c6
-rw-r--r--src/mm-device.h1
-rw-r--r--src/mm-plugin.c2
3 files changed, 9 insertions, 0 deletions
diff --git a/src/mm-device.c b/src/mm-device.c
index 22e7dc2b..af2332f6 100644
--- a/src/mm-device.c
+++ b/src/mm-device.c
@@ -698,6 +698,12 @@ mm_device_get_hotplugged (MMDevice *self)
return self->priv->hotplugged;
}
+void
+mm_device_reset_hotplugged (MMDevice *self)
+{
+ self->priv->hotplugged = FALSE;
+}
+
gboolean
mm_device_get_inhibited (MMDevice *self)
{
diff --git a/src/mm-device.h b/src/mm-device.h
index 5426ef17..70c7ada4 100644
--- a/src/mm-device.h
+++ b/src/mm-device.h
@@ -107,6 +107,7 @@ GObject *mm_device_get_plugin (MMDevice *self);
MMBaseModem *mm_device_peek_modem (MMDevice *self);
MMBaseModem *mm_device_get_modem (MMDevice *self);
gboolean mm_device_get_hotplugged (MMDevice *self);
+void mm_device_reset_hotplugged (MMDevice *self);
gboolean mm_device_get_inhibited (MMDevice *self);
GObject *mm_device_peek_port_probe (MMDevice *self,
diff --git a/src/mm-plugin.c b/src/mm-plugin.c
index 4ec043a3..8efc24cf 100644
--- a/src/mm-plugin.c
+++ b/src/mm-plugin.c
@@ -962,6 +962,8 @@ mm_plugin_create_modem (MMPlugin *self,
return NULL;
mm_base_modem_set_hotplugged (modem, mm_device_get_hotplugged (device));
+ /* Reset hotplugged flag to guarantee full reconfiguration on next probe */
+ mm_device_reset_hotplugged (device);
if (port_probes) {
GList *l;