aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pasemi_mac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pasemi_mac.c')
-rw-r--r--drivers/net/pasemi_mac.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index b14f171b1b67..09b4fde8d924 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -580,6 +580,16 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit)
580 580
581 len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S; 581 len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S;
582 582
583 pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE);
584
585 if (macrx & XCT_MACRX_CRC) {
586 /* CRC error flagged */
587 mac->netdev->stats.rx_errors++;
588 mac->netdev->stats.rx_crc_errors++;
589 dev_kfree_skb_irq(skb);
590 goto next;
591 }
592
583 if (len < 256) { 593 if (len < 256) {
584 struct sk_buff *new_skb; 594 struct sk_buff *new_skb;
585 595
@@ -595,11 +605,10 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit)
595 } else 605 } else
596 info->skb = NULL; 606 info->skb = NULL;
597 607
598 pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE);
599
600 info->dma = 0; 608 info->dma = 0;
601 609
602 skb_put(skb, len); 610 /* Don't include CRC */
611 skb_put(skb, len-4);
603 612
604 if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) { 613 if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) {
605 skb->ip_summed = CHECKSUM_UNNECESSARY; 614 skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -614,6 +623,7 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit)
614 skb->protocol = eth_type_trans(skb, mac->netdev); 623 skb->protocol = eth_type_trans(skb, mac->netdev);
615 netif_receive_skb(skb); 624 netif_receive_skb(skb);
616 625
626next:
617 RX_RING(mac, n) = 0; 627 RX_RING(mac, n) = 0;
618 RX_RING(mac, n+1) = 0; 628 RX_RING(mac, n+1) = 0;
619 629