24 #include <linux/netdevice.h>
25 #include <linux/ethtool.h>
26 #include <linux/pci.h>
33 } ethtool_stats_keys[] = {
41 {
"rx_descriptor_error" },
43 {
"alloc_rx_skb_error" },
44 {
"rx_iommu_map_error" },
45 {
"tx_iommu_map_error" },
46 {
"rx_desc_unk_state" },
50 spider_net_ethtool_get_settings(
struct net_device *netdev,
54 card = netdev_priv(netdev);
61 ethtool_cmd_speed_set(cmd, card->
phy.speed);
72 card = netdev_priv(netdev);
83 spider_net_ethtool_get_wol(
struct net_device *netdev,
92 spider_net_ethtool_get_msglevel(
struct net_device *netdev)
95 card = netdev_priv(netdev);
100 spider_net_ethtool_set_msglevel(
struct net_device *netdev,
104 card = netdev_priv(netdev);
109 spider_net_ethtool_nway_reset(
struct net_device *netdev)
111 if (netif_running(netdev)) {
119 spider_net_ethtool_get_ringparam(
struct net_device *netdev,
130 static int spider_net_get_sset_count(
struct net_device *netdev,
int sset)
140 static void spider_net_get_ethtool_stats(
struct net_device *netdev,
145 data[0] = netdev->
stats.tx_packets;
146 data[1] = netdev->
stats.tx_bytes;
147 data[2] = netdev->
stats.rx_packets;
148 data[3] = netdev->
stats.rx_bytes;
149 data[4] = netdev->
stats.tx_errors;
150 data[5] = netdev->
stats.tx_dropped;
151 data[6] = netdev->
stats.rx_dropped;
160 static void spider_net_get_strings(
struct net_device *netdev,
u32 stringset,
163 memcpy(data, ethtool_stats_keys,
sizeof(ethtool_stats_keys));
167 .get_settings = spider_net_ethtool_get_settings,
168 .get_drvinfo = spider_net_ethtool_get_drvinfo,
169 .get_wol = spider_net_ethtool_get_wol,
170 .get_msglevel = spider_net_ethtool_get_msglevel,
171 .set_msglevel = spider_net_ethtool_set_msglevel,
173 .nway_reset = spider_net_ethtool_nway_reset,
174 .get_ringparam = spider_net_ethtool_get_ringparam,
175 .get_strings = spider_net_get_strings,
176 .get_sset_count = spider_net_get_sset_count,
177 .get_ethtool_stats = spider_net_get_ethtool_stats,