]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ethtool-util: drop unused function 19681/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 21 May 2021 19:37:54 +0000 (04:37 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 23 May 2021 02:40:15 +0000 (11:40 +0900)
src/shared/ethtool-util.c
src/shared/ethtool-util.h

index 4b70ee451a0f944af0864694f4ccc6c1d8a23849..9506af8b8b2542709ab79a0f122349a9e02963b6 100644 (file)
@@ -310,51 +310,6 @@ int ethtool_get_permanent_macaddr(int *ethtool_fd, const char *ifname, struct et
                 dest = _v;                             \
         } while(false)
 
-int ethtool_set_speed(int *ethtool_fd, const char *ifname, unsigned speed, Duplex duplex) {
-        struct ethtool_cmd ecmd = {
-                .cmd = ETHTOOL_GSET,
-        };
-        struct ifreq ifr = {
-                .ifr_data = (void*) &ecmd,
-        };
-        bool need_update = false;
-        int r;
-
-        assert(ethtool_fd);
-        assert(ifname);
-
-        if (speed == 0 && duplex < 0)
-                return 0;
-
-        r = ethtool_connect(ethtool_fd);
-        if (r < 0)
-                return r;
-
-        strscpy(ifr.ifr_name, IFNAMSIZ, ifname);
-
-        r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr);
-        if (r < 0)
-                return -errno;
-
-        if (speed > 0) {
-                need_update = need_update || ethtool_cmd_speed(&ecmd) != speed;
-                ethtool_cmd_speed_set(&ecmd, speed);
-        }
-
-        if (duplex >= 0)
-                UPDATE(ecmd.duplex, duplex, need_update);
-
-        if (!need_update)
-                return 0;
-
-        ecmd.cmd = ETHTOOL_SSET;
-        r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr);
-        if (r < 0)
-                return -errno;
-
-        return 0;
-}
-
 int ethtool_set_wol(int *ethtool_fd, const char *ifname, WakeOnLan wol) {
         struct ethtool_wolinfo ecmd = {
                 .cmd = ETHTOOL_GWOL,
index 11e2906681a56727e82aebd2828721f2131041d5..3c031cda43960b38a96a43a5539331a5c624b78a 100644 (file)
@@ -99,7 +99,6 @@ int ethtool_get_link_info(int *ethtool_fd, const char *ifname,
                           int *ret_autonegotiation, uint64_t *ret_speed,
                           Duplex *ret_duplex, NetDevPort *ret_port);
 int ethtool_get_permanent_macaddr(int *ethtool_fd, const char *ifname, struct ether_addr *ret);
-int ethtool_set_speed(int *ethtool_fd, const char *ifname, unsigned speed, Duplex duplex);
 int ethtool_set_wol(int *ethtool_fd, const char *ifname, WakeOnLan wol);
 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);