mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-26 14:40:39 +01:00
trivial: move some code around in nm-device.c
This commit is contained in:
parent
2dc27a99d7
commit
86abc34e26
1 changed files with 23 additions and 23 deletions
|
|
@ -1550,6 +1550,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
|
||||
|
|
@ -6804,15 +6827,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)
|
||||
{
|
||||
|
|
@ -8663,20 +8677,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