summaryrefslogtreecommitdiff
path: root/src/devices/nm-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/nm-device.c')
-rw-r--r--src/devices/nm-device.c52
1 files changed, 17 insertions, 35 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 02963b52c2..bcbf5c27cd 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -1717,7 +1717,7 @@ _parent_set_ifindex (NMDevice *self,
}
if (parent_ifindex > 0) {
- parent_device = nm_manager_get_device_by_ifindex (nm_manager_get (), parent_ifindex);
+ parent_device = nm_manager_get_device_by_ifindex (NM_MANAGER_GET, parent_ifindex);
if (parent_device == self)
parent_device = NULL;
} else
@@ -2210,7 +2210,7 @@ nm_device_get_route_metric (NMDevice *self,
if (route_metric >= 0)
goto out;
- route_metric = nm_manager_device_route_metric_reserve (nm_manager_get (),
+ route_metric = nm_manager_device_route_metric_reserve (NM_MANAGER_GET,
nm_device_get_ip_ifindex (self),
nm_device_get_device_type (self));
out:
@@ -3676,7 +3676,7 @@ device_recheck_slave_status (NMDevice *self, const NMPlatformLink *plink)
if (plink->master <= 0)
return;
- master = nm_manager_get_device_by_ifindex (nm_manager_get (), plink->master);
+ master = nm_manager_get_device_by_ifindex (NM_MANAGER_GET, plink->master);
plink_master = nm_platform_link_get (nm_device_get_platform (self), plink->master);
plink_master_keep_alive = nmp_object_ref (NMP_OBJECT_UP_CAST (plink_master));
@@ -4785,42 +4785,24 @@ nm_device_unrealize (NMDevice *self, gboolean remove_resources, GError **error)
return TRUE;
}
-/**
- * nm_device_notify_component_added():
- * @self: the #NMDevice
- * @component: the component being added by a plugin
- *
- * Called by the manager to notify the device that a new component has
- * been found. The device implementation should return %TRUE if it
- * wishes to claim the component, or %FALSE if it cannot.
- *
- * Returns: %TRUE to claim the component, %FALSE if the component cannot be
- * claimed.
- */
-gboolean
-nm_device_notify_component_added (NMDevice *self, GObject *component)
+void
+nm_device_notify_availability_maybe_changed (NMDevice *self)
{
- NMDeviceClass *klass;
NMDevicePrivate *priv;
- g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
+ g_return_if_fail (NM_IS_DEVICE (self));
priv = NM_DEVICE_GET_PRIVATE (self);
- klass = NM_DEVICE_GET_CLASS (self);
-
- if (priv->state == NM_DEVICE_STATE_DISCONNECTED) {
- /* A device could have stayed disconnected because it would
- * want to register with a network server that now become
- * available. */
- nm_device_recheck_available_connections (self);
- if (g_hash_table_size (priv->available_connections) > 0)
- nm_device_emit_recheck_auto_activate (self);
- }
- if (klass->component_added)
- return klass->component_added (self, component);
+ if (priv->state != NM_DEVICE_STATE_DISCONNECTED)
+ return;
- return FALSE;
+ /* A device could have stayed disconnected because it would
+ * want to register with a network server that now become
+ * available. */
+ nm_device_recheck_available_connections (self);
+ if (g_hash_table_size (priv->available_connections) > 0)
+ nm_device_emit_recheck_auto_activate (self);
}
/**
@@ -5895,7 +5877,7 @@ check_connection_compatible (NMDevice *self, NMConnection *connection, GError **
return FALSE;
}
- conn_iface = nm_manager_get_connection_iface (nm_manager_get (),
+ conn_iface = nm_manager_get_connection_iface (NM_MANAGER_GET,
connection,
NULL,
&local);
@@ -10658,7 +10640,7 @@ start_sharing (NMDevice *self, NMIP4Config *config, GError **error)
* the announced setting without restarting dnsmasq. That means, if the default
* route changes w.r.t. being metered, then the shared connection does not get
* updated before reactivating. */
- announce_android_metered = NM_IN_SET (nm_manager_get_metered (nm_manager_get ()),
+ announce_android_metered = NM_IN_SET (nm_manager_get_metered (NM_MANAGER_GET),
NM_METERED_YES,
NM_METERED_GUESS_YES);
break;
@@ -14668,7 +14650,7 @@ _cleanup_generic_pre (NMDevice *self, CleanupType cleanup_type)
priv->stage1_sriov_state = NM_DEVICE_STAGE_STATE_INIT;
if (cleanup_type != CLEANUP_TYPE_KEEP) {
- nm_manager_device_route_metric_clear (nm_manager_get (),
+ nm_manager_device_route_metric_clear (NM_MANAGER_GET,
nm_device_get_ip_ifindex (self));
}