aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index d981d4c41dd3..b666a0cc0642 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -942,18 +942,18 @@ static inline void gfar_tx_checksum(struct sk_buff *skb, struct txfcb *fcb)
942 942
943 /* Tell the controller what the protocol is */ 943 /* Tell the controller what the protocol is */
944 /* And provide the already calculated phcs */ 944 /* And provide the already calculated phcs */
945 if (skb->nh.iph->protocol == IPPROTO_UDP) { 945 if (ip_hdr(skb)->protocol == IPPROTO_UDP) {
946 flags |= TXFCB_UDP; 946 flags |= TXFCB_UDP;
947 fcb->phcs = skb->h.uh->check; 947 fcb->phcs = udp_hdr(skb)->check;
948 } else 948 } else
949 fcb->phcs = skb->h.th->check; 949 fcb->phcs = udp_hdr(skb)->check;
950 950
951 /* l3os is the distance between the start of the 951 /* l3os is the distance between the start of the
952 * frame (skb->data) and the start of the IP hdr. 952 * frame (skb->data) and the start of the IP hdr.
953 * l4os is the distance between the start of the 953 * l4os is the distance between the start of the
954 * l3 hdr and the l4 hdr */ 954 * l3 hdr and the l4 hdr */
955 fcb->l3os = (u16)(skb->nh.raw - skb->data - GMAC_FCB_LEN); 955 fcb->l3os = (u16)(skb_network_offset(skb) - GMAC_FCB_LEN);
956 fcb->l4os = (u16)(skb->h.raw - skb->nh.raw); 956 fcb->l4os = skb_network_header_len(skb);
957 957
958 fcb->flags = flags; 958 fcb->flags = flags;
959} 959}
@@ -1295,8 +1295,6 @@ struct sk_buff * gfar_new_skb(struct net_device *dev, struct rxbd8 *bdp)
1295 */ 1295 */
1296 skb_reserve(skb, alignamount); 1296 skb_reserve(skb, alignamount);
1297 1297
1298 skb->dev = dev;
1299
1300 bdp->bufPtr = dma_map_single(NULL, skb->data, 1298 bdp->bufPtr = dma_map_single(NULL, skb->data,
1301 priv->rx_buffer_size, DMA_FROM_DEVICE); 1299 priv->rx_buffer_size, DMA_FROM_DEVICE);
1302 1300