aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/dscc4.c
diff options
context:
space:
mode:
authorKrzysztof Halasa <khc@pm.waw.pl>2008-06-30 17:26:53 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-04 08:47:41 -0400
commit198191c4a7ce4daba379608fb38b9bc5a4eedc61 (patch)
tree3229362a45a15af42628553926bc040e44c39ce0 /drivers/net/wan/dscc4.c
parent844290e56067aed0a54142d756565abb9614136c (diff)
WAN: convert drivers to use built-in netdev_stats
There is no point in using separate net_device_stats structs when the one in struct net_device is present. Compiles. Signed-off-by: Krzysztof HaƂasa <khc@pm.waw.pl> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/wan/dscc4.c')
-rw-r--r--drivers/net/wan/dscc4.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index c6f26e28e376..50ef5b4efd6d 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -642,7 +642,6 @@ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv,
642 struct net_device *dev) 642 struct net_device *dev)
643{ 643{
644 struct RxFD *rx_fd = dpriv->rx_fd + dpriv->rx_current%RX_RING_SIZE; 644 struct RxFD *rx_fd = dpriv->rx_fd + dpriv->rx_current%RX_RING_SIZE;
645 struct net_device_stats *stats = hdlc_stats(dev);
646 struct pci_dev *pdev = dpriv->pci_priv->pdev; 645 struct pci_dev *pdev = dpriv->pci_priv->pdev;
647 struct sk_buff *skb; 646 struct sk_buff *skb;
648 int pkt_len; 647 int pkt_len;
@@ -656,8 +655,8 @@ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv,
656 pci_unmap_single(pdev, le32_to_cpu(rx_fd->data), 655 pci_unmap_single(pdev, le32_to_cpu(rx_fd->data),
657 RX_MAX(HDLC_MAX_MRU), PCI_DMA_FROMDEVICE); 656 RX_MAX(HDLC_MAX_MRU), PCI_DMA_FROMDEVICE);
658 if ((skb->data[--pkt_len] & FrameOk) == FrameOk) { 657 if ((skb->data[--pkt_len] & FrameOk) == FrameOk) {
659 stats->rx_packets++; 658 dev->stats.rx_packets++;
660 stats->rx_bytes += pkt_len; 659 dev->stats.rx_bytes += pkt_len;
661 skb_put(skb, pkt_len); 660 skb_put(skb, pkt_len);
662 if (netif_running(dev)) 661 if (netif_running(dev))
663 skb->protocol = hdlc_type_trans(skb, dev); 662 skb->protocol = hdlc_type_trans(skb, dev);
@@ -665,13 +664,13 @@ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv,
665 netif_rx(skb); 664 netif_rx(skb);
666 } else { 665 } else {
667 if (skb->data[pkt_len] & FrameRdo) 666 if (skb->data[pkt_len] & FrameRdo)
668 stats->rx_fifo_errors++; 667 dev->stats.rx_fifo_errors++;
669 else if (!(skb->data[pkt_len] | ~FrameCrc)) 668 else if (!(skb->data[pkt_len] | ~FrameCrc))
670 stats->rx_crc_errors++; 669 dev->stats.rx_crc_errors++;
671 else if (!(skb->data[pkt_len] | ~(FrameVfr | FrameRab))) 670 else if (!(skb->data[pkt_len] | ~(FrameVfr | FrameRab)))
672 stats->rx_length_errors++; 671 dev->stats.rx_length_errors++;
673 else 672 else
674 stats->rx_errors++; 673 dev->stats.rx_errors++;
675 dev_kfree_skb_irq(skb); 674 dev_kfree_skb_irq(skb);
676 } 675 }
677refill: 676refill:
@@ -1569,7 +1568,6 @@ try:
1569 1568
1570 if (state & SccEvt) { 1569 if (state & SccEvt) {
1571 if (state & Alls) { 1570 if (state & Alls) {
1572 struct net_device_stats *stats = hdlc_stats(dev);
1573 struct sk_buff *skb; 1571 struct sk_buff *skb;
1574 struct TxFD *tx_fd; 1572 struct TxFD *tx_fd;
1575 1573
@@ -1586,8 +1584,8 @@ try:
1586 pci_unmap_single(ppriv->pdev, le32_to_cpu(tx_fd->data), 1584 pci_unmap_single(ppriv->pdev, le32_to_cpu(tx_fd->data),
1587 skb->len, PCI_DMA_TODEVICE); 1585 skb->len, PCI_DMA_TODEVICE);
1588 if (tx_fd->state & FrameEnd) { 1586 if (tx_fd->state & FrameEnd) {
1589 stats->tx_packets++; 1587 dev->stats.tx_packets++;
1590 stats->tx_bytes += skb->len; 1588 dev->stats.tx_bytes += skb->len;
1591 } 1589 }
1592 dev_kfree_skb_irq(skb); 1590 dev_kfree_skb_irq(skb);
1593 dpriv->tx_skbuff[cur] = NULL; 1591 dpriv->tx_skbuff[cur] = NULL;
@@ -1698,7 +1696,7 @@ try:
1698 } 1696 }
1699 if (state & Err) { 1697 if (state & Err) {
1700 printk(KERN_INFO "%s: Tx ERR\n", dev->name); 1698 printk(KERN_INFO "%s: Tx ERR\n", dev->name);
1701 hdlc_stats(dev)->tx_errors++; 1699 dev->stats.tx_errors++;
1702 state &= ~Err; 1700 state &= ~Err;
1703 } 1701 }
1704 } 1702 }
@@ -1834,7 +1832,7 @@ try:
1834 if (!(rx_fd->state2 & DataComplete)) 1832 if (!(rx_fd->state2 & DataComplete))
1835 break; 1833 break;
1836 if (rx_fd->state2 & FrameAborted) { 1834 if (rx_fd->state2 & FrameAborted) {
1837 hdlc_stats(dev)->rx_over_errors++; 1835 dev->stats.rx_over_errors++;
1838 rx_fd->state1 |= Hold; 1836 rx_fd->state1 |= Hold;
1839 rx_fd->state2 = 0x00000000; 1837 rx_fd->state2 = 0x00000000;
1840 rx_fd->end = cpu_to_le32(0xbabeface); 1838 rx_fd->end = cpu_to_le32(0xbabeface);