aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2011-09-07 23:14:35 -0400
committerDavid S. Miller <davem@davemloft.net>2011-09-20 15:16:16 -0400
commit6af29a963cecf426966d56935d60a984bd5594ea (patch)
tree68b3a9527f89a2fe157516cace7e2644bc3a3500 /drivers/net
parent8603e33d01cb6bd32de46b2596fe47f0c4df6c12 (diff)
GRETH: RX/TX bytes were never increased
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/greth.c5
-rw-r--r--drivers/net/greth.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/greth.c b/drivers/net/greth.c
index 16ce45c11934..58ec74a73150 100644
--- a/drivers/net/greth.c
+++ b/drivers/net/greth.c
@@ -428,6 +428,7 @@ greth_start_xmit(struct sk_buff *skb, struct net_device *dev)
428 dma_sync_single_for_device(greth->dev, dma_addr, skb->len, DMA_TO_DEVICE); 428 dma_sync_single_for_device(greth->dev, dma_addr, skb->len, DMA_TO_DEVICE);
429 429
430 status = GRETH_BD_EN | GRETH_BD_IE | (skb->len & GRETH_BD_LEN); 430 status = GRETH_BD_EN | GRETH_BD_IE | (skb->len & GRETH_BD_LEN);
431 greth->tx_bufs_length[greth->tx_next] = skb->len & GRETH_BD_LEN;
431 432
432 /* Wrap around descriptor ring */ 433 /* Wrap around descriptor ring */
433 if (greth->tx_next == GRETH_TXBD_NUM_MASK) { 434 if (greth->tx_next == GRETH_TXBD_NUM_MASK) {
@@ -641,6 +642,7 @@ static void greth_clean_tx(struct net_device *dev)
641 dev->stats.tx_fifo_errors++; 642 dev->stats.tx_fifo_errors++;
642 } 643 }
643 dev->stats.tx_packets++; 644 dev->stats.tx_packets++;
645 dev->stats.tx_bytes += greth->tx_bufs_length[greth->tx_last];
644 greth->tx_last = NEXT_TX(greth->tx_last); 646 greth->tx_last = NEXT_TX(greth->tx_last);
645 greth->tx_free++; 647 greth->tx_free++;
646 } 648 }
@@ -695,6 +697,7 @@ static void greth_clean_tx_gbit(struct net_device *dev)
695 greth->tx_skbuff[greth->tx_last] = NULL; 697 greth->tx_skbuff[greth->tx_last] = NULL;
696 698
697 greth_update_tx_stats(dev, stat); 699 greth_update_tx_stats(dev, stat);
700 dev->stats.tx_bytes += skb->len;
698 701
699 bdp = greth->tx_bd_base + greth->tx_last; 702 bdp = greth->tx_bd_base + greth->tx_last;
700 703
@@ -796,6 +799,7 @@ static int greth_rx(struct net_device *dev, int limit)
796 memcpy(skb_put(skb, pkt_len), phys_to_virt(dma_addr), pkt_len); 799 memcpy(skb_put(skb, pkt_len), phys_to_virt(dma_addr), pkt_len);
797 800
798 skb->protocol = eth_type_trans(skb, dev); 801 skb->protocol = eth_type_trans(skb, dev);
802 dev->stats.rx_bytes += pkt_len;
799 dev->stats.rx_packets++; 803 dev->stats.rx_packets++;
800 netif_receive_skb(skb); 804 netif_receive_skb(skb);
801 } 805 }
@@ -910,6 +914,7 @@ static int greth_rx_gbit(struct net_device *dev, int limit)
910 914
911 skb->protocol = eth_type_trans(skb, dev); 915 skb->protocol = eth_type_trans(skb, dev);
912 dev->stats.rx_packets++; 916 dev->stats.rx_packets++;
917 dev->stats.rx_bytes += pkt_len;
913 netif_receive_skb(skb); 918 netif_receive_skb(skb);
914 919
915 greth->rx_skbuff[greth->rx_cur] = newskb; 920 greth->rx_skbuff[greth->rx_cur] = newskb;
diff --git a/drivers/net/greth.h b/drivers/net/greth.h
index 9a0040dee4da..232a622a85b7 100644
--- a/drivers/net/greth.h
+++ b/drivers/net/greth.h
@@ -103,6 +103,7 @@ struct greth_private {
103 103
104 unsigned char *tx_bufs[GRETH_TXBD_NUM]; 104 unsigned char *tx_bufs[GRETH_TXBD_NUM];
105 unsigned char *rx_bufs[GRETH_RXBD_NUM]; 105 unsigned char *rx_bufs[GRETH_RXBD_NUM];
106 u16 tx_bufs_length[GRETH_TXBD_NUM];
106 107
107 u16 tx_next; 108 u16 tx_next;
108 u16 tx_last; 109 u16 tx_last;