From 2b70e02ef57dd7d0f4d7d3896d3ee1390a7ff71b Mon Sep 17 00:00:00 2001 From: Wen Liang Date: Sat, 14 Aug 2021 14:53:58 -0400 Subject: [PATCH] platform: rename `nm_platform_link_get_permanent_address()` Rename `nm_platform_link_get_permanent_address()`, `link_get_permanent_address()` to `nm_platform_link_get_permanent_address_ethtool()`, `link_get_permanent_address_ethtool()`. Signed-off-by: Wen Liang --- src/core/devices/nm-device.c | 6 +++--- src/libnm-platform/nm-linux-platform.c | 16 ++++++++-------- src/libnm-platform/nm-platform.c | 10 ++++++---- src/libnm-platform/nm-platform.h | 11 ++++++----- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index fb40f05d67..4ee5dc9a28 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -17132,9 +17132,9 @@ nm_device_update_permanent_hw_address(NMDevice *self, gboolean force_freeze) return; } - success_read = nm_platform_link_get_permanent_address(nm_device_get_platform(self), - ifindex, - &cached_hw_addr_perm); + success_read = nm_platform_link_get_permanent_address_ethtool(nm_device_get_platform(self), + ifindex, + &cached_hw_addr_perm); if (success_read && priv->hw_addr_len == cached_hw_addr_perm.len) { priv->hw_addr_perm_fake = FALSE; priv->hw_addr_perm = diff --git a/src/libnm-platform/nm-linux-platform.c b/src/libnm-platform/nm-linux-platform.c index 3cf8ba87b7..31186d4a0e 100644 --- a/src/libnm-platform/nm-linux-platform.c +++ b/src/libnm-platform/nm-linux-platform.c @@ -7636,7 +7636,7 @@ nla_put_failure: } static gboolean -link_get_permanent_address(NMPlatform *platform, int ifindex, NMPLinkAddress *out_address) +link_get_permanent_address_ethtool(NMPlatform *platform, int ifindex, NMPLinkAddress *out_address) { nm_auto_pop_netns NMPNetns *netns = NULL; guint8 buffer[_NM_UTILS_HWADDR_LEN_MAX]; @@ -9660,13 +9660,13 @@ nm_linux_platform_class_init(NMLinuxPlatformClass *klass) platform_class->link_set_user_ipv6ll_enabled = link_set_user_ipv6ll_enabled; platform_class->link_set_token = link_set_token; - platform_class->link_set_address = link_set_address; - platform_class->link_get_permanent_address = link_get_permanent_address; - platform_class->link_set_mtu = link_set_mtu; - platform_class->link_set_name = link_set_name; - platform_class->link_set_sriov_params_async = link_set_sriov_params_async; - platform_class->link_set_sriov_vfs = link_set_sriov_vfs; - platform_class->link_set_bridge_vlans = link_set_bridge_vlans; + platform_class->link_set_address = link_set_address; + platform_class->link_get_permanent_address_ethtool = link_get_permanent_address_ethtool; + platform_class->link_set_mtu = link_set_mtu; + platform_class->link_set_name = link_set_name; + platform_class->link_set_sriov_params_async = link_set_sriov_params_async; + platform_class->link_set_sriov_vfs = link_set_sriov_vfs; + platform_class->link_set_bridge_vlans = link_set_bridge_vlans; platform_class->link_get_physical_port_id = link_get_physical_port_id; platform_class->link_get_dev_id = link_get_dev_id; diff --git a/src/libnm-platform/nm-platform.c b/src/libnm-platform/nm-platform.c index a010566ceb..af93533efc 100644 --- a/src/libnm-platform/nm-platform.c +++ b/src/libnm-platform/nm-platform.c @@ -1737,7 +1737,7 @@ nm_platform_link_get_address(NMPlatform *self, int ifindex, size_t *length) } /** - * nm_platform_link_get_permanent_address: + * nm_platform_link_get_permanent_address_ethtool: * @self: platform instance * @ifindex: Interface index * @buf: buffer of at least %_NM_UTILS_HWADDR_LEN_MAX bytes, on success @@ -1748,7 +1748,9 @@ nm_platform_link_get_address(NMPlatform *self, int ifindex, size_t *length) * address. */ gboolean -nm_platform_link_get_permanent_address(NMPlatform *self, int ifindex, NMPLinkAddress *out_address) +nm_platform_link_get_permanent_address_ethtool(NMPlatform * self, + int ifindex, + NMPLinkAddress *out_address) { _CHECK_SELF(self, klass, FALSE); @@ -1758,8 +1760,8 @@ nm_platform_link_get_permanent_address(NMPlatform *self, int ifindex, NMPLinkAdd g_return_val_if_fail(ifindex > 0, FALSE); g_return_val_if_fail(out_address, FALSE); - if (klass->link_get_permanent_address) - return klass->link_get_permanent_address(self, ifindex, out_address); + if (klass->link_get_permanent_address_ethtool) + return klass->link_get_permanent_address_ethtool(self, ifindex, out_address); return FALSE; } diff --git a/src/libnm-platform/nm-platform.h b/src/libnm-platform/nm-platform.h index 6ff6b91118..170d8ae37d 100644 --- a/src/libnm-platform/nm-platform.h +++ b/src/libnm-platform/nm-platform.h @@ -1111,9 +1111,9 @@ typedef struct { int (*link_set_user_ipv6ll_enabled)(NMPlatform *self, int ifindex, gboolean enabled); gboolean (*link_set_token)(NMPlatform *self, int ifindex, NMUtilsIPv6IfaceId iid); - gboolean (*link_get_permanent_address)(NMPlatform * self, - int ifindex, - NMPLinkAddress *out_address); + gboolean (*link_get_permanent_address_ethtool)(NMPlatform * self, + int ifindex, + NMPLinkAddress *out_address); int (*link_set_address)(NMPlatform *self, int ifindex, gconstpointer address, size_t length); int (*link_set_mtu)(NMPlatform *self, int ifindex, guint32 mtu); gboolean (*link_set_name)(NMPlatform *self, int ifindex, const char *name); @@ -1863,8 +1863,9 @@ struct udev_device *nm_platform_link_get_udev_device(NMPlatform *self, int ifind int nm_platform_link_set_user_ipv6ll_enabled(NMPlatform *self, int ifindex, gboolean enabled); gboolean nm_platform_link_set_ipv6_token(NMPlatform *self, int ifindex, NMUtilsIPv6IfaceId iid); -gboolean -nm_platform_link_get_permanent_address(NMPlatform *self, int ifindex, NMPLinkAddress *out_address); +gboolean nm_platform_link_get_permanent_address_ethtool(NMPlatform * self, + int ifindex, + NMPLinkAddress *out_address); int nm_platform_link_set_address(NMPlatform *self, int ifindex, const void *address, size_t length); int nm_platform_link_set_mtu(NMPlatform *self, int ifindex, guint32 mtu); gboolean nm_platform_link_set_name(NMPlatform *self, int ifindex, const char *name);