diff options
author | Thomas Haller <thaller@redhat.com> | 2015-05-03 10:02:29 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-06-05 16:52:50 +0200 |
commit | 2b8f3331d76497433b761bfa1c15640de28692f5 (patch) | |
tree | 3900ecd44a5b28e1b44950dcd24cea8e6fbb8cd2 | |
parent | 77a3767d1e7f99a4f59d292eeab9363687697606 (diff) | |
download | NetworkManager-2b8f3331d76497433b761bfa1c15640de28692f5.tar.gz |
platform/trivial: move ethtool_supports_carrier_detect() code
-rw-r--r-- | src/platform/nm-linux-platform.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 373c59125d..54c8ca59c1 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -480,6 +480,18 @@ ethtool_get_permanent_address (const char *ifname, return TRUE; } +static gboolean +ethtool_supports_carrier_detect (const char *ifname) +{ + struct ethtool_cmd edata = { .cmd = ETHTOOL_GLINK }; + + /* We ignore the result. If the ETHTOOL_GLINK call succeeded, then we + * assume the device supports carrier-detect, otherwise we assume it + * doesn't. + */ + return ethtool_get (ifname, &edata); +} + /****************************************************************** * NMPlatform types and functions ******************************************************************/ @@ -2702,18 +2714,6 @@ link_set_user_ipv6ll_enabled (NMPlatform *platform, int ifindex, gboolean enable } static gboolean -supports_ethtool_carrier_detect (const char *ifname) -{ - struct ethtool_cmd edata = { .cmd = ETHTOOL_GLINK }; - - /* We ignore the result. If the ETHTOOL_GLINK call succeeded, then we - * assume the device supports carrier-detect, otherwise we assume it - * doesn't. - */ - return ethtool_get (ifname, &edata); -} - -static gboolean supports_mii_carrier_detect (const char *ifname) { int fd; @@ -2765,7 +2765,7 @@ link_supports_carrier_detect (NMPlatform *platform, int ifindex) * us whether the device actually supports carrier detection in the first * place. We assume any device that does implements one of these two APIs. */ - return supports_ethtool_carrier_detect (name) || supports_mii_carrier_detect (name); + return ethtool_supports_carrier_detect (name) || supports_mii_carrier_detect (name); } static gboolean |