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 <liangwen12year@gmail.com>
This commit is contained in:
Wen Liang 2021-08-14 14:53:58 -04:00 committed by Thomas Haller
parent 1605fa460d
commit 2b70e02ef5
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
4 changed files with 23 additions and 20 deletions

View file

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

View file

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

View file

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

View file

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