mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 22:10:09 +01:00
trivial: move some code around in nm-device.c
(cherry picked from commit 86abc34e26)
This commit is contained in:
parent
e585c4d4f3
commit
5ddfc86eb8
1 changed files with 23 additions and 23 deletions
|
|
@ -1519,6 +1519,29 @@ link_changed (NMDevice *self, NMPlatformLink *info)
|
|||
nm_device_set_carrier (self, info->connected);
|
||||
}
|
||||
|
||||
static void
|
||||
config_changed_update_ignore_carrier (NMConfig *config,
|
||||
NMConfigData *config_data,
|
||||
NMConfigChangeFlags changes,
|
||||
NMConfigData *old_data,
|
||||
NMDevice *self)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
|
||||
if ( priv->state <= NM_DEVICE_STATE_DISCONNECTED
|
||||
|| priv->state > NM_DEVICE_STATE_ACTIVATED)
|
||||
priv->ignore_carrier = nm_config_data_get_ignore_carrier (config_data, self);
|
||||
}
|
||||
|
||||
static void
|
||||
check_carrier (NMDevice *self)
|
||||
{
|
||||
int ifindex = nm_device_get_ip_ifindex (self);
|
||||
|
||||
if (!nm_device_has_capability (self, NM_DEVICE_CAP_NONSTANDARD_CARRIER))
|
||||
nm_device_set_carrier (self, nm_platform_link_is_connected (NM_PLATFORM_GET, ifindex));
|
||||
}
|
||||
|
||||
/**
|
||||
* nm_device_notify_component_added():
|
||||
* @self: the #NMDevice
|
||||
|
|
@ -6664,15 +6687,6 @@ nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
check_carrier (NMDevice *self)
|
||||
{
|
||||
int ifindex = nm_device_get_ip_ifindex (self);
|
||||
|
||||
if (!nm_device_has_capability (self, NM_DEVICE_CAP_NONSTANDARD_CARRIER))
|
||||
nm_device_set_carrier (self, nm_platform_link_is_connected (NM_PLATFORM_GET, ifindex));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
bring_up (NMDevice *self, gboolean *no_firmware)
|
||||
{
|
||||
|
|
@ -8422,20 +8436,6 @@ spec_match_list (NMDevice *self, const GSList *specs)
|
|||
return matched;
|
||||
}
|
||||
|
||||
static void
|
||||
config_changed_update_ignore_carrier (NMConfig *config,
|
||||
NMConfigData *config_data,
|
||||
NMConfigChangeFlags changes,
|
||||
NMConfigData *old_data,
|
||||
NMDevice *self)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
|
||||
if ( priv->state <= NM_DEVICE_STATE_DISCONNECTED
|
||||
|| priv->state > NM_DEVICE_STATE_ACTIVATED)
|
||||
priv->ignore_carrier = nm_config_data_get_ignore_carrier (config_data, self);
|
||||
}
|
||||
|
||||
/***********************************************************/
|
||||
|
||||
#define DEFAULT_AUTOCONNECT TRUE
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue