diff options
Diffstat (limited to 'drivers/net/greth.c')
-rw-r--r-- | drivers/net/greth.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/greth.c b/drivers/net/greth.c index 16ce45c11934..52a39000c42c 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) { |
@@ -490,7 +491,8 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev) | |||
490 | if (nr_frags != 0) | 491 | if (nr_frags != 0) |
491 | status = GRETH_TXBD_MORE; | 492 | status = GRETH_TXBD_MORE; |
492 | 493 | ||
493 | status |= GRETH_TXBD_CSALL; | 494 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
495 | status |= GRETH_TXBD_CSALL; | ||
494 | status |= skb_headlen(skb) & GRETH_BD_LEN; | 496 | status |= skb_headlen(skb) & GRETH_BD_LEN; |
495 | if (greth->tx_next == GRETH_TXBD_NUM_MASK) | 497 | if (greth->tx_next == GRETH_TXBD_NUM_MASK) |
496 | status |= GRETH_BD_WR; | 498 | status |= GRETH_BD_WR; |
@@ -513,7 +515,9 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev) | |||
513 | greth->tx_skbuff[curr_tx] = NULL; | 515 | greth->tx_skbuff[curr_tx] = NULL; |
514 | bdp = greth->tx_bd_base + curr_tx; | 516 | bdp = greth->tx_bd_base + curr_tx; |
515 | 517 | ||
516 | status = GRETH_TXBD_CSALL | GRETH_BD_EN; | 518 | status = GRETH_BD_EN; |
519 | if (skb->ip_summed == CHECKSUM_PARTIAL) | ||
520 | status |= GRETH_TXBD_CSALL; | ||
517 | status |= frag->size & GRETH_BD_LEN; | 521 | status |= frag->size & GRETH_BD_LEN; |
518 | 522 | ||
519 | /* Wrap around descriptor ring */ | 523 | /* Wrap around descriptor ring */ |
@@ -641,6 +645,7 @@ static void greth_clean_tx(struct net_device *dev) | |||
641 | dev->stats.tx_fifo_errors++; | 645 | dev->stats.tx_fifo_errors++; |
642 | } | 646 | } |
643 | dev->stats.tx_packets++; | 647 | dev->stats.tx_packets++; |
648 | dev->stats.tx_bytes += greth->tx_bufs_length[greth->tx_last]; | ||
644 | greth->tx_last = NEXT_TX(greth->tx_last); | 649 | greth->tx_last = NEXT_TX(greth->tx_last); |
645 | greth->tx_free++; | 650 | greth->tx_free++; |
646 | } | 651 | } |
@@ -695,6 +700,7 @@ static void greth_clean_tx_gbit(struct net_device *dev) | |||
695 | greth->tx_skbuff[greth->tx_last] = NULL; | 700 | greth->tx_skbuff[greth->tx_last] = NULL; |
696 | 701 | ||
697 | greth_update_tx_stats(dev, stat); | 702 | greth_update_tx_stats(dev, stat); |
703 | dev->stats.tx_bytes += skb->len; | ||
698 | 704 | ||
699 | bdp = greth->tx_bd_base + greth->tx_last; | 705 | bdp = greth->tx_bd_base + greth->tx_last; |
700 | 706 | ||
@@ -796,6 +802,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); | 802 | memcpy(skb_put(skb, pkt_len), phys_to_virt(dma_addr), pkt_len); |
797 | 803 | ||
798 | skb->protocol = eth_type_trans(skb, dev); | 804 | skb->protocol = eth_type_trans(skb, dev); |
805 | dev->stats.rx_bytes += pkt_len; | ||
799 | dev->stats.rx_packets++; | 806 | dev->stats.rx_packets++; |
800 | netif_receive_skb(skb); | 807 | netif_receive_skb(skb); |
801 | } | 808 | } |
@@ -910,6 +917,7 @@ static int greth_rx_gbit(struct net_device *dev, int limit) | |||
910 | 917 | ||
911 | skb->protocol = eth_type_trans(skb, dev); | 918 | skb->protocol = eth_type_trans(skb, dev); |
912 | dev->stats.rx_packets++; | 919 | dev->stats.rx_packets++; |
920 | dev->stats.rx_bytes += pkt_len; | ||
913 | netif_receive_skb(skb); | 921 | netif_receive_skb(skb); |
914 | 922 | ||
915 | greth->rx_skbuff[greth->rx_cur] = newskb; | 923 | greth->rx_skbuff[greth->rx_cur] = newskb; |