diff options
| author | Michael Biebl <biebl@debian.org> | 2018-06-17 14:54:57 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2018-06-17 14:54:57 +0200 |
| commit | 9d9b149b81f5ea5fe53ac383fda9cf3afb96b30f (patch) | |
| tree | a47c80e4d962d3f2202dbab41e2744c921fb8567 /src/devices/nm-device-ethernet.c | |
| parent | 03218e6d85e6654bd942b7531ba48b9d9535d55f (diff) | |
| parent | 069cb5c3a525ebcc19cc2927964258acaca87b13 (diff) | |
Update upstream source from tag 'upstream/1.11.90'
Update to upstream version '1.11.90' with Debian dir 13153fad72263d24704dca73c994fe8f7bfd3a28
Diffstat (limited to 'src/devices/nm-device-ethernet.c')
| -rw-r--r-- | src/devices/nm-device-ethernet.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c index 6c5e33e4..87d16dbe 100644 --- a/src/devices/nm-device-ethernet.c +++ b/src/devices/nm-device-ethernet.c @@ -753,13 +753,6 @@ supplicant_interface_init (NMDeviceEthernet *self) return TRUE; } -NM_UTILS_LOOKUP_STR_DEFINE_STATIC (link_duplex_to_string, NMPlatformLinkDuplexType, - NM_UTILS_LOOKUP_DEFAULT_WARN (NULL), - NM_UTILS_LOOKUP_STR_ITEM (NM_PLATFORM_LINK_DUPLEX_UNKNOWN, "unknown"), - NM_UTILS_LOOKUP_STR_ITEM (NM_PLATFORM_LINK_DUPLEX_FULL, "full"), - NM_UTILS_LOOKUP_STR_ITEM (NM_PLATFORM_LINK_DUPLEX_HALF, "half"), -); - static NMPlatformLinkDuplexType link_duplex_to_platform (const char *duplex) { @@ -787,13 +780,11 @@ link_negotiation_set (NMDevice *device) s_wired = (NMSettingWired *) nm_device_get_applied_setting (device, NM_TYPE_SETTING_WIRED); if (s_wired) { autoneg = nm_setting_wired_get_auto_negotiate (s_wired); - if (!autoneg) { - speed = nm_setting_wired_get_speed (s_wired); - duplex = link_duplex_to_platform (nm_setting_wired_get_duplex (s_wired)); - if (!speed && !duplex) { - _LOGD (LOGD_DEVICE, "set-link: ignore link negotiation"); - return; - } + speed = nm_setting_wired_get_speed (s_wired); + duplex = link_duplex_to_platform (nm_setting_wired_get_duplex (s_wired)); + if (!autoneg && !speed && !duplex) { + _LOGD (LOGD_DEVICE, "set-link: ignore link negotiation"); + return; } } @@ -804,20 +795,23 @@ link_negotiation_set (NMDevice *device) } /* If link negotiation setting are already in place do nothing and return with success */ - if ( (!!autoneg == !!link_autoneg) - && (!speed || (speed == link_speed)) - && (!duplex || (duplex == link_duplex))) { + if ( !!autoneg == !!link_autoneg + && speed == link_speed + && duplex == link_duplex) { _LOGD (LOGD_DEVICE, "set-link: link negotiation is already configured"); return; } - if (autoneg) - _LOGD (LOGD_DEVICE, "set-link: configure autonegotiation"); + if (autoneg && !speed && !duplex) + _LOGD (LOGD_DEVICE, "set-link: configure auto-negotiation"); else { - _LOGD (LOGD_DEVICE, "set-link: configure static negotiation (%u Mbit%s - %s duplex%s)", + _LOGD (LOGD_DEVICE, "set-link: configure %snegotiation (%u Mbit%s - %s duplex%s)", + autoneg ? "auto-" : "static ", speed ?: link_speed, speed ? "" : "*", - duplex ? link_duplex_to_string (duplex) : link_duplex_to_string (link_duplex), + duplex + ? nm_platform_link_duplex_type_to_string (duplex) + : nm_platform_link_duplex_type_to_string (link_duplex), duplex ? "" : "*"); } |