aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-05-27 06:34:50 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-27 18:47:07 -0400
commit553e2335625e6c96cb6d76c0d63cfc1034747614 (patch)
tree12a772c1e31b96ee195ee87b5a71e946ae35d03d /drivers
parent1ce8e7b57b3a4527ef83da1c5c7bd8a6b9d87b56 (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')
-rw-r--r--drivers/net/b44.c4
-rw-r--r--drivers/net/b44.h1
-rw-r--r--drivers/net/sundance.c53
-rw-r--r--drivers/net/via-rhine.c58
-rw-r--r--drivers/net/via-velocity.c22
-rw-r--r--drivers/net/via-velocity.h1
6 files changed, 73 insertions, 66 deletions
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index b70b81ec34c3..36d4d377ec2f 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -782,7 +782,7 @@ static int b44_rx(struct b44 *bp, int budget)
782 drop_it: 782 drop_it:
783 b44_recycle_rx(bp, cons, bp->rx_prod); 783 b44_recycle_rx(bp, cons, bp->rx_prod);
784 drop_it_no_recycle: 784 drop_it_no_recycle:
785 bp->stats.rx_dropped++; 785 bp->dev->stats.rx_dropped++;
786 goto next_pkt; 786 goto next_pkt;
787 } 787 }
788 788
@@ -1647,7 +1647,7 @@ static int b44_close(struct net_device *dev)
1647static struct net_device_stats *b44_get_stats(struct net_device *dev) 1647static struct net_device_stats *b44_get_stats(struct net_device *dev)
1648{ 1648{
1649 struct b44 *bp = netdev_priv(dev); 1649 struct b44 *bp = netdev_priv(dev);
1650 struct net_device_stats *nstat = &bp->stats; 1650 struct net_device_stats *nstat = &dev->stats;
1651 struct b44_hw_stats *hwstat = &bp->hw_stats; 1651 struct b44_hw_stats *hwstat = &bp->hw_stats;
1652 1652
1653 /* Convert HW stats into netdevice stats. */ 1653 /* Convert HW stats into netdevice stats. */
diff --git a/drivers/net/b44.h b/drivers/net/b44.h
index e678498de6db..0443f6801f60 100644
--- a/drivers/net/b44.h
+++ b/drivers/net/b44.h
@@ -384,7 +384,6 @@ struct b44 {
384 384
385 struct timer_list timer; 385 struct timer_list timer;
386 386
387 struct net_device_stats stats;
388 struct b44_hw_stats hw_stats; 387 struct b44_hw_stats hw_stats;
389 388
390 struct ssb_device *sdev; 389 struct ssb_device *sdev;
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index c399b1955c1e..545f81b34ad7 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -369,7 +369,6 @@ struct netdev_private {
369 struct sk_buff* tx_skbuff[TX_RING_SIZE]; 369 struct sk_buff* tx_skbuff[TX_RING_SIZE];
370 dma_addr_t tx_ring_dma; 370 dma_addr_t tx_ring_dma;
371 dma_addr_t rx_ring_dma; 371 dma_addr_t rx_ring_dma;
372 struct net_device_stats stats;
373 struct timer_list timer; /* Media monitoring timer. */ 372 struct timer_list timer; /* Media monitoring timer. */
374 /* Frequently used values: keep some adjacent for cache effect. */ 373 /* Frequently used values: keep some adjacent for cache effect. */
375 spinlock_t lock; 374 spinlock_t lock;
@@ -975,7 +974,7 @@ static void tx_timeout(struct net_device *dev)
975 dev->if_port = 0; 974 dev->if_port = 0;
976 975
977 dev->trans_start = jiffies; 976 dev->trans_start = jiffies;
978 np->stats.tx_errors++; 977 dev->stats.tx_errors++;
979 if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) { 978 if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) {
980 netif_wake_queue(dev); 979 netif_wake_queue(dev);
981 } 980 }
@@ -1123,7 +1122,7 @@ reset_tx (struct net_device *dev)
1123 else 1122 else
1124 dev_kfree_skb (skb); 1123 dev_kfree_skb (skb);
1125 np->tx_skbuff[i] = NULL; 1124 np->tx_skbuff[i] = NULL;
1126 np->stats.tx_dropped++; 1125 dev->stats.tx_dropped++;
1127 } 1126 }
1128 } 1127 }
1129 np->cur_tx = np->dirty_tx = 0; 1128 np->cur_tx = np->dirty_tx = 0;
@@ -1181,15 +1180,15 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
1181 if (netif_msg_tx_err(np)) 1180 if (netif_msg_tx_err(np))
1182 printk("%s: Transmit error status %4.4x.\n", 1181 printk("%s: Transmit error status %4.4x.\n",
1183 dev->name, tx_status); 1182 dev->name, tx_status);
1184 np->stats.tx_errors++; 1183 dev->stats.tx_errors++;
1185 if (tx_status & 0x10) 1184 if (tx_status & 0x10)
1186 np->stats.tx_fifo_errors++; 1185 dev->stats.tx_fifo_errors++;
1187 if (tx_status & 0x08) 1186 if (tx_status & 0x08)
1188 np->stats.collisions++; 1187 dev->stats.collisions++;
1189 if (tx_status & 0x04) 1188 if (tx_status & 0x04)
1190 np->stats.tx_fifo_errors++; 1189 dev->stats.tx_fifo_errors++;
1191 if (tx_status & 0x02) 1190 if (tx_status & 0x02)
1192 np->stats.tx_window_errors++; 1191 dev->stats.tx_window_errors++;
1193 1192
1194 /* 1193 /*
1195 ** This reset has been verified on 1194 ** This reset has been verified on
@@ -1313,11 +1312,15 @@ static void rx_poll(unsigned long data)
1313 if (netif_msg_rx_err(np)) 1312 if (netif_msg_rx_err(np))
1314 printk(KERN_DEBUG " netdev_rx() Rx error was %8.8x.\n", 1313 printk(KERN_DEBUG " netdev_rx() Rx error was %8.8x.\n",
1315 frame_status); 1314 frame_status);
1316 np->stats.rx_errors++; 1315 dev->stats.rx_errors++;
1317 if (frame_status & 0x00100000) np->stats.rx_length_errors++; 1316 if (frame_status & 0x00100000)
1318 if (frame_status & 0x00010000) np->stats.rx_fifo_errors++; 1317 dev->stats.rx_length_errors++;
1319 if (frame_status & 0x00060000) np->stats.rx_frame_errors++; 1318 if (frame_status & 0x00010000)
1320 if (frame_status & 0x00080000) np->stats.rx_crc_errors++; 1319 dev->stats.rx_fifo_errors++;
1320 if (frame_status & 0x00060000)
1321 dev->stats.rx_frame_errors++;
1322 if (frame_status & 0x00080000)
1323 dev->stats.rx_crc_errors++;
1321 if (frame_status & 0x00100000) { 1324 if (frame_status & 0x00100000) {
1322 printk(KERN_WARNING "%s: Oversized Ethernet frame," 1325 printk(KERN_WARNING "%s: Oversized Ethernet frame,"
1323 " status %8.8x.\n", 1326 " status %8.8x.\n",
@@ -1485,22 +1488,22 @@ static struct net_device_stats *get_stats(struct net_device *dev)
1485 the vulnerability window is very small and statistics are 1488 the vulnerability window is very small and statistics are
1486 non-critical. */ 1489 non-critical. */
1487 /* The chip only need report frame silently dropped. */ 1490 /* The chip only need report frame silently dropped. */
1488 np->stats.rx_missed_errors += ioread8(ioaddr + RxMissed); 1491 dev->stats.rx_missed_errors += ioread8(ioaddr + RxMissed);
1489 np->stats.tx_packets += ioread16(ioaddr + TxFramesOK); 1492 dev->stats.tx_packets += ioread16(ioaddr + TxFramesOK);
1490 np->stats.rx_packets += ioread16(ioaddr + RxFramesOK); 1493 dev->stats.rx_packets += ioread16(ioaddr + RxFramesOK);
1491 np->stats.collisions += ioread8(ioaddr + StatsLateColl); 1494 dev->stats.collisions += ioread8(ioaddr + StatsLateColl);
1492 np->stats.collisions += ioread8(ioaddr + StatsMultiColl); 1495 dev->stats.collisions += ioread8(ioaddr + StatsMultiColl);
1493 np->stats.collisions += ioread8(ioaddr + StatsOneColl); 1496 dev->stats.collisions += ioread8(ioaddr + StatsOneColl);
1494 np->stats.tx_carrier_errors += ioread8(ioaddr + StatsCarrierError); 1497 dev->stats.tx_carrier_errors += ioread8(ioaddr + StatsCarrierError);
1495 ioread8(ioaddr + StatsTxDefer); 1498 ioread8(ioaddr + StatsTxDefer);
1496 for (i = StatsTxDefer; i <= StatsMcastRx; i++) 1499 for (i = StatsTxDefer; i <= StatsMcastRx; i++)
1497 ioread8(ioaddr + i); 1500 ioread8(ioaddr + i);
1498 np->stats.tx_bytes += ioread16(ioaddr + TxOctetsLow); 1501 dev->stats.tx_bytes += ioread16(ioaddr + TxOctetsLow);
1499 np->stats.tx_bytes += ioread16(ioaddr + TxOctetsHigh) << 16; 1502 dev->stats.tx_bytes += ioread16(ioaddr + TxOctetsHigh) << 16;
1500 np->stats.rx_bytes += ioread16(ioaddr + RxOctetsLow); 1503 dev->stats.rx_bytes += ioread16(ioaddr + RxOctetsLow);
1501 np->stats.rx_bytes += ioread16(ioaddr + RxOctetsHigh) << 16; 1504 dev->stats.rx_bytes += ioread16(ioaddr + RxOctetsHigh) << 16;
1502 1505
1503 return &np->stats; 1506 return &dev->stats;
1504} 1507}
1505 1508
1506static void set_rx_mode(struct net_device *dev) 1509static void set_rx_mode(struct net_device *dev)
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 45daba726b66..d3489a3c4c03 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -388,7 +388,6 @@ struct rhine_private {
388 long pioaddr; 388 long pioaddr;
389 struct net_device *dev; 389 struct net_device *dev;
390 struct napi_struct napi; 390 struct napi_struct napi;
391 struct net_device_stats stats;
392 spinlock_t lock; 391 spinlock_t lock;
393 392
394 /* Frequently used values: keep some adjacent for cache effect. */ 393 /* Frequently used values: keep some adjacent for cache effect. */
@@ -1209,7 +1208,7 @@ static void rhine_tx_timeout(struct net_device *dev)
1209 enable_irq(rp->pdev->irq); 1208 enable_irq(rp->pdev->irq);
1210 1209
1211 dev->trans_start = jiffies; 1210 dev->trans_start = jiffies;
1212 rp->stats.tx_errors++; 1211 dev->stats.tx_errors++;
1213 netif_wake_queue(dev); 1212 netif_wake_queue(dev);
1214} 1213}
1215 1214
@@ -1237,7 +1236,7 @@ static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
1237 /* packet too long, drop it */ 1236 /* packet too long, drop it */
1238 dev_kfree_skb(skb); 1237 dev_kfree_skb(skb);
1239 rp->tx_skbuff[entry] = NULL; 1238 rp->tx_skbuff[entry] = NULL;
1240 rp->stats.tx_dropped++; 1239 dev->stats.tx_dropped++;
1241 return 0; 1240 return 0;
1242 } 1241 }
1243 1242
@@ -1378,29 +1377,33 @@ static void rhine_tx(struct net_device *dev)
1378 printk(KERN_DEBUG "%s: Transmit error, " 1377 printk(KERN_DEBUG "%s: Transmit error, "
1379 "Tx status %8.8x.\n", 1378 "Tx status %8.8x.\n",
1380 dev->name, txstatus); 1379 dev->name, txstatus);
1381 rp->stats.tx_errors++; 1380 dev->stats.tx_errors++;
1382 if (txstatus & 0x0400) rp->stats.tx_carrier_errors++; 1381 if (txstatus & 0x0400)
1383 if (txstatus & 0x0200) rp->stats.tx_window_errors++; 1382 dev->stats.tx_carrier_errors++;
1384 if (txstatus & 0x0100) rp->stats.tx_aborted_errors++; 1383 if (txstatus & 0x0200)
1385 if (txstatus & 0x0080) rp->stats.tx_heartbeat_errors++; 1384 dev->stats.tx_window_errors++;
1385 if (txstatus & 0x0100)
1386 dev->stats.tx_aborted_errors++;
1387 if (txstatus & 0x0080)
1388 dev->stats.tx_heartbeat_errors++;
1386 if (((rp->quirks & rqRhineI) && txstatus & 0x0002) || 1389 if (((rp->quirks & rqRhineI) && txstatus & 0x0002) ||
1387 (txstatus & 0x0800) || (txstatus & 0x1000)) { 1390 (txstatus & 0x0800) || (txstatus & 0x1000)) {
1388 rp->stats.tx_fifo_errors++; 1391 dev->stats.tx_fifo_errors++;
1389 rp->tx_ring[entry].tx_status = cpu_to_le32(DescOwn); 1392 rp->tx_ring[entry].tx_status = cpu_to_le32(DescOwn);
1390 break; /* Keep the skb - we try again */ 1393 break; /* Keep the skb - we try again */
1391 } 1394 }
1392 /* Transmitter restarted in 'abnormal' handler. */ 1395 /* Transmitter restarted in 'abnormal' handler. */
1393 } else { 1396 } else {
1394 if (rp->quirks & rqRhineI) 1397 if (rp->quirks & rqRhineI)
1395 rp->stats.collisions += (txstatus >> 3) & 0x0F; 1398 dev->stats.collisions += (txstatus >> 3) & 0x0F;
1396 else 1399 else
1397 rp->stats.collisions += txstatus & 0x0F; 1400 dev->stats.collisions += txstatus & 0x0F;
1398 if (debug > 6) 1401 if (debug > 6)
1399 printk(KERN_DEBUG "collisions: %1.1x:%1.1x\n", 1402 printk(KERN_DEBUG "collisions: %1.1x:%1.1x\n",
1400 (txstatus >> 3) & 0xF, 1403 (txstatus >> 3) & 0xF,
1401 txstatus & 0xF); 1404 txstatus & 0xF);
1402 rp->stats.tx_bytes += rp->tx_skbuff[entry]->len; 1405 dev->stats.tx_bytes += rp->tx_skbuff[entry]->len;
1403 rp->stats.tx_packets++; 1406 dev->stats.tx_packets++;
1404 } 1407 }
1405 /* Free the original skb. */ 1408 /* Free the original skb. */
1406 if (rp->tx_skbuff_dma[entry]) { 1409 if (rp->tx_skbuff_dma[entry]) {
@@ -1455,21 +1458,24 @@ static int rhine_rx(struct net_device *dev, int limit)
1455 printk(KERN_WARNING "%s: Oversized Ethernet " 1458 printk(KERN_WARNING "%s: Oversized Ethernet "
1456 "frame %p vs %p.\n", dev->name, 1459 "frame %p vs %p.\n", dev->name,
1457 rp->rx_head_desc, &rp->rx_ring[entry]); 1460 rp->rx_head_desc, &rp->rx_ring[entry]);
1458 rp->stats.rx_length_errors++; 1461 dev->stats.rx_length_errors++;
1459 } else if (desc_status & RxErr) { 1462 } else if (desc_status & RxErr) {
1460 /* There was a error. */ 1463 /* There was a error. */
1461 if (debug > 2) 1464 if (debug > 2)
1462 printk(KERN_DEBUG "rhine_rx() Rx " 1465 printk(KERN_DEBUG "rhine_rx() Rx "
1463 "error was %8.8x.\n", 1466 "error was %8.8x.\n",
1464 desc_status); 1467 desc_status);
1465 rp->stats.rx_errors++; 1468 dev->stats.rx_errors++;
1466 if (desc_status & 0x0030) rp->stats.rx_length_errors++; 1469 if (desc_status & 0x0030)
1467 if (desc_status & 0x0048) rp->stats.rx_fifo_errors++; 1470 dev->stats.rx_length_errors++;
1468 if (desc_status & 0x0004) rp->stats.rx_frame_errors++; 1471 if (desc_status & 0x0048)
1472 dev->stats.rx_fifo_errors++;
1473 if (desc_status & 0x0004)
1474 dev->stats.rx_frame_errors++;
1469 if (desc_status & 0x0002) { 1475 if (desc_status & 0x0002) {
1470 /* this can also be updated outside the interrupt handler */ 1476 /* this can also be updated outside the interrupt handler */
1471 spin_lock(&rp->lock); 1477 spin_lock(&rp->lock);
1472 rp->stats.rx_crc_errors++; 1478 dev->stats.rx_crc_errors++;
1473 spin_unlock(&rp->lock); 1479 spin_unlock(&rp->lock);
1474 } 1480 }
1475 } 1481 }
@@ -1513,8 +1519,8 @@ static int rhine_rx(struct net_device *dev, int limit)
1513 } 1519 }
1514 skb->protocol = eth_type_trans(skb, dev); 1520 skb->protocol = eth_type_trans(skb, dev);
1515 netif_receive_skb(skb); 1521 netif_receive_skb(skb);
1516 rp->stats.rx_bytes += pkt_len; 1522 dev->stats.rx_bytes += pkt_len;
1517 rp->stats.rx_packets++; 1523 dev->stats.rx_packets++;
1518 } 1524 }
1519 entry = (++rp->cur_rx) % RX_RING_SIZE; 1525 entry = (++rp->cur_rx) % RX_RING_SIZE;
1520 rp->rx_head_desc = &rp->rx_ring[entry]; 1526 rp->rx_head_desc = &rp->rx_ring[entry];
@@ -1599,8 +1605,8 @@ static void rhine_error(struct net_device *dev, int intr_status)
1599 if (intr_status & IntrLinkChange) 1605 if (intr_status & IntrLinkChange)
1600 rhine_check_media(dev, 0); 1606 rhine_check_media(dev, 0);
1601 if (intr_status & IntrStatsMax) { 1607 if (intr_status & IntrStatsMax) {
1602 rp->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs); 1608 dev->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs);
1603 rp->stats.rx_missed_errors += ioread16(ioaddr + RxMissed); 1609 dev->stats.rx_missed_errors += ioread16(ioaddr + RxMissed);
1604 clear_tally_counters(ioaddr); 1610 clear_tally_counters(ioaddr);
1605 } 1611 }
1606 if (intr_status & IntrTxAborted) { 1612 if (intr_status & IntrTxAborted) {
@@ -1654,12 +1660,12 @@ static struct net_device_stats *rhine_get_stats(struct net_device *dev)
1654 unsigned long flags; 1660 unsigned long flags;
1655 1661
1656 spin_lock_irqsave(&rp->lock, flags); 1662 spin_lock_irqsave(&rp->lock, flags);
1657 rp->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs); 1663 dev->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs);
1658 rp->stats.rx_missed_errors += ioread16(ioaddr + RxMissed); 1664 dev->stats.rx_missed_errors += ioread16(ioaddr + RxMissed);
1659 clear_tally_counters(ioaddr); 1665 clear_tally_counters(ioaddr);
1660 spin_unlock_irqrestore(&rp->lock, flags); 1666 spin_unlock_irqrestore(&rp->lock, flags);
1661 1667
1662 return &rp->stats; 1668 return &dev->stats;
1663} 1669}
1664 1670
1665static void rhine_set_rx_mode(struct net_device *dev) 1671static void rhine_set_rx_mode(struct net_device *dev)
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
1386static int velocity_rx_srv(struct velocity_info *vptr, int status) 1386static 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,
1519static int velocity_receive_frame(struct velocity_info *vptr, int idx) 1519static 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
diff --git a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h
index ea43e1832afb..4cd3f6c97379 100644
--- a/drivers/net/via-velocity.h
+++ b/drivers/net/via-velocity.h
@@ -1503,7 +1503,6 @@ struct velocity_info {
1503 1503
1504 struct pci_dev *pdev; 1504 struct pci_dev *pdev;
1505 struct net_device *dev; 1505 struct net_device *dev;
1506 struct net_device_stats stats;
1507 1506
1508 struct vlan_group *vlgrp; 1507 struct vlan_group *vlgrp;
1509 u8 ip_addr[4]; 1508 u8 ip_addr[4];