Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255466
b: refs/heads/master
c: 1a7a103
h: refs/heads/master
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed Jun 9, 2011
1 parent 7c21ac3 commit f267c5b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c5f7ef72fcca7602ff8c75682b2a8568ba4e5064
refs/heads/master: 1a7a10325d370e2cbed0c5bb7313904545f6dac8
36 changes: 20 additions & 16 deletions trunk/drivers/net/niu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6249,9 +6249,10 @@ static void niu_sync_mac_stats(struct niu *np)
niu_sync_bmac_stats(np);
}

static void niu_get_rx_stats(struct niu *np)
static void niu_get_rx_stats(struct niu *np,
struct rtnl_link_stats64 *stats)
{
unsigned long pkts, dropped, errors, bytes;
u64 pkts, dropped, errors, bytes;
struct rx_ring_info *rx_rings;
int i;

Expand All @@ -6273,15 +6274,16 @@ static void niu_get_rx_stats(struct niu *np)
}

no_rings:
np->dev->stats.rx_packets = pkts;
np->dev->stats.rx_bytes = bytes;
np->dev->stats.rx_dropped = dropped;
np->dev->stats.rx_errors = errors;
stats->rx_packets = pkts;
stats->rx_bytes = bytes;
stats->rx_dropped = dropped;
stats->rx_errors = errors;
}

static void niu_get_tx_stats(struct niu *np)
static void niu_get_tx_stats(struct niu *np,
struct rtnl_link_stats64 *stats)
{
unsigned long pkts, errors, bytes;
u64 pkts, errors, bytes;
struct tx_ring_info *tx_rings;
int i;

Expand All @@ -6300,20 +6302,22 @@ static void niu_get_tx_stats(struct niu *np)
}

no_rings:
np->dev->stats.tx_packets = pkts;
np->dev->stats.tx_bytes = bytes;
np->dev->stats.tx_errors = errors;
stats->tx_packets = pkts;
stats->tx_bytes = bytes;
stats->tx_errors = errors;
}

static struct net_device_stats *niu_get_stats(struct net_device *dev)
static struct rtnl_link_stats64 *niu_get_stats(struct net_device *dev,
struct rtnl_link_stats64 *stats)
{
struct niu *np = netdev_priv(dev);

if (netif_running(dev)) {
niu_get_rx_stats(np);
niu_get_tx_stats(np);
niu_get_rx_stats(np, stats);
niu_get_tx_stats(np, stats);
}
return &dev->stats;

return stats;
}

static void niu_load_hash_xmac(struct niu *np, u16 *hash)
Expand Down Expand Up @@ -9711,7 +9715,7 @@ static const struct net_device_ops niu_netdev_ops = {
.ndo_open = niu_open,
.ndo_stop = niu_close,
.ndo_start_xmit = niu_start_xmit,
.ndo_get_stats = niu_get_stats,
.ndo_get_stats64 = niu_get_stats,
.ndo_set_multicast_list = niu_set_rx_mode,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = niu_set_mac_addr,
Expand Down

0 comments on commit f267c5b

Please sign in to comment.