aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sungem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sungem.c')
-rw-r--r--drivers/net/sungem.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 07f38907884b..5da73212ac91 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -843,11 +843,10 @@ static int gem_rx(struct gem *gp, int work_to_do)
843 goto drop_it; 843 goto drop_it;
844 } 844 }
845 845
846 copy_skb->dev = gp->dev;
847 skb_reserve(copy_skb, 2); 846 skb_reserve(copy_skb, 2);
848 skb_put(copy_skb, len); 847 skb_put(copy_skb, len);
849 pci_dma_sync_single_for_cpu(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); 848 pci_dma_sync_single_for_cpu(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
850 memcpy(copy_skb->data, skb->data, len); 849 skb_copy_from_linear_data(skb, copy_skb->data, len);
851 pci_dma_sync_single_for_device(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); 850 pci_dma_sync_single_for_device(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
852 851
853 /* We'll reuse the original ring buffer. */ 852 /* We'll reuse the original ring buffer. */
@@ -1027,10 +1026,8 @@ static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
1027 1026
1028 ctrl = 0; 1027 ctrl = 0;
1029 if (skb->ip_summed == CHECKSUM_PARTIAL) { 1028 if (skb->ip_summed == CHECKSUM_PARTIAL) {
1030 u64 csum_start_off, csum_stuff_off; 1029 const u64 csum_start_off = skb_transport_offset(skb);
1031 1030 const u64 csum_stuff_off = csum_start_off + skb->csum_offset;
1032 csum_start_off = (u64) (skb->h.raw - skb->data);
1033 csum_stuff_off = csum_start_off + skb->csum_offset;
1034 1031
1035 ctrl = (TXDCTRL_CENAB | 1032 ctrl = (TXDCTRL_CENAB |
1036 (csum_start_off << 15) | 1033 (csum_start_off << 15) |