diff options
Diffstat (limited to 'drivers/net/ethernet/marvell/sky2.c')
-rw-r--r-- | drivers/net/ethernet/marvell/sky2.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index c9b504e2dfc3..487a6c8bd4ec 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c | |||
@@ -2494,8 +2494,13 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2, | |||
2494 | skb_copy_from_linear_data(re->skb, skb->data, length); | 2494 | skb_copy_from_linear_data(re->skb, skb->data, length); |
2495 | skb->ip_summed = re->skb->ip_summed; | 2495 | skb->ip_summed = re->skb->ip_summed; |
2496 | skb->csum = re->skb->csum; | 2496 | skb->csum = re->skb->csum; |
2497 | skb->rxhash = re->skb->rxhash; | ||
2498 | skb->vlan_tci = re->skb->vlan_tci; | ||
2499 | |||
2497 | pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr, | 2500 | pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr, |
2498 | length, PCI_DMA_FROMDEVICE); | 2501 | length, PCI_DMA_FROMDEVICE); |
2502 | re->skb->vlan_tci = 0; | ||
2503 | re->skb->rxhash = 0; | ||
2499 | re->skb->ip_summed = CHECKSUM_NONE; | 2504 | re->skb->ip_summed = CHECKSUM_NONE; |
2500 | skb_put(skb, length); | 2505 | skb_put(skb, length); |
2501 | } | 2506 | } |
@@ -2580,9 +2585,6 @@ static struct sk_buff *sky2_receive(struct net_device *dev, | |||
2580 | struct sk_buff *skb = NULL; | 2585 | struct sk_buff *skb = NULL; |
2581 | u16 count = (status & GMR_FS_LEN) >> 16; | 2586 | u16 count = (status & GMR_FS_LEN) >> 16; |
2582 | 2587 | ||
2583 | if (status & GMR_FS_VLAN) | ||
2584 | count -= VLAN_HLEN; /* Account for vlan tag */ | ||
2585 | |||
2586 | netif_printk(sky2, rx_status, KERN_DEBUG, dev, | 2588 | netif_printk(sky2, rx_status, KERN_DEBUG, dev, |
2587 | "rx slot %u status 0x%x len %d\n", | 2589 | "rx slot %u status 0x%x len %d\n", |
2588 | sky2->rx_next, status, length); | 2590 | sky2->rx_next, status, length); |
@@ -2590,6 +2592,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev, | |||
2590 | sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; | 2592 | sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; |
2591 | prefetch(sky2->rx_ring + sky2->rx_next); | 2593 | prefetch(sky2->rx_ring + sky2->rx_next); |
2592 | 2594 | ||
2595 | if (vlan_tx_tag_present(re->skb)) | ||
2596 | count -= VLAN_HLEN; /* Account for vlan tag */ | ||
2597 | |||
2593 | /* This chip has hardware problems that generates bogus status. | 2598 | /* This chip has hardware problems that generates bogus status. |
2594 | * So do only marginal checking and expect higher level protocols | 2599 | * So do only marginal checking and expect higher level protocols |
2595 | * to handle crap frames. | 2600 | * to handle crap frames. |
@@ -2647,11 +2652,8 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last) | |||
2647 | } | 2652 | } |
2648 | 2653 | ||
2649 | static inline void sky2_skb_rx(const struct sky2_port *sky2, | 2654 | static inline void sky2_skb_rx(const struct sky2_port *sky2, |
2650 | u32 status, struct sk_buff *skb) | 2655 | struct sk_buff *skb) |
2651 | { | 2656 | { |
2652 | if (status & GMR_FS_VLAN) | ||
2653 | __vlan_hwaccel_put_tag(skb, be16_to_cpu(sky2->rx_tag)); | ||
2654 | |||
2655 | if (skb->ip_summed == CHECKSUM_NONE) | 2657 | if (skb->ip_summed == CHECKSUM_NONE) |
2656 | netif_receive_skb(skb); | 2658 | netif_receive_skb(skb); |
2657 | else | 2659 | else |
@@ -2705,6 +2707,14 @@ static void sky2_rx_checksum(struct sky2_port *sky2, u32 status) | |||
2705 | } | 2707 | } |
2706 | } | 2708 | } |
2707 | 2709 | ||
2710 | static void sky2_rx_tag(struct sky2_port *sky2, u16 length) | ||
2711 | { | ||
2712 | struct sk_buff *skb; | ||
2713 | |||
2714 | skb = sky2->rx_ring[sky2->rx_next].skb; | ||
2715 | __vlan_hwaccel_put_tag(skb, be16_to_cpu(length)); | ||
2716 | } | ||
2717 | |||
2708 | static void sky2_rx_hash(struct sky2_port *sky2, u32 status) | 2718 | static void sky2_rx_hash(struct sky2_port *sky2, u32 status) |
2709 | { | 2719 | { |
2710 | struct sk_buff *skb; | 2720 | struct sk_buff *skb; |
@@ -2763,8 +2773,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
2763 | } | 2773 | } |
2764 | 2774 | ||
2765 | skb->protocol = eth_type_trans(skb, dev); | 2775 | skb->protocol = eth_type_trans(skb, dev); |
2766 | 2776 | sky2_skb_rx(sky2, skb); | |
2767 | sky2_skb_rx(sky2, status, skb); | ||
2768 | 2777 | ||
2769 | /* Stop after net poll weight */ | 2778 | /* Stop after net poll weight */ |
2770 | if (++work_done >= to_do) | 2779 | if (++work_done >= to_do) |
@@ -2772,11 +2781,11 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
2772 | break; | 2781 | break; |
2773 | 2782 | ||
2774 | case OP_RXVLAN: | 2783 | case OP_RXVLAN: |
2775 | sky2->rx_tag = length; | 2784 | sky2_rx_tag(sky2, length); |
2776 | break; | 2785 | break; |
2777 | 2786 | ||
2778 | case OP_RXCHKSVLAN: | 2787 | case OP_RXCHKSVLAN: |
2779 | sky2->rx_tag = length; | 2788 | sky2_rx_tag(sky2, length); |
2780 | /* fall through */ | 2789 | /* fall through */ |
2781 | case OP_RXCHKS: | 2790 | case OP_RXCHKS: |
2782 | if (likely(dev->features & NETIF_F_RXCSUM)) | 2791 | if (likely(dev->features & NETIF_F_RXCSUM)) |