aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/niu.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2011-06-08 10:54:04 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-09 02:26:33 -0400
commit1a7a10325d370e2cbed0c5bb7313904545f6dac8 (patch)
tree7db1fdfb5e03310573645d86b687c65e91ae9523 /drivers/net/niu.c
parentc5f7ef72fcca7602ff8c75682b2a8568ba4e5064 (diff)
niu: support 64 bit stats interface
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/niu.c')
-rw-r--r--drivers/net/niu.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 543eb17acdc5..1c7b790217f9 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -6249,9 +6249,10 @@ static void niu_sync_mac_stats(struct niu *np)
6249 niu_sync_bmac_stats(np); 6249 niu_sync_bmac_stats(np);
6250} 6250}
6251 6251
6252static void niu_get_rx_stats(struct niu *np) 6252static void niu_get_rx_stats(struct niu *np,
6253 struct rtnl_link_stats64 *stats)
6253{ 6254{
6254 unsigned long pkts, dropped, errors, bytes; 6255 u64 pkts, dropped, errors, bytes;
6255 struct rx_ring_info *rx_rings; 6256 struct rx_ring_info *rx_rings;
6256 int i; 6257 int i;
6257 6258
@@ -6273,15 +6274,16 @@ static void niu_get_rx_stats(struct niu *np)
6273 } 6274 }
6274 6275
6275no_rings: 6276no_rings:
6276 np->dev->stats.rx_packets = pkts; 6277 stats->rx_packets = pkts;
6277 np->dev->stats.rx_bytes = bytes; 6278 stats->rx_bytes = bytes;
6278 np->dev->stats.rx_dropped = dropped; 6279 stats->rx_dropped = dropped;
6279 np->dev->stats.rx_errors = errors; 6280 stats->rx_errors = errors;
6280} 6281}
6281 6282
6282static void niu_get_tx_stats(struct niu *np) 6283static void niu_get_tx_stats(struct niu *np,
6284 struct rtnl_link_stats64 *stats)
6283{ 6285{
6284 unsigned long pkts, errors, bytes; 6286 u64 pkts, errors, bytes;
6285 struct tx_ring_info *tx_rings; 6287 struct tx_ring_info *tx_rings;
6286 int i; 6288 int i;
6287 6289
@@ -6300,20 +6302,22 @@ static void niu_get_tx_stats(struct niu *np)
6300 } 6302 }
6301 6303
6302no_rings: 6304no_rings:
6303 np->dev->stats.tx_packets = pkts; 6305 stats->tx_packets = pkts;
6304 np->dev->stats.tx_bytes = bytes; 6306 stats->tx_bytes = bytes;
6305 np->dev->stats.tx_errors = errors; 6307 stats->tx_errors = errors;
6306} 6308}
6307 6309
6308static 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)
6309{ 6312{
6310 struct niu *np = netdev_priv(dev); 6313 struct niu *np = netdev_priv(dev);
6311 6314
6312 if (netif_running(dev)) { 6315 if (netif_running(dev)) {
6313 niu_get_rx_stats(np); 6316 niu_get_rx_stats(np, stats);
6314 niu_get_tx_stats(np); 6317 niu_get_tx_stats(np, stats);
6315 } 6318 }
6316 return &dev->stats; 6319
6320 return stats;
6317} 6321}
6318 6322
6319static void niu_load_hash_xmac(struct niu *np, u16 *hash) 6323static void niu_load_hash_xmac(struct niu *np, u16 *hash)
@@ -9711,7 +9715,7 @@ static const struct net_device_ops niu_netdev_ops = {
9711 .ndo_open = niu_open, 9715 .ndo_open = niu_open,
9712 .ndo_stop = niu_close, 9716 .ndo_stop = niu_close,
9713 .ndo_start_xmit = niu_start_xmit, 9717 .ndo_start_xmit = niu_start_xmit,
9714 .ndo_get_stats = niu_get_stats, 9718 .ndo_get_stats64 = niu_get_stats,
9715 .ndo_set_multicast_list = niu_set_rx_mode, 9719 .ndo_set_multicast_list = niu_set_rx_mode,
9716 .ndo_validate_addr = eth_validate_addr, 9720 .ndo_validate_addr = eth_validate_addr,
9717 .ndo_set_mac_address = niu_set_mac_addr, 9721 .ndo_set_mac_address = niu_set_mac_addr,