diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c index 2fb8427689..84f10abf4b 100644 --- a/src/devices/nm-device-ethernet.c +++ b/src/devices/nm-device-ethernet.c @@ -1187,7 +1187,7 @@ wake_on_lan_enable (NMDevice *device) } wol = NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE; found: - return nmp_utils_ethtool_set_wake_on_lan (nm_device_get_iface (device), wol, password); + return nm_platform_ethtool_set_wake_on_lan (NM_PLATFORM_GET, nm_device_get_iface (device), wol, password); } /****************************************************************/ @@ -1533,7 +1533,7 @@ get_link_speed (NMDevice *device) NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); guint32 speed; - if (!nmp_utils_ethtool_get_link_speed (nm_device_get_iface (device), &speed)) + if (!nm_platform_ethtool_get_link_speed (NM_PLATFORM_GET, nm_device_get_iface (device), &speed)) return; if (priv->speed == speed) return; diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index e312644296..69f9812acd 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -2370,6 +2370,24 @@ _to_string_dev (NMPlatform *self, int ifindex, char *buf, size_t size) /******************************************************************/ +gboolean +nm_platform_ethtool_set_wake_on_lan (NMPlatform *self, const char *ifname, NMSettingWiredWakeOnLan wol, const char *wol_password) +{ + _CHECK_SELF (self, klass, FALSE); + + return nmp_utils_ethtool_set_wake_on_lan (ifname, wol, wol_password); +} + +gboolean +nm_platform_ethtool_get_link_speed (NMPlatform *self, const char *ifname, guint32 *out_speed) +{ + _CHECK_SELF (self, klass, FALSE); + + return nmp_utils_ethtool_get_link_speed (ifname, out_speed); +} + +/******************************************************************/ + void nm_platform_ip4_address_set_addr (NMPlatformIP4Address *addr, in_addr_t address, int plen) { diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h index b94c440a33..6d5bd0722e 100644 --- a/src/platform/nm-platform.h +++ b/src/platform/nm-platform.h @@ -31,6 +31,7 @@ #include "nm-core-utils.h" #include "nm-setting-vlan.h" +#include "nm-setting-wired.h" #define NM_TYPE_PLATFORM (nm_platform_get_type ()) #define NM_PLATFORM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_PLATFORM, NMPlatform)) @@ -925,4 +926,7 @@ const char *nm_platform_route_scope2str (int scope, char *buf, gsize len); int nm_platform_ip_address_cmp_expiry (const NMPlatformIPAddress *a, const NMPlatformIPAddress *b); +gboolean nm_platform_ethtool_set_wake_on_lan (NMPlatform *self, const char *ifname, NMSettingWiredWakeOnLan wol, const char *wol_password); +gboolean nm_platform_ethtool_get_link_speed (NMPlatform *self, const char *ifname, guint32 *out_speed); + #endif /* __NETWORKMANAGER_PLATFORM_H__ */