diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-04 22:14:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-05 22:41:15 -0400 |
commit | 86678a2018135e57df86a9729795bce1efea641d (patch) | |
tree | 1d00e43f8f56dcb470ae9a6d4b1e19e27901c000 /drivers | |
parent | 0b9be50b3b66c7940b151dac8b80aaf138804226 (diff) |
starfire: Use the instance of net_device_stats from net_device.
Since net_device has an instance of net_device_stats,
we can remove the instance of this from the adapter structure.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/starfire.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index 74b7ae76906e..a42b6873370b 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -562,7 +562,6 @@ struct netdev_private { | |||
562 | unsigned int tx_done; | 562 | unsigned int tx_done; |
563 | struct napi_struct napi; | 563 | struct napi_struct napi; |
564 | struct net_device *dev; | 564 | struct net_device *dev; |
565 | struct net_device_stats stats; | ||
566 | struct pci_dev *pci_dev; | 565 | struct pci_dev *pci_dev; |
567 | #ifdef VLAN_SUPPORT | 566 | #ifdef VLAN_SUPPORT |
568 | struct vlan_group *vlgrp; | 567 | struct vlan_group *vlgrp; |
@@ -1174,7 +1173,7 @@ static void tx_timeout(struct net_device *dev) | |||
1174 | /* Trigger an immediate transmit demand. */ | 1173 | /* Trigger an immediate transmit demand. */ |
1175 | 1174 | ||
1176 | dev->trans_start = jiffies; /* prevent tx timeout */ | 1175 | dev->trans_start = jiffies; /* prevent tx timeout */ |
1177 | np->stats.tx_errors++; | 1176 | dev->stats.tx_errors++; |
1178 | netif_wake_queue(dev); | 1177 | netif_wake_queue(dev); |
1179 | } | 1178 | } |
1180 | 1179 | ||
@@ -1265,7 +1264,7 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev) | |||
1265 | } | 1264 | } |
1266 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1265 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1267 | status |= TxCalTCP; | 1266 | status |= TxCalTCP; |
1268 | np->stats.tx_compressed++; | 1267 | dev->stats.tx_compressed++; |
1269 | } | 1268 | } |
1270 | status |= skb_first_frag_len(skb) | (skb_num_frags(skb) << 16); | 1269 | status |= skb_first_frag_len(skb) | (skb_num_frags(skb) << 16); |
1271 | 1270 | ||
@@ -1374,7 +1373,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) | |||
1374 | printk(KERN_DEBUG "%s: Tx completion #%d entry %d is %#8.8x.\n", | 1373 | printk(KERN_DEBUG "%s: Tx completion #%d entry %d is %#8.8x.\n", |
1375 | dev->name, np->dirty_tx, np->tx_done, tx_status); | 1374 | dev->name, np->dirty_tx, np->tx_done, tx_status); |
1376 | if ((tx_status & 0xe0000000) == 0xa0000000) { | 1375 | if ((tx_status & 0xe0000000) == 0xa0000000) { |
1377 | np->stats.tx_packets++; | 1376 | dev->stats.tx_packets++; |
1378 | } else if ((tx_status & 0xe0000000) == 0x80000000) { | 1377 | } else if ((tx_status & 0xe0000000) == 0x80000000) { |
1379 | u16 entry = (tx_status & 0x7fff) / sizeof(starfire_tx_desc); | 1378 | u16 entry = (tx_status & 0x7fff) / sizeof(starfire_tx_desc); |
1380 | struct sk_buff *skb = np->tx_info[entry].skb; | 1379 | struct sk_buff *skb = np->tx_info[entry].skb; |
@@ -1462,9 +1461,9 @@ static int __netdev_rx(struct net_device *dev, int *quota) | |||
1462 | /* There was an error. */ | 1461 | /* There was an error. */ |
1463 | if (debug > 2) | 1462 | if (debug > 2) |
1464 | printk(KERN_DEBUG " netdev_rx() Rx error was %#8.8x.\n", desc_status); | 1463 | printk(KERN_DEBUG " netdev_rx() Rx error was %#8.8x.\n", desc_status); |
1465 | np->stats.rx_errors++; | 1464 | dev->stats.rx_errors++; |
1466 | if (desc_status & RxFIFOErr) | 1465 | if (desc_status & RxFIFOErr) |
1467 | np->stats.rx_fifo_errors++; | 1466 | dev->stats.rx_fifo_errors++; |
1468 | goto next_rx; | 1467 | goto next_rx; |
1469 | } | 1468 | } |
1470 | 1469 | ||
@@ -1515,7 +1514,7 @@ static int __netdev_rx(struct net_device *dev, int *quota) | |||
1515 | #endif | 1514 | #endif |
1516 | if (le16_to_cpu(desc->status2) & 0x0100) { | 1515 | if (le16_to_cpu(desc->status2) & 0x0100) { |
1517 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1516 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1518 | np->stats.rx_compressed++; | 1517 | dev->stats.rx_compressed++; |
1519 | } | 1518 | } |
1520 | /* | 1519 | /* |
1521 | * This feature doesn't seem to be working, at least | 1520 | * This feature doesn't seem to be working, at least |
@@ -1547,7 +1546,7 @@ static int __netdev_rx(struct net_device *dev, int *quota) | |||
1547 | } else | 1546 | } else |
1548 | #endif /* VLAN_SUPPORT */ | 1547 | #endif /* VLAN_SUPPORT */ |
1549 | netif_receive_skb(skb); | 1548 | netif_receive_skb(skb); |
1550 | np->stats.rx_packets++; | 1549 | dev->stats.rx_packets++; |
1551 | 1550 | ||
1552 | next_rx: | 1551 | next_rx: |
1553 | np->cur_rx++; | 1552 | np->cur_rx++; |
@@ -1717,12 +1716,12 @@ static void netdev_error(struct net_device *dev, int intr_status) | |||
1717 | printk(KERN_WARNING "%s: PCI Tx underflow -- adapter is probably malfunctioning\n", dev->name); | 1716 | printk(KERN_WARNING "%s: PCI Tx underflow -- adapter is probably malfunctioning\n", dev->name); |
1718 | } | 1717 | } |
1719 | if (intr_status & IntrRxGFPDead) { | 1718 | if (intr_status & IntrRxGFPDead) { |
1720 | np->stats.rx_fifo_errors++; | 1719 | dev->stats.rx_fifo_errors++; |
1721 | np->stats.rx_errors++; | 1720 | dev->stats.rx_errors++; |
1722 | } | 1721 | } |
1723 | if (intr_status & (IntrNoTxCsum | IntrDMAErr)) { | 1722 | if (intr_status & (IntrNoTxCsum | IntrDMAErr)) { |
1724 | np->stats.tx_fifo_errors++; | 1723 | dev->stats.tx_fifo_errors++; |
1725 | np->stats.tx_errors++; | 1724 | dev->stats.tx_errors++; |
1726 | } | 1725 | } |
1727 | if ((intr_status & ~(IntrNormalMask | IntrAbnormalSummary | IntrLinkChange | IntrStatsMax | IntrTxDataLow | IntrRxGFPDead | IntrNoTxCsum | IntrPCIPad)) && debug) | 1726 | if ((intr_status & ~(IntrNormalMask | IntrAbnormalSummary | IntrLinkChange | IntrStatsMax | IntrTxDataLow | IntrRxGFPDead | IntrNoTxCsum | IntrPCIPad)) && debug) |
1728 | printk(KERN_ERR "%s: Something Wicked happened! %#8.8x.\n", | 1727 | printk(KERN_ERR "%s: Something Wicked happened! %#8.8x.\n", |
@@ -1736,24 +1735,24 @@ static struct net_device_stats *get_stats(struct net_device *dev) | |||
1736 | void __iomem *ioaddr = np->base; | 1735 | void __iomem *ioaddr = np->base; |
1737 | 1736 | ||
1738 | /* This adapter architecture needs no SMP locks. */ | 1737 | /* This adapter architecture needs no SMP locks. */ |
1739 | np->stats.tx_bytes = readl(ioaddr + 0x57010); | 1738 | dev->stats.tx_bytes = readl(ioaddr + 0x57010); |
1740 | np->stats.rx_bytes = readl(ioaddr + 0x57044); | 1739 | dev->stats.rx_bytes = readl(ioaddr + 0x57044); |
1741 | np->stats.tx_packets = readl(ioaddr + 0x57000); | 1740 | dev->stats.tx_packets = readl(ioaddr + 0x57000); |
1742 | np->stats.tx_aborted_errors = | 1741 | dev->stats.tx_aborted_errors = |
1743 | readl(ioaddr + 0x57024) + readl(ioaddr + 0x57028); | 1742 | readl(ioaddr + 0x57024) + readl(ioaddr + 0x57028); |
1744 | np->stats.tx_window_errors = readl(ioaddr + 0x57018); | 1743 | dev->stats.tx_window_errors = readl(ioaddr + 0x57018); |
1745 | np->stats.collisions = | 1744 | dev->stats.collisions = |
1746 | readl(ioaddr + 0x57004) + readl(ioaddr + 0x57008); | 1745 | readl(ioaddr + 0x57004) + readl(ioaddr + 0x57008); |
1747 | 1746 | ||
1748 | /* The chip only need report frame silently dropped. */ | 1747 | /* The chip only need report frame silently dropped. */ |
1749 | np->stats.rx_dropped += readw(ioaddr + RxDMAStatus); | 1748 | dev->stats.rx_dropped += readw(ioaddr + RxDMAStatus); |
1750 | writew(0, ioaddr + RxDMAStatus); | 1749 | writew(0, ioaddr + RxDMAStatus); |
1751 | np->stats.rx_crc_errors = readl(ioaddr + 0x5703C); | 1750 | dev->stats.rx_crc_errors = readl(ioaddr + 0x5703C); |
1752 | np->stats.rx_frame_errors = readl(ioaddr + 0x57040); | 1751 | dev->stats.rx_frame_errors = readl(ioaddr + 0x57040); |
1753 | np->stats.rx_length_errors = readl(ioaddr + 0x57058); | 1752 | dev->stats.rx_length_errors = readl(ioaddr + 0x57058); |
1754 | np->stats.rx_missed_errors = readl(ioaddr + 0x5707C); | 1753 | dev->stats.rx_missed_errors = readl(ioaddr + 0x5707C); |
1755 | 1754 | ||
1756 | return &np->stats; | 1755 | return &dev->stats; |
1757 | } | 1756 | } |
1758 | 1757 | ||
1759 | 1758 | ||