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().
This commit is contained in:
Thomas Haller 2021-01-08 20:24:36 +01:00
parent 84d67d3a4f
commit 90881953ed
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
4 changed files with 11 additions and 9 deletions

View file

@ -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;

View file

@ -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,

View file

@ -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 *

View file

@ -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);