32 #define PCH_GBE_STAT(m) \
35 .size = FIELD_SIZEOF(struct pch_gbe_hw_stats, m), \
36 .offset = offsetof(struct pch_gbe_hw_stats, m), \
42 static const struct pch_gbe_stats pch_gbe_gstrings_stats[] = {
70 #define PCH_GBE_QUEUE_STATS_LEN 0
71 #define PCH_GBE_GLOBAL_STATS_LEN ARRAY_SIZE(pch_gbe_gstrings_stats)
72 #define PCH_GBE_STATS_LEN (PCH_GBE_GLOBAL_STATS_LEN + PCH_GBE_QUEUE_STATS_LEN)
74 #define PCH_GBE_MAC_REGS_LEN (sizeof(struct pch_gbe_regs) / 4)
75 #define PCH_GBE_REGS_LEN (PCH_GBE_MAC_REGS_LEN + PCH_GBE_PHY_REGS_LEN)
84 static int pch_gbe_get_settings(
struct net_device *netdev,
94 if (!netif_carrier_ok(adapter->
netdev))
95 ethtool_cmd_speed_set(ecmd, -1);
112 u32 speed = ethtool_cmd_speed(ecmd);
125 pr_err(
"Error: mii_ethtool_sset\n");
128 hw->
mac.link_speed = speed;
134 if (netif_running(adapter->
netdev)) {
148 static int pch_gbe_get_regs_len(
struct net_device *netdev)
158 static void pch_gbe_get_drvinfo(
struct net_device *netdev,
167 drvinfo->
regdump_len = pch_gbe_get_regs_len(netdev);
176 static void pch_gbe_get_regs(
struct net_device *netdev,
200 static void pch_gbe_get_wol(
struct net_device *netdev,
226 static int pch_gbe_set_wol(
struct net_device *netdev,
254 static int pch_gbe_nway_reset(
struct net_device *netdev)
266 static void pch_gbe_get_ringparam(
struct net_device *netdev,
287 static int pch_gbe_set_ringparam(
struct net_device *netdev,
293 int tx_ring_size, rx_ring_size;
301 if ((netif_running(adapter->
netdev)))
327 if ((netif_running(adapter->
netdev))) {
367 if (netif_running(adapter->
netdev))
377 static void pch_gbe_get_pauseparam(
struct net_device *netdev,
404 static int pch_gbe_set_pauseparam(
struct net_device *netdev,
422 if ((netif_running(adapter->
netdev))) {
441 static void pch_gbe_get_strings(
struct net_device *netdev,
u32 stringset,
450 memcpy(p, pch_gbe_gstrings_stats[i].
string,
464 static void pch_gbe_get_ethtool_stats(
struct net_device *netdev,
470 char *hw_stats = (
char *)&adapter->
stats;
474 char *p = hw_stats + gstats->
offset;
480 static int pch_gbe_get_sset_count(
struct net_device *netdev,
int sset)
490 static const struct ethtool_ops pch_gbe_ethtool_ops = {
491 .get_settings = pch_gbe_get_settings,
492 .set_settings = pch_gbe_set_settings,
493 .get_drvinfo = pch_gbe_get_drvinfo,
494 .get_regs_len = pch_gbe_get_regs_len,
495 .get_regs = pch_gbe_get_regs,
496 .get_wol = pch_gbe_get_wol,
497 .set_wol = pch_gbe_set_wol,
498 .nway_reset = pch_gbe_nway_reset,
500 .get_ringparam = pch_gbe_get_ringparam,
501 .set_ringparam = pch_gbe_set_ringparam,
502 .get_pauseparam = pch_gbe_get_pauseparam,
503 .set_pauseparam = pch_gbe_set_pauseparam,
504 .get_strings = pch_gbe_get_strings,
505 .get_ethtool_stats = pch_gbe_get_ethtool_stats,
506 .get_sset_count = pch_gbe_get_sset_count,