From 3ee316bd7ba1827e916d9cdf3f03db75df2622fc Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 22 May 2021 04:37:54 +0900 Subject: [PATCH] ethtool-util: drop unused function --- src/shared/ethtool-util.c | 45 --------------------------------------- src/shared/ethtool-util.h | 1 - 2 files changed, 46 deletions(-) diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c index 4b70ee451a..9506af8b8b 100644 --- a/src/shared/ethtool-util.c +++ b/src/shared/ethtool-util.c @@ -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, diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h index 11e2906681..3c031cda43 100644 --- a/src/shared/ethtool-util.h +++ b/src/shared/ethtool-util.h @@ -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);