diff options
author | Thomas Haller <thaller@redhat.com> | 2021-01-08 20:24:36 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-01-15 11:32:36 +0100 |
commit | 90881953edd16b79fa1fd15e90d2d89454e0fb37 (patch) | |
tree | 9cd8bc2cb7d96a93784099551973610d52444398 | |
parent | 84d67d3a4fb9095c6cb659fc1add770364a958df (diff) | |
download | NetworkManager-90881953edd16b79fa1fd15e90d2d89454e0fb37.tar.gz |
platform: move nm_platform_link_duplex_type_to_string() to "nm-platform-utils.c"
There should be a clear hierarchie of dependency. That is,
"nm-platform.h" may use "nm-platform-utils.h", but not the
other way around.
Move nm_platform_link_duplex_type_to_string().
-rw-r--r-- | src/platform/nm-platform-utils.c | 9 | ||||
-rw-r--r-- | src/platform/nm-platform-utils.h | 2 | ||||
-rw-r--r-- | src/platform/nm-platform.c | 7 | ||||
-rw-r--r-- | src/platform/nm-platform.h | 2 |
4 files changed, 11 insertions, 9 deletions
diff --git a/src/platform/nm-platform-utils.c b/src/platform/nm-platform-utils.c index f40059a049..074e2c23e4 100644 --- a/src/platform/nm-platform-utils.c +++ b/src/platform/nm-platform-utils.c @@ -53,6 +53,15 @@ nmp_utils_if_nametoindex(const char *ifname) /*****************************************************************************/ +NM_UTILS_LOOKUP_STR_DEFINE(nm_platform_link_duplex_type_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"), ); + +/*****************************************************************************/ + typedef struct { int fd; const int ifindex; diff --git a/src/platform/nm-platform-utils.h b/src/platform/nm-platform-utils.h index 3de40a27d0..38f8a00729 100644 --- a/src/platform/nm-platform-utils.h +++ b/src/platform/nm-platform-utils.h @@ -20,6 +20,8 @@ gboolean nmp_utils_ethtool_set_wake_on_lan(int ifindex, _NMSettingWiredWakeOnLan wol, const char * wol_password); +const char *nm_platform_link_duplex_type_to_string(NMPlatformLinkDuplexType duplex); + gboolean nmp_utils_ethtool_get_link_settings(int ifindex, gboolean * out_autoneg, guint32 * out_speed, diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 5c92c773ff..44c6ee4797 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -3322,13 +3322,6 @@ nm_platform_ethtool_get_link_settings(NMPlatform * self, return nmp_utils_ethtool_get_link_settings(ifindex, out_autoneg, out_speed, out_duplex); } -NM_UTILS_LOOKUP_STR_DEFINE(nm_platform_link_duplex_type_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"), ); - /*****************************************************************************/ NMEthtoolFeatureStates * diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h index 7770492f63..a785144155 100644 --- a/src/platform/nm-platform.h +++ b/src/platform/nm-platform.h @@ -2358,8 +2358,6 @@ gboolean nm_platform_ethtool_get_link_ring(NMPlatform *self, int ifindex, NMEtht gboolean nm_platform_ethtool_set_ring(NMPlatform *self, int ifindex, const NMEthtoolRingState *ring); -const char *nm_platform_link_duplex_type_to_string(NMPlatformLinkDuplexType duplex); - void nm_platform_ip4_dev_route_blacklist_set(NMPlatform *self, int ifindex, GPtrArray * ip4_dev_route_blacklist); |