aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ns83820.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index e88e97cd1b10..5a3488f76b38 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -424,7 +424,6 @@ struct rx_info {
424 424
425 425
426struct ns83820 { 426struct ns83820 {
427 struct net_device_stats stats;
428 u8 __iomem *base; 427 u8 __iomem *base;
429 428
430 struct pci_dev *pci_dev; 429 struct pci_dev *pci_dev;
@@ -918,9 +917,9 @@ static void rx_irq(struct net_device *ndev)
918 if (unlikely(!skb)) 917 if (unlikely(!skb))
919 goto netdev_mangle_me_harder_failed; 918 goto netdev_mangle_me_harder_failed;
920 if (cmdsts & CMDSTS_DEST_MULTI) 919 if (cmdsts & CMDSTS_DEST_MULTI)
921 dev->stats.multicast ++; 920 ndev->stats.multicast++;
922 dev->stats.rx_packets ++; 921 ndev->stats.rx_packets++;
923 dev->stats.rx_bytes += len; 922 ndev->stats.rx_bytes += len;
924 if ((extsts & 0x002a0000) && !(extsts & 0x00540000)) { 923 if ((extsts & 0x002a0000) && !(extsts & 0x00540000)) {
925 skb->ip_summed = CHECKSUM_UNNECESSARY; 924 skb->ip_summed = CHECKSUM_UNNECESSARY;
926 } else { 925 } else {
@@ -940,7 +939,7 @@ static void rx_irq(struct net_device *ndev)
940#endif 939#endif
941 if (NET_RX_DROP == rx_rc) { 940 if (NET_RX_DROP == rx_rc) {
942netdev_mangle_me_harder_failed: 941netdev_mangle_me_harder_failed:
943 dev->stats.rx_dropped ++; 942 ndev->stats.rx_dropped++;
944 } 943 }
945 } else { 944 } else {
946 kfree_skb(skb); 945 kfree_skb(skb);
@@ -1008,11 +1007,11 @@ static void do_tx_done(struct net_device *ndev)
1008 dma_addr_t addr; 1007 dma_addr_t addr;
1009 1008
1010 if (cmdsts & CMDSTS_ERR) 1009 if (cmdsts & CMDSTS_ERR)
1011 dev->stats.tx_errors ++; 1010 ndev->stats.tx_errors++;
1012 if (cmdsts & CMDSTS_OK) 1011 if (cmdsts & CMDSTS_OK)
1013 dev->stats.tx_packets ++; 1012 ndev->stats.tx_packets++;
1014 if (cmdsts & CMDSTS_OK) 1013 if (cmdsts & CMDSTS_OK)
1015 dev->stats.tx_bytes += cmdsts & 0xffff; 1014 ndev->stats.tx_bytes += cmdsts & 0xffff;
1016 1015
1017 dprintk("tx_done_idx=%d free_idx=%d cmdsts=%08x\n", 1016 dprintk("tx_done_idx=%d free_idx=%d cmdsts=%08x\n",
1018 tx_done_idx, dev->tx_free_idx, cmdsts); 1017 tx_done_idx, dev->tx_free_idx, cmdsts);
@@ -1212,20 +1211,21 @@ again:
1212 1211
1213static void ns83820_update_stats(struct ns83820 *dev) 1212static void ns83820_update_stats(struct ns83820 *dev)
1214{ 1213{
1214 struct net_device *ndev = dev->ndev;
1215 u8 __iomem *base = dev->base; 1215 u8 __iomem *base = dev->base;
1216 1216
1217 /* the DP83820 will freeze counters, so we need to read all of them */ 1217 /* the DP83820 will freeze counters, so we need to read all of them */
1218 dev->stats.rx_errors += readl(base + 0x60) & 0xffff; 1218 ndev->stats.rx_errors += readl(base + 0x60) & 0xffff;
1219 dev->stats.rx_crc_errors += readl(base + 0x64) & 0xffff; 1219 ndev->stats.rx_crc_errors += readl(base + 0x64) & 0xffff;
1220 dev->stats.rx_missed_errors += readl(base + 0x68) & 0xffff; 1220 ndev->stats.rx_missed_errors += readl(base + 0x68) & 0xffff;
1221 dev->stats.rx_frame_errors += readl(base + 0x6c) & 0xffff; 1221 ndev->stats.rx_frame_errors += readl(base + 0x6c) & 0xffff;
1222 /*dev->stats.rx_symbol_errors +=*/ readl(base + 0x70); 1222 /*ndev->stats.rx_symbol_errors +=*/ readl(base + 0x70);
1223 dev->stats.rx_length_errors += readl(base + 0x74) & 0xffff; 1223 ndev->stats.rx_length_errors += readl(base + 0x74) & 0xffff;
1224 dev->stats.rx_length_errors += readl(base + 0x78) & 0xffff; 1224 ndev->stats.rx_length_errors += readl(base + 0x78) & 0xffff;
1225 /*dev->stats.rx_badopcode_errors += */ readl(base + 0x7c); 1225 /*ndev->stats.rx_badopcode_errors += */ readl(base + 0x7c);
1226 /*dev->stats.rx_pause_count += */ readl(base + 0x80); 1226 /*ndev->stats.rx_pause_count += */ readl(base + 0x80);
1227 /*dev->stats.tx_pause_count += */ readl(base + 0x84); 1227 /*ndev->stats.tx_pause_count += */ readl(base + 0x84);
1228 dev->stats.tx_carrier_errors += readl(base + 0x88) & 0xff; 1228 ndev->stats.tx_carrier_errors += readl(base + 0x88) & 0xff;
1229} 1229}
1230 1230
1231static struct net_device_stats *ns83820_get_stats(struct net_device *ndev) 1231static struct net_device_stats *ns83820_get_stats(struct net_device *ndev)
@@ -1237,7 +1237,7 @@ static struct net_device_stats *ns83820_get_stats(struct net_device *ndev)
1237 ns83820_update_stats(dev); 1237 ns83820_update_stats(dev);
1238 spin_unlock_irq(&dev->misc_lock); 1238 spin_unlock_irq(&dev->misc_lock);
1239 1239
1240 return &dev->stats; 1240 return &ndev->stats;
1241} 1241}
1242 1242
1243/* Let ethtool retrieve info */ 1243/* Let ethtool retrieve info */
@@ -1464,12 +1464,12 @@ static void ns83820_do_isr(struct net_device *ndev, u32 isr)
1464 1464
1465 if (unlikely(ISR_RXSOVR & isr)) { 1465 if (unlikely(ISR_RXSOVR & isr)) {
1466 //printk("overrun: rxsovr\n"); 1466 //printk("overrun: rxsovr\n");
1467 dev->stats.rx_fifo_errors ++; 1467 ndev->stats.rx_fifo_errors++;
1468 } 1468 }
1469 1469
1470 if (unlikely(ISR_RXORN & isr)) { 1470 if (unlikely(ISR_RXORN & isr)) {
1471 //printk("overrun: rxorn\n"); 1471 //printk("overrun: rxorn\n");
1472 dev->stats.rx_fifo_errors ++; 1472 ndev->stats.rx_fifo_errors++;
1473 } 1473 }
1474 1474
1475 if ((ISR_RXRCMP & isr) && dev->rx_info.up) 1475 if ((ISR_RXRCMP & isr) && dev->rx_info.up)