diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-05-27 06:34:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-27 18:47:07 -0400 |
commit | 553e2335625e6c96cb6d76c0d63cfc1034747614 (patch) | |
tree | 12a772c1e31b96ee195ee87b5a71e946ae35d03d /drivers/net/via-velocity.c | |
parent | 1ce8e7b57b3a4527ef83da1c5c7bd8a6b9d87b56 (diff) |
net: use netdev stats in b44, sundance, via-rhine and via-velocity
Use struct net_device_stats provided in struct net_device instead of
private ones.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/via-velocity.c')
-rw-r--r-- | drivers/net/via-velocity.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 754a4b182c1d..e2a7725e567e 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1385,7 +1385,7 @@ static void velocity_free_td_ring(struct velocity_info *vptr) | |||
1385 | 1385 | ||
1386 | static int velocity_rx_srv(struct velocity_info *vptr, int status) | 1386 | static int velocity_rx_srv(struct velocity_info *vptr, int status) |
1387 | { | 1387 | { |
1388 | struct net_device_stats *stats = &vptr->stats; | 1388 | struct net_device_stats *stats = &vptr->dev->stats; |
1389 | int rd_curr = vptr->rx.curr; | 1389 | int rd_curr = vptr->rx.curr; |
1390 | int works = 0; | 1390 | int works = 0; |
1391 | 1391 | ||
@@ -1519,7 +1519,7 @@ static inline void velocity_iph_realign(struct velocity_info *vptr, | |||
1519 | static int velocity_receive_frame(struct velocity_info *vptr, int idx) | 1519 | static int velocity_receive_frame(struct velocity_info *vptr, int idx) |
1520 | { | 1520 | { |
1521 | void (*pci_action)(struct pci_dev *, dma_addr_t, size_t, int); | 1521 | void (*pci_action)(struct pci_dev *, dma_addr_t, size_t, int); |
1522 | struct net_device_stats *stats = &vptr->stats; | 1522 | struct net_device_stats *stats = &vptr->dev->stats; |
1523 | struct velocity_rd_info *rd_info = &(vptr->rx.info[idx]); | 1523 | struct velocity_rd_info *rd_info = &(vptr->rx.info[idx]); |
1524 | struct rx_desc *rd = &(vptr->rx.ring[idx]); | 1524 | struct rx_desc *rd = &(vptr->rx.ring[idx]); |
1525 | int pkt_len = le16_to_cpu(rd->rdesc0.len) & 0x3fff; | 1525 | int pkt_len = le16_to_cpu(rd->rdesc0.len) & 0x3fff; |
@@ -1532,7 +1532,7 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx) | |||
1532 | } | 1532 | } |
1533 | 1533 | ||
1534 | if (rd->rdesc0.RSR & RSR_MAR) | 1534 | if (rd->rdesc0.RSR & RSR_MAR) |
1535 | vptr->stats.multicast++; | 1535 | stats->multicast++; |
1536 | 1536 | ||
1537 | skb = rd_info->skb; | 1537 | skb = rd_info->skb; |
1538 | 1538 | ||
@@ -1634,7 +1634,7 @@ static int velocity_tx_srv(struct velocity_info *vptr, u32 status) | |||
1634 | int idx; | 1634 | int idx; |
1635 | int works = 0; | 1635 | int works = 0; |
1636 | struct velocity_td_info *tdinfo; | 1636 | struct velocity_td_info *tdinfo; |
1637 | struct net_device_stats *stats = &vptr->stats; | 1637 | struct net_device_stats *stats = &vptr->dev->stats; |
1638 | 1638 | ||
1639 | for (qnum = 0; qnum < vptr->tx.numq; qnum++) { | 1639 | for (qnum = 0; qnum < vptr->tx.numq; qnum++) { |
1640 | for (idx = vptr->tx.tail[qnum]; vptr->tx.used[qnum] > 0; | 1640 | for (idx = vptr->tx.tail[qnum]; vptr->tx.used[qnum] > 0; |
@@ -2324,22 +2324,22 @@ static struct net_device_stats *velocity_get_stats(struct net_device *dev) | |||
2324 | 2324 | ||
2325 | /* If the hardware is down, don't touch MII */ | 2325 | /* If the hardware is down, don't touch MII */ |
2326 | if(!netif_running(dev)) | 2326 | if(!netif_running(dev)) |
2327 | return &vptr->stats; | 2327 | return &dev->stats; |
2328 | 2328 | ||
2329 | spin_lock_irq(&vptr->lock); | 2329 | spin_lock_irq(&vptr->lock); |
2330 | velocity_update_hw_mibs(vptr); | 2330 | velocity_update_hw_mibs(vptr); |
2331 | spin_unlock_irq(&vptr->lock); | 2331 | spin_unlock_irq(&vptr->lock); |
2332 | 2332 | ||
2333 | vptr->stats.rx_packets = vptr->mib_counter[HW_MIB_ifRxAllPkts]; | 2333 | dev->stats.rx_packets = vptr->mib_counter[HW_MIB_ifRxAllPkts]; |
2334 | vptr->stats.rx_errors = vptr->mib_counter[HW_MIB_ifRxErrorPkts]; | 2334 | dev->stats.rx_errors = vptr->mib_counter[HW_MIB_ifRxErrorPkts]; |
2335 | vptr->stats.rx_length_errors = vptr->mib_counter[HW_MIB_ifInRangeLengthErrors]; | 2335 | dev->stats.rx_length_errors = vptr->mib_counter[HW_MIB_ifInRangeLengthErrors]; |
2336 | 2336 | ||
2337 | // unsigned long rx_dropped; /* no space in linux buffers */ | 2337 | // unsigned long rx_dropped; /* no space in linux buffers */ |
2338 | vptr->stats.collisions = vptr->mib_counter[HW_MIB_ifTxEtherCollisions]; | 2338 | dev->stats.collisions = vptr->mib_counter[HW_MIB_ifTxEtherCollisions]; |
2339 | /* detailed rx_errors: */ | 2339 | /* detailed rx_errors: */ |
2340 | // unsigned long rx_length_errors; | 2340 | // unsigned long rx_length_errors; |
2341 | // unsigned long rx_over_errors; /* receiver ring buff overflow */ | 2341 | // unsigned long rx_over_errors; /* receiver ring buff overflow */ |
2342 | vptr->stats.rx_crc_errors = vptr->mib_counter[HW_MIB_ifRxPktCRCE]; | 2342 | dev->stats.rx_crc_errors = vptr->mib_counter[HW_MIB_ifRxPktCRCE]; |
2343 | // unsigned long rx_frame_errors; /* recv'd frame alignment error */ | 2343 | // unsigned long rx_frame_errors; /* recv'd frame alignment error */ |
2344 | // unsigned long rx_fifo_errors; /* recv'r fifo overrun */ | 2344 | // unsigned long rx_fifo_errors; /* recv'r fifo overrun */ |
2345 | // unsigned long rx_missed_errors; /* receiver missed packet */ | 2345 | // unsigned long rx_missed_errors; /* receiver missed packet */ |
@@ -2347,7 +2347,7 @@ static struct net_device_stats *velocity_get_stats(struct net_device *dev) | |||
2347 | /* detailed tx_errors */ | 2347 | /* detailed tx_errors */ |
2348 | // unsigned long tx_fifo_errors; | 2348 | // unsigned long tx_fifo_errors; |
2349 | 2349 | ||
2350 | return &vptr->stats; | 2350 | return &dev->stats; |
2351 | } | 2351 | } |
2352 | 2352 | ||
2353 | 2353 | ||