aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_eddp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/net/qeth_eddp.c')
-rw-r--r--drivers/s390/net/qeth_eddp.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c
index 7c735e1fe063..dd7034fbfff8 100644
--- a/drivers/s390/net/qeth_eddp.c
+++ b/drivers/s390/net/qeth_eddp.c
@@ -267,7 +267,8 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len,
267 267
268 QETH_DBF_TEXT(trace, 5, "eddpcdtc"); 268 QETH_DBF_TEXT(trace, 5, "eddpcdtc");
269 if (skb_shinfo(eddp->skb)->nr_frags == 0) { 269 if (skb_shinfo(eddp->skb)->nr_frags == 0) {
270 memcpy(dst, eddp->skb->data + eddp->skb_offset, len); 270 skb_copy_from_linear_data_offset(eddp->skb, eddp->skb_offset,
271 dst, len);
271 *hcsum = csum_partial(eddp->skb->data + eddp->skb_offset, len, 272 *hcsum = csum_partial(eddp->skb->data + eddp->skb_offset, len,
272 *hcsum); 273 *hcsum);
273 eddp->skb_offset += len; 274 eddp->skb_offset += len;
@@ -416,7 +417,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
416 eddp->skb_offset += VLAN_HLEN; 417 eddp->skb_offset += VLAN_HLEN;
417#endif /* CONFIG_QETH_VLAN */ 418#endif /* CONFIG_QETH_VLAN */
418 } 419 }
419 tcph = eddp->skb->h.th; 420 tcph = tcp_hdr(eddp->skb);
420 while (eddp->skb_offset < eddp->skb->len) { 421 while (eddp->skb_offset < eddp->skb->len) {
421 data_len = min((int)skb_shinfo(eddp->skb)->gso_size, 422 data_len = min((int)skb_shinfo(eddp->skb)->gso_size,
422 (int)(eddp->skb->len - eddp->skb_offset)); 423 (int)(eddp->skb->len - eddp->skb_offset));
@@ -473,20 +474,24 @@ qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
473 QETH_DBF_TEXT(trace, 5, "eddpficx"); 474 QETH_DBF_TEXT(trace, 5, "eddpficx");
474 /* create our segmentation headers and copy original headers */ 475 /* create our segmentation headers and copy original headers */
475 if (skb->protocol == htons(ETH_P_IP)) 476 if (skb->protocol == htons(ETH_P_IP))
476 eddp = qeth_eddp_create_eddp_data(qhdr, (u8 *)skb->nh.iph, 477 eddp = qeth_eddp_create_eddp_data(qhdr,
477 skb->nh.iph->ihl*4, 478 skb_network_header(skb),
478 (u8 *)skb->h.th, skb->h.th->doff*4); 479 ip_hdrlen(skb),
480 skb_transport_header(skb),
481 tcp_hdrlen(skb));
479 else 482 else
480 eddp = qeth_eddp_create_eddp_data(qhdr, (u8 *)skb->nh.ipv6h, 483 eddp = qeth_eddp_create_eddp_data(qhdr,
481 sizeof(struct ipv6hdr), 484 skb_network_header(skb),
482 (u8 *)skb->h.th, skb->h.th->doff*4); 485 sizeof(struct ipv6hdr),
486 skb_transport_header(skb),
487 tcp_hdrlen(skb));
483 488
484 if (eddp == NULL) { 489 if (eddp == NULL) {
485 QETH_DBF_TEXT(trace, 2, "eddpfcnm"); 490 QETH_DBF_TEXT(trace, 2, "eddpfcnm");
486 return -ENOMEM; 491 return -ENOMEM;
487 } 492 }
488 if (qhdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) { 493 if (qhdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) {
489 skb->mac.raw = (skb->data) + sizeof(struct qeth_hdr); 494 skb_set_mac_header(skb, sizeof(struct qeth_hdr));
490 memcpy(&eddp->mac, eth_hdr(skb), ETH_HLEN); 495 memcpy(&eddp->mac, eth_hdr(skb), ETH_HLEN);
491#ifdef CONFIG_QETH_VLAN 496#ifdef CONFIG_QETH_VLAN
492 if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q)) { 497 if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q)) {
@@ -590,12 +595,13 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb,
590 QETH_DBF_TEXT(trace, 5, "creddpct"); 595 QETH_DBF_TEXT(trace, 5, "creddpct");
591 if (skb->protocol == htons(ETH_P_IP)) 596 if (skb->protocol == htons(ETH_P_IP))
592 ctx = qeth_eddp_create_context_generic(card, skb, 597 ctx = qeth_eddp_create_context_generic(card, skb,
593 sizeof(struct qeth_hdr) + skb->nh.iph->ihl*4 + 598 (sizeof(struct qeth_hdr) +
594 skb->h.th->doff*4); 599 ip_hdrlen(skb) +
600 tcp_hdrlen(skb)));
595 else if (skb->protocol == htons(ETH_P_IPV6)) 601 else if (skb->protocol == htons(ETH_P_IPV6))
596 ctx = qeth_eddp_create_context_generic(card, skb, 602 ctx = qeth_eddp_create_context_generic(card, skb,
597 sizeof(struct qeth_hdr) + sizeof(struct ipv6hdr) + 603 sizeof(struct qeth_hdr) + sizeof(struct ipv6hdr) +
598 skb->h.th->doff*4); 604 tcp_hdrlen(skb));
599 else 605 else
600 QETH_DBF_TEXT(trace, 2, "cetcpinv"); 606 QETH_DBF_TEXT(trace, 2, "cetcpinv");
601 607