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.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c
index a363721cf28d..6bb558a9a032 100644
--- a/drivers/s390/net/qeth_eddp.c
+++ b/drivers/s390/net/qeth_eddp.c
@@ -258,7 +258,7 @@ qeth_eddp_create_segment_hdrs(struct qeth_eddp_context *ctx,
258 258
259static inline void 259static inline void
260qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len, 260qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len,
261 u32 *hcsum) 261 __wsum *hcsum)
262{ 262{
263 struct skb_frag_struct *frag; 263 struct skb_frag_struct *frag;
264 int left_in_frag; 264 int left_in_frag;
@@ -305,7 +305,7 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len,
305static inline void 305static inline void
306qeth_eddp_create_segment_data_tcp(struct qeth_eddp_context *ctx, 306qeth_eddp_create_segment_data_tcp(struct qeth_eddp_context *ctx,
307 struct qeth_eddp_data *eddp, int data_len, 307 struct qeth_eddp_data *eddp, int data_len,
308 u32 hcsum) 308 __wsum hcsum)
309{ 309{
310 u8 *page; 310 u8 *page;
311 int page_remainder; 311 int page_remainder;
@@ -349,10 +349,10 @@ qeth_eddp_create_segment_data_tcp(struct qeth_eddp_context *ctx,
349 ((struct tcphdr *)eddp->th_in_ctx)->check = csum_fold(hcsum); 349 ((struct tcphdr *)eddp->th_in_ctx)->check = csum_fold(hcsum);
350} 350}
351 351
352static inline u32 352static inline __wsum
353qeth_eddp_check_tcp4_hdr(struct qeth_eddp_data *eddp, int data_len) 353qeth_eddp_check_tcp4_hdr(struct qeth_eddp_data *eddp, int data_len)
354{ 354{
355 u32 phcsum; /* pseudo header checksum */ 355 __wsum phcsum; /* pseudo header checksum */
356 356
357 QETH_DBF_TEXT(trace, 5, "eddpckt4"); 357 QETH_DBF_TEXT(trace, 5, "eddpckt4");
358 eddp->th.tcp.h.check = 0; 358 eddp->th.tcp.h.check = 0;
@@ -363,11 +363,11 @@ qeth_eddp_check_tcp4_hdr(struct qeth_eddp_data *eddp, int data_len)
363 return csum_partial((u8 *)&eddp->th, eddp->thl, phcsum); 363 return csum_partial((u8 *)&eddp->th, eddp->thl, phcsum);
364} 364}
365 365
366static inline u32 366static inline __wsum
367qeth_eddp_check_tcp6_hdr(struct qeth_eddp_data *eddp, int data_len) 367qeth_eddp_check_tcp6_hdr(struct qeth_eddp_data *eddp, int data_len)
368{ 368{
369 u32 proto; 369 __be32 proto;
370 u32 phcsum; /* pseudo header checksum */ 370 __wsum phcsum; /* pseudo header checksum */
371 371
372 QETH_DBF_TEXT(trace, 5, "eddpckt6"); 372 QETH_DBF_TEXT(trace, 5, "eddpckt6");
373 eddp->th.tcp.h.check = 0; 373 eddp->th.tcp.h.check = 0;
@@ -405,7 +405,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
405{ 405{
406 struct tcphdr *tcph; 406 struct tcphdr *tcph;
407 int data_len; 407 int data_len;
408 u32 hcsum; 408 __wsum hcsum;
409 409
410 QETH_DBF_TEXT(trace, 5, "eddpftcp"); 410 QETH_DBF_TEXT(trace, 5, "eddpftcp");
411 eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl; 411 eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl;
@@ -433,22 +433,22 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
433 eddp->qh.hdr.l3.length = data_len + eddp->nhl + 433 eddp->qh.hdr.l3.length = data_len + eddp->nhl +
434 eddp->thl; 434 eddp->thl;
435 /* prepare ip hdr */ 435 /* prepare ip hdr */
436 if (eddp->skb->protocol == ETH_P_IP){ 436 if (eddp->skb->protocol == htons(ETH_P_IP)){
437 eddp->nh.ip4.h.tot_len = data_len + eddp->nhl + 437 eddp->nh.ip4.h.tot_len = htons(data_len + eddp->nhl +
438 eddp->thl; 438 eddp->thl);
439 eddp->nh.ip4.h.check = 0; 439 eddp->nh.ip4.h.check = 0;
440 eddp->nh.ip4.h.check = 440 eddp->nh.ip4.h.check =
441 ip_fast_csum((u8 *)&eddp->nh.ip4.h, 441 ip_fast_csum((u8 *)&eddp->nh.ip4.h,
442 eddp->nh.ip4.h.ihl); 442 eddp->nh.ip4.h.ihl);
443 } else 443 } else
444 eddp->nh.ip6.h.payload_len = data_len + eddp->thl; 444 eddp->nh.ip6.h.payload_len = htons(data_len + eddp->thl);
445 /* prepare tcp hdr */ 445 /* prepare tcp hdr */
446 if (data_len == (eddp->skb->len - eddp->skb_offset)){ 446 if (data_len == (eddp->skb->len - eddp->skb_offset)){
447 /* last segment -> set FIN and PSH flags */ 447 /* last segment -> set FIN and PSH flags */
448 eddp->th.tcp.h.fin = tcph->fin; 448 eddp->th.tcp.h.fin = tcph->fin;
449 eddp->th.tcp.h.psh = tcph->psh; 449 eddp->th.tcp.h.psh = tcph->psh;
450 } 450 }
451 if (eddp->skb->protocol == ETH_P_IP) 451 if (eddp->skb->protocol == htons(ETH_P_IP))
452 hcsum = qeth_eddp_check_tcp4_hdr(eddp, data_len); 452 hcsum = qeth_eddp_check_tcp4_hdr(eddp, data_len);
453 else 453 else
454 hcsum = qeth_eddp_check_tcp6_hdr(eddp, data_len); 454 hcsum = qeth_eddp_check_tcp6_hdr(eddp, data_len);
@@ -458,9 +458,9 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
458 if (eddp->skb_offset >= eddp->skb->len) 458 if (eddp->skb_offset >= eddp->skb->len)
459 break; 459 break;
460 /* prepare headers for next round */ 460 /* prepare headers for next round */
461 if (eddp->skb->protocol == ETH_P_IP) 461 if (eddp->skb->protocol == htons(ETH_P_IP))
462 eddp->nh.ip4.h.id++; 462 eddp->nh.ip4.h.id = htons(ntohs(eddp->nh.ip4.h.id) + 1);
463 eddp->th.tcp.h.seq += data_len; 463 eddp->th.tcp.h.seq = htonl(ntohl(eddp->th.tcp.h.seq) + data_len);
464 } 464 }
465} 465}
466 466
@@ -472,7 +472,7 @@ qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
472 472
473 QETH_DBF_TEXT(trace, 5, "eddpficx"); 473 QETH_DBF_TEXT(trace, 5, "eddpficx");
474 /* create our segmentation headers and copy original headers */ 474 /* create our segmentation headers and copy original headers */
475 if (skb->protocol == ETH_P_IP) 475 if (skb->protocol == htons(ETH_P_IP))
476 eddp = qeth_eddp_create_eddp_data(qhdr, (u8 *)skb->nh.iph, 476 eddp = qeth_eddp_create_eddp_data(qhdr, (u8 *)skb->nh.iph,
477 skb->nh.iph->ihl*4, 477 skb->nh.iph->ihl*4,
478 (u8 *)skb->h.th, skb->h.th->doff*4); 478 (u8 *)skb->h.th, skb->h.th->doff*4);
@@ -490,7 +490,7 @@ qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
490 memcpy(&eddp->mac, eth_hdr(skb), ETH_HLEN); 490 memcpy(&eddp->mac, eth_hdr(skb), ETH_HLEN);
491#ifdef CONFIG_QETH_VLAN 491#ifdef CONFIG_QETH_VLAN
492 if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q)) { 492 if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q)) {
493 eddp->vlan[0] = __constant_htons(skb->protocol); 493 eddp->vlan[0] = skb->protocol;
494 eddp->vlan[1] = htons(vlan_tx_tag_get(skb)); 494 eddp->vlan[1] = htons(vlan_tx_tag_get(skb));
495 } 495 }
496#endif /* CONFIG_QETH_VLAN */ 496#endif /* CONFIG_QETH_VLAN */
@@ -588,11 +588,11 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb,
588 struct qeth_eddp_context *ctx = NULL; 588 struct qeth_eddp_context *ctx = NULL;
589 589
590 QETH_DBF_TEXT(trace, 5, "creddpct"); 590 QETH_DBF_TEXT(trace, 5, "creddpct");
591 if (skb->protocol == ETH_P_IP) 591 if (skb->protocol == htons(ETH_P_IP))
592 ctx = qeth_eddp_create_context_generic(card, skb, 592 ctx = qeth_eddp_create_context_generic(card, skb,
593 sizeof(struct qeth_hdr) + skb->nh.iph->ihl*4 + 593 sizeof(struct qeth_hdr) + skb->nh.iph->ihl*4 +
594 skb->h.th->doff*4); 594 skb->h.th->doff*4);
595 else if (skb->protocol == ETH_P_IPV6) 595 else if (skb->protocol == htons(ETH_P_IPV6))
596 ctx = qeth_eddp_create_context_generic(card, skb, 596 ctx = qeth_eddp_create_context_generic(card, skb,
597 sizeof(struct qeth_hdr) + sizeof(struct ipv6hdr) + 597 sizeof(struct qeth_hdr) + sizeof(struct ipv6hdr) +
598 skb->h.th->doff*4); 598 skb->h.th->doff*4);