aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sunhme.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sunhme.c')
-rw-r--r--drivers/net/sunhme.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 192bbc91c731..5304d7b94e5e 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -2058,11 +2058,10 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
2058 goto drop_it; 2058 goto drop_it;
2059 } 2059 }
2060 2060
2061 copy_skb->dev = dev;
2062 skb_reserve(copy_skb, 2); 2061 skb_reserve(copy_skb, 2);
2063 skb_put(copy_skb, len); 2062 skb_put(copy_skb, len);
2064 hme_dma_sync_for_cpu(hp, dma_addr, len, DMA_FROMDEVICE); 2063 hme_dma_sync_for_cpu(hp, dma_addr, len, DMA_FROMDEVICE);
2065 memcpy(copy_skb->data, skb->data, len); 2064 skb_copy_from_linear_data(skb, copy_skb->data, len);
2066 hme_dma_sync_for_device(hp, dma_addr, len, DMA_FROMDEVICE); 2065 hme_dma_sync_for_device(hp, dma_addr, len, DMA_FROMDEVICE);
2067 2066
2068 /* Reuse original ring buffer. */ 2067 /* Reuse original ring buffer. */
@@ -2270,10 +2269,8 @@ static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev)
2270 2269
2271 tx_flags = TXFLAG_OWN; 2270 tx_flags = TXFLAG_OWN;
2272 if (skb->ip_summed == CHECKSUM_PARTIAL) { 2271 if (skb->ip_summed == CHECKSUM_PARTIAL) {
2273 u32 csum_start_off, csum_stuff_off; 2272 const u32 csum_start_off = skb_transport_offset(skb);
2274 2273 const u32 csum_stuff_off = csum_start_off + skb->csum_offset;
2275 csum_start_off = (u32) (skb->h.raw - skb->data);
2276 csum_stuff_off = csum_start_off + skb->csum_offset;
2277 2274
2278 tx_flags = (TXFLAG_OWN | TXFLAG_CSENABLE | 2275 tx_flags = (TXFLAG_OWN | TXFLAG_CSENABLE |
2279 ((csum_start_off << 14) & TXFLAG_CSBUFBEGIN) | 2276 ((csum_start_off << 14) & TXFLAG_CSBUFBEGIN) |