]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ethtool-util: rename functions and update log messages
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Sep 2025 01:28:11 +0000 (10:28 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 26 Sep 2025 10:45:58 +0000 (19:45 +0900)
src/shared/ethtool-util.c
src/shared/ethtool-util.h
src/udev/net/link-config.c

index d4b4566b62688d692f38fe44bdb1fc1663ea98f1..8b437c5a8358e65627151ffa28003da2b2f557b7 100644 (file)
@@ -652,7 +652,7 @@ int ethtool_set_features(int *ethtool_fd, const char *ifname, const int features
         return 0;
 }
 
-static int get_glinksettings(int fd, struct ifreq *ifr, union ethtool_link_usettings **ret) {
+static int get_link_settings(int fd, struct ifreq *ifr, union ethtool_link_usettings **ret) {
         union ethtool_link_usettings ecmd = {
                 .base.cmd = ETHTOOL_GLINKSETTINGS,
         };
@@ -704,7 +704,7 @@ static int get_glinksettings(int fd, struct ifreq *ifr, union ethtool_link_usett
         return 0;
 }
 
-static int set_slinksettings(int fd, struct ifreq *ifr, const union ethtool_link_usettings *u) {
+static int set_link_settings(int fd, struct ifreq *ifr, const union ethtool_link_usettings *u) {
         assert(fd >= 0);
         assert(ifr);
         assert(u);
@@ -725,7 +725,7 @@ static int set_slinksettings(int fd, struct ifreq *ifr, const union ethtool_link
         return RET_NERRNO(ioctl(fd, SIOCETHTOOL, ifr));
 }
 
-int ethtool_set_glinksettings(
+int ethtool_set_link_settings(
                 int *fd,
                 const char *ifname,
                 int autonegotiation,
@@ -772,9 +772,9 @@ int ethtool_set_glinksettings(
 
         strscpy(ifr.ifr_name, sizeof(ifr.ifr_name), ifname);
 
-        r = get_glinksettings(*fd, &ifr, &u);
+        r = get_link_settings(*fd, &ifr, &u);
         if (r < 0)
-                return log_debug_errno(r, "ethtool: Cannot get device settings for %s: %m", ifname);
+                return log_debug_errno(r, "ethtool: Cannot get link settings for %s: %m", ifname);
 
         if (speed > 0)
                 UPDATE(u->base.speed, DIV_ROUND_UP(speed, 1000000), changed);
@@ -810,9 +810,9 @@ int ethtool_set_glinksettings(
         if (!changed)
                 return 0;
 
-        r = set_slinksettings(*fd, &ifr, u);
+        r = set_link_settings(*fd, &ifr, u);
         if (r < 0)
-                return log_debug_errno(r, "ethtool: Cannot set device settings for %s: %m", ifname);
+                return log_debug_errno(r, "ethtool: Cannot set link settings for %s: %m", ifname);
 
         return r;
 }
index eea27fb381d2351b2a03c68efc42f6a4135dd81e..a17c33fe475f204a868655481ed1fdc2be3c399a 100644 (file)
@@ -167,7 +167,7 @@ int ethtool_get_permanent_hw_addr(int *ethtool_fd, const char *ifname, struct hw
 int ethtool_set_wol(int *ethtool_fd, const char *ifname, uint32_t wolopts, const uint8_t password[SOPASS_MAX]);
 int ethtool_set_nic_buffer_size(int *ethtool_fd, const char *ifname, const netdev_ring_param *ring);
 int ethtool_set_features(int *ethtool_fd, const char *ifname, const int features[static _NET_DEV_FEAT_MAX]);
-int ethtool_set_glinksettings(
+int ethtool_set_link_settings(
                 int *fd,
                 const char *ifname,
                 int autonegotiation,
index 280403a8c5f440561df32d30756a5c1e53dc151b..d1404fed8b104a5a73152180a5b1e3b1dd181fc3 100644 (file)
@@ -491,7 +491,7 @@ static int link_apply_ethtool_settings(Link *link, int *ethtool_fd) {
                 return 0;
         }
 
-        r = ethtool_set_glinksettings(ethtool_fd, name,
+        r = ethtool_set_link_settings(ethtool_fd, name,
                                       config->autonegotiation, config->advertise,
                                       config->speed, config->duplex, config->port, config->mdi);
         if (r < 0) {