aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgb/ixgb_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgb/ixgb_ethtool.c')
-rw-r--r--drivers/net/ixgb/ixgb_ethtool.c57
1 files changed, 34 insertions, 23 deletions
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index d38ade5f2f4e..cf19b898ba9b 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 3
4 Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. 4 Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free 7 under the terms of the GNU General Public License as published by the Free
@@ -44,6 +44,8 @@ extern void ixgb_free_rx_resources(struct ixgb_adapter *adapter);
44extern void ixgb_free_tx_resources(struct ixgb_adapter *adapter); 44extern void ixgb_free_tx_resources(struct ixgb_adapter *adapter);
45extern void ixgb_update_stats(struct ixgb_adapter *adapter); 45extern void ixgb_update_stats(struct ixgb_adapter *adapter);
46 46
47#define IXGB_ALL_RAR_ENTRIES 16
48
47struct ixgb_stats { 49struct ixgb_stats {
48 char stat_string[ETH_GSTRING_LEN]; 50 char stat_string[ETH_GSTRING_LEN];
49 int sizeof_stat; 51 int sizeof_stat;
@@ -76,6 +78,7 @@ static struct ixgb_stats ixgb_gstrings_stats[] = {
76 {"tx_heartbeat_errors", IXGB_STAT(net_stats.tx_heartbeat_errors)}, 78 {"tx_heartbeat_errors", IXGB_STAT(net_stats.tx_heartbeat_errors)},
77 {"tx_window_errors", IXGB_STAT(net_stats.tx_window_errors)}, 79 {"tx_window_errors", IXGB_STAT(net_stats.tx_window_errors)},
78 {"tx_deferred_ok", IXGB_STAT(stats.dc)}, 80 {"tx_deferred_ok", IXGB_STAT(stats.dc)},
81 {"tx_timeout_count", IXGB_STAT(tx_timeout_count) },
79 {"rx_long_length_errors", IXGB_STAT(stats.roc)}, 82 {"rx_long_length_errors", IXGB_STAT(stats.roc)},
80 {"rx_short_length_errors", IXGB_STAT(stats.ruc)}, 83 {"rx_short_length_errors", IXGB_STAT(stats.ruc)},
81#ifdef NETIF_F_TSO 84#ifdef NETIF_F_TSO
@@ -117,6 +120,16 @@ ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
117 return 0; 120 return 0;
118} 121}
119 122
123static void ixgb_set_speed_duplex(struct net_device *netdev)
124{
125 struct ixgb_adapter *adapter = netdev_priv(netdev);
126 /* be optimistic about our link, since we were up before */
127 adapter->link_speed = 10000;
128 adapter->link_duplex = FULL_DUPLEX;
129 netif_carrier_on(netdev);
130 netif_wake_queue(netdev);
131}
132
120static int 133static int
121ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) 134ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
122{ 135{
@@ -130,12 +143,7 @@ ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
130 ixgb_down(adapter, TRUE); 143 ixgb_down(adapter, TRUE);
131 ixgb_reset(adapter); 144 ixgb_reset(adapter);
132 ixgb_up(adapter); 145 ixgb_up(adapter);
133 /* be optimistic about our link, since we were up before */ 146 ixgb_set_speed_duplex(netdev);
134 adapter->link_speed = 10000;
135 adapter->link_duplex = FULL_DUPLEX;
136 netif_carrier_on(netdev);
137 netif_wake_queue(netdev);
138
139 } else 147 } else
140 ixgb_reset(adapter); 148 ixgb_reset(adapter);
141 149
@@ -183,11 +191,7 @@ ixgb_set_pauseparam(struct net_device *netdev,
183 if(netif_running(adapter->netdev)) { 191 if(netif_running(adapter->netdev)) {
184 ixgb_down(adapter, TRUE); 192 ixgb_down(adapter, TRUE);
185 ixgb_up(adapter); 193 ixgb_up(adapter);
186 /* be optimistic about our link, since we were up before */ 194 ixgb_set_speed_duplex(netdev);
187 adapter->link_speed = 10000;
188 adapter->link_duplex = FULL_DUPLEX;
189 netif_carrier_on(netdev);
190 netif_wake_queue(netdev);
191 } else 195 } else
192 ixgb_reset(adapter); 196 ixgb_reset(adapter);
193 197
@@ -212,11 +216,7 @@ ixgb_set_rx_csum(struct net_device *netdev, uint32_t data)
212 if(netif_running(netdev)) { 216 if(netif_running(netdev)) {
213 ixgb_down(adapter,TRUE); 217 ixgb_down(adapter,TRUE);
214 ixgb_up(adapter); 218 ixgb_up(adapter);
215 /* be optimistic about our link, since we were up before */ 219 ixgb_set_speed_duplex(netdev);
216 adapter->link_speed = 10000;
217 adapter->link_duplex = FULL_DUPLEX;
218 netif_carrier_on(netdev);
219 netif_wake_queue(netdev);
220 } else 220 } else
221 ixgb_reset(adapter); 221 ixgb_reset(adapter);
222 return 0; 222 return 0;
@@ -251,6 +251,19 @@ ixgb_set_tso(struct net_device *netdev, uint32_t data)
251} 251}
252#endif /* NETIF_F_TSO */ 252#endif /* NETIF_F_TSO */
253 253
254static uint32_t
255ixgb_get_msglevel(struct net_device *netdev)
256{
257 struct ixgb_adapter *adapter = netdev_priv(netdev);
258 return adapter->msg_enable;
259}
260
261static void
262ixgb_set_msglevel(struct net_device *netdev, uint32_t data)
263{
264 struct ixgb_adapter *adapter = netdev_priv(netdev);
265 adapter->msg_enable = data;
266}
254#define IXGB_GET_STAT(_A_, _R_) _A_->stats._R_ 267#define IXGB_GET_STAT(_A_, _R_) _A_->stats._R_
255 268
256static int 269static int
@@ -303,7 +316,7 @@ ixgb_get_regs(struct net_device *netdev,
303 *reg++ = IXGB_READ_REG(hw, RXCSUM); /* 20 */ 316 *reg++ = IXGB_READ_REG(hw, RXCSUM); /* 20 */
304 317
305 /* there are 16 RAR entries in hardware, we only use 3 */ 318 /* there are 16 RAR entries in hardware, we only use 3 */
306 for(i = 0; i < 16; i++) { 319 for(i = 0; i < IXGB_ALL_RAR_ENTRIES; i++) {
307 *reg++ = IXGB_READ_REG_ARRAY(hw, RAL, (i << 1)); /*21,...,51 */ 320 *reg++ = IXGB_READ_REG_ARRAY(hw, RAL, (i << 1)); /*21,...,51 */
308 *reg++ = IXGB_READ_REG_ARRAY(hw, RAH, (i << 1)); /*22,...,52 */ 321 *reg++ = IXGB_READ_REG_ARRAY(hw, RAH, (i << 1)); /*22,...,52 */
309 } 322 }
@@ -593,11 +606,7 @@ ixgb_set_ringparam(struct net_device *netdev,
593 adapter->tx_ring = tx_new; 606 adapter->tx_ring = tx_new;
594 if((err = ixgb_up(adapter))) 607 if((err = ixgb_up(adapter)))
595 return err; 608 return err;
596 /* be optimistic about our link, since we were up before */ 609 ixgb_set_speed_duplex(netdev);
597 adapter->link_speed = 10000;
598 adapter->link_duplex = FULL_DUPLEX;
599 netif_carrier_on(netdev);
600 netif_wake_queue(netdev);
601 } 610 }
602 611
603 return 0; 612 return 0;
@@ -714,6 +723,8 @@ static struct ethtool_ops ixgb_ethtool_ops = {
714 .set_tx_csum = ixgb_set_tx_csum, 723 .set_tx_csum = ixgb_set_tx_csum,
715 .get_sg = ethtool_op_get_sg, 724 .get_sg = ethtool_op_get_sg,
716 .set_sg = ethtool_op_set_sg, 725 .set_sg = ethtool_op_set_sg,
726 .get_msglevel = ixgb_get_msglevel,
727 .set_msglevel = ixgb_set_msglevel,
717#ifdef NETIF_F_TSO 728#ifdef NETIF_F_TSO
718 .get_tso = ethtool_op_get_tso, 729 .get_tso = ethtool_op_get_tso,
719 .set_tso = ixgb_set_tso, 730 .set_tso = ixgb_set_tso,