aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/niu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/niu.c')
-rw-r--r--drivers/net/niu.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index cc25bff0bd3b..1c7b790217f9 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -7,6 +7,7 @@
7 7
8#include <linux/module.h> 8#include <linux/module.h>
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/interrupt.h>
10#include <linux/pci.h> 11#include <linux/pci.h>
11#include <linux/dma-mapping.h> 12#include <linux/dma-mapping.h>
12#include <linux/netdevice.h> 13#include <linux/netdevice.h>
@@ -6248,9 +6249,10 @@ static void niu_sync_mac_stats(struct niu *np)
6248 niu_sync_bmac_stats(np); 6249 niu_sync_bmac_stats(np);
6249} 6250}
6250 6251
6251static void niu_get_rx_stats(struct niu *np) 6252static void niu_get_rx_stats(struct niu *np,
6253 struct rtnl_link_stats64 *stats)
6252{ 6254{
6253 unsigned long pkts, dropped, errors, bytes; 6255 u64 pkts, dropped, errors, bytes;
6254 struct rx_ring_info *rx_rings; 6256 struct rx_ring_info *rx_rings;
6255 int i; 6257 int i;
6256 6258
@@ -6272,15 +6274,16 @@ static void niu_get_rx_stats(struct niu *np)
6272 } 6274 }
6273 6275
6274no_rings: 6276no_rings:
6275 np->dev->stats.rx_packets = pkts; 6277 stats->rx_packets = pkts;
6276 np->dev->stats.rx_bytes = bytes; 6278 stats->rx_bytes = bytes;
6277 np->dev->stats.rx_dropped = dropped; 6279 stats->rx_dropped = dropped;
6278 np->dev->stats.rx_errors = errors; 6280 stats->rx_errors = errors;
6279} 6281}
6280 6282
6281static void niu_get_tx_stats(struct niu *np) 6283static void niu_get_tx_stats(struct niu *np,
6284 struct rtnl_link_stats64 *stats)
6282{ 6285{
6283 unsigned long pkts, errors, bytes; 6286 u64 pkts, errors, bytes;
6284 struct tx_ring_info *tx_rings; 6287 struct tx_ring_info *tx_rings;
6285 int i; 6288 int i;
6286 6289
@@ -6299,20 +6302,22 @@ static void niu_get_tx_stats(struct niu *np)
6299 } 6302 }
6300 6303
6301no_rings: 6304no_rings:
6302 np->dev->stats.tx_packets = pkts; 6305 stats->tx_packets = pkts;
6303 np->dev->stats.tx_bytes = bytes; 6306 stats->tx_bytes = bytes;
6304 np->dev->stats.tx_errors = errors; 6307 stats->tx_errors = errors;
6305} 6308}
6306 6309
6307static struct net_device_stats *niu_get_stats(struct net_device *dev) 6310static struct rtnl_link_stats64 *niu_get_stats(struct net_device *dev,
6311 struct rtnl_link_stats64 *stats)
6308{ 6312{
6309 struct niu *np = netdev_priv(dev); 6313 struct niu *np = netdev_priv(dev);
6310 6314
6311 if (netif_running(dev)) { 6315 if (netif_running(dev)) {
6312 niu_get_rx_stats(np); 6316 niu_get_rx_stats(np, stats);
6313 niu_get_tx_stats(np); 6317 niu_get_tx_stats(np, stats);
6314 } 6318 }
6315 return &dev->stats; 6319
6320 return stats;
6316} 6321}
6317 6322
6318static void niu_load_hash_xmac(struct niu *np, u16 *hash) 6323static void niu_load_hash_xmac(struct niu *np, u16 *hash)
@@ -9710,7 +9715,7 @@ static const struct net_device_ops niu_netdev_ops = {
9710 .ndo_open = niu_open, 9715 .ndo_open = niu_open,
9711 .ndo_stop = niu_close, 9716 .ndo_stop = niu_close,
9712 .ndo_start_xmit = niu_start_xmit, 9717 .ndo_start_xmit = niu_start_xmit,
9713 .ndo_get_stats = niu_get_stats, 9718 .ndo_get_stats64 = niu_get_stats,
9714 .ndo_set_multicast_list = niu_set_rx_mode, 9719 .ndo_set_multicast_list = niu_set_rx_mode,
9715 .ndo_validate_addr = eth_validate_addr, 9720 .ndo_validate_addr = eth_validate_addr,
9716 .ndo_set_mac_address = niu_set_mac_addr, 9721 .ndo_set_mac_address = niu_set_mac_addr,