COVERAGE_DEFINE(netdev_get_ifindex);
COVERAGE_DEFINE(netdev_get_hwaddr);
COVERAGE_DEFINE(netdev_set_hwaddr);
-COVERAGE_DEFINE(netdev_ethtool);
+COVERAGE_DEFINE(netdev_get_ethtool);
+COVERAGE_DEFINE(netdev_set_ethtool);
\f
/* These were introduced in Linux 2.6.14, so they might be missing if we have
return 0;
}
+ COVERAGE_INC(netdev_get_ethtool);
memset(&netdev_dev->drvinfo, 0, sizeof netdev_dev->drvinfo);
error = netdev_linux_do_ethtool(netdev_dev->netdev_dev.name,
(struct ethtool_cmd *)&netdev_dev->drvinfo,
VLOG_DBG_RL(&rl, "%s: failed to query MII, falling back to ethtool",
name);
+ COVERAGE_INC(netdev_get_ethtool);
memset(&ecmd, 0, sizeof ecmd);
error = netdev_linux_do_ethtool(name, &ecmd, ETHTOOL_GLINK,
"ETHTOOL_GLINK");
return;
}
+ COVERAGE_INC(netdev_get_ethtool);
memset(&ecmd, 0, sizeof ecmd);
error = netdev_linux_do_ethtool(netdev_dev->netdev_dev.name, &ecmd,
ETHTOOL_GSET, "ETHTOOL_GSET");
struct ethtool_cmd ecmd;
int error;
+ COVERAGE_INC(netdev_get_ethtool);
memset(&ecmd, 0, sizeof ecmd);
error = netdev_linux_do_ethtool(netdev_get_name(netdev), &ecmd,
ETHTOOL_GSET, "ETHTOOL_GSET");
if (advertise & NETDEV_F_PAUSE_ASYM) {
ecmd.advertising |= ADVERTISED_Asym_Pause;
}
+ COVERAGE_INC(netdev_set_ethtool);
return netdev_linux_do_ethtool(netdev_get_name(netdev), &ecmd,
ETHTOOL_SSET, "ETHTOOL_SSET");
}
uint32_t new_flags;
int error;
+ COVERAGE_INC(netdev_get_ethtool);
memset(&evalue, 0, sizeof evalue);
error = netdev_linux_do_ethtool(netdev_name,
(struct ethtool_cmd *)&evalue,
return error;
}
+ COVERAGE_INC(netdev_set_ethtool);
evalue.data = new_flags = (evalue.data & ~flag) | (enable ? flag : 0);
error = netdev_linux_do_ethtool(netdev_name,
(struct ethtool_cmd *)&evalue,
return error;
}
+ COVERAGE_INC(netdev_get_ethtool);
memset(&evalue, 0, sizeof evalue);
error = netdev_linux_do_ethtool(netdev_name,
(struct ethtool_cmd *)&evalue,
ifr.ifr_data = (caddr_t) ecmd;
ecmd->cmd = cmd;
- COVERAGE_INC(netdev_ethtool);
if (ioctl(af_inet_sock, SIOCETHTOOL, &ifr) == 0) {
return 0;
} else {