diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-15 00:43:44 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:23:43 -0500 |
commit | 5a5a852e45b651c71dfeb3972b30d58742f8941e (patch) | |
tree | 1471e45e6d34cc4e10689e6817f54e75f84bdc10 /drivers/s390 | |
parent | 43bc0ca7eadc024e9e5b935fa5e0892df4fec9eb (diff) |
[NET] driver/s390/net: Checksum annotations.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/lcs.c | 2 | ||||
-rw-r--r-- | drivers/s390/net/lcs.h | 4 | ||||
-rw-r--r-- | drivers/s390/net/qeth_eddp.c | 40 | ||||
-rw-r--r-- | drivers/s390/net/qeth_eddp.h | 2 |
4 files changed, 24 insertions, 24 deletions
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index 16ac68c27a27..66a8aec6efa6 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c | |||
@@ -1147,7 +1147,7 @@ list_modified: | |||
1147 | * get mac address for the relevant Multicast address | 1147 | * get mac address for the relevant Multicast address |
1148 | */ | 1148 | */ |
1149 | static void | 1149 | static void |
1150 | lcs_get_mac_for_ipm(__u32 ipm, char *mac, struct net_device *dev) | 1150 | lcs_get_mac_for_ipm(__be32 ipm, char *mac, struct net_device *dev) |
1151 | { | 1151 | { |
1152 | LCS_DBF_TEXT(4,trace, "getmac"); | 1152 | LCS_DBF_TEXT(4,trace, "getmac"); |
1153 | if (dev->type == ARPHRD_IEEE802_TR) | 1153 | if (dev->type == ARPHRD_IEEE802_TR) |
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h index 93143932983b..b5247dc08b57 100644 --- a/drivers/s390/net/lcs.h +++ b/drivers/s390/net/lcs.h | |||
@@ -169,7 +169,7 @@ struct lcs_header { | |||
169 | } __attribute__ ((packed)); | 169 | } __attribute__ ((packed)); |
170 | 170 | ||
171 | struct lcs_ip_mac_pair { | 171 | struct lcs_ip_mac_pair { |
172 | __u32 ip_addr; | 172 | __be32 ip_addr; |
173 | __u8 mac_addr[LCS_MAC_LENGTH]; | 173 | __u8 mac_addr[LCS_MAC_LENGTH]; |
174 | __u8 reserved[2]; | 174 | __u8 reserved[2]; |
175 | } __attribute__ ((packed)); | 175 | } __attribute__ ((packed)); |
@@ -287,7 +287,7 @@ struct lcs_card { | |||
287 | enum lcs_dev_states state; | 287 | enum lcs_dev_states state; |
288 | struct net_device *dev; | 288 | struct net_device *dev; |
289 | struct net_device_stats stats; | 289 | struct net_device_stats stats; |
290 | unsigned short (*lan_type_trans)(struct sk_buff *skb, | 290 | __be16 (*lan_type_trans)(struct sk_buff *skb, |
291 | struct net_device *dev); | 291 | struct net_device *dev); |
292 | struct ccwgroup_device *gdev; | 292 | struct ccwgroup_device *gdev; |
293 | struct lcs_channel read; | 293 | struct lcs_channel read; |
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 | ||
259 | static inline void | 259 | static inline void |
260 | qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len, | 260 | qeth_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, | |||
305 | static inline void | 305 | static inline void |
306 | qeth_eddp_create_segment_data_tcp(struct qeth_eddp_context *ctx, | 306 | qeth_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 | ||
352 | static inline u32 | 352 | static inline __wsum |
353 | qeth_eddp_check_tcp4_hdr(struct qeth_eddp_data *eddp, int data_len) | 353 | qeth_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 | ||
366 | static inline u32 | 366 | static inline __wsum |
367 | qeth_eddp_check_tcp6_hdr(struct qeth_eddp_data *eddp, int data_len) | 367 | qeth_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); |
diff --git a/drivers/s390/net/qeth_eddp.h b/drivers/s390/net/qeth_eddp.h index cae9ba265056..103768d3bab2 100644 --- a/drivers/s390/net/qeth_eddp.h +++ b/drivers/s390/net/qeth_eddp.h | |||
@@ -54,7 +54,7 @@ qeth_eddp_check_buffers_for_context(struct qeth_qdio_out_q *, | |||
54 | struct qeth_eddp_data { | 54 | struct qeth_eddp_data { |
55 | struct qeth_hdr qh; | 55 | struct qeth_hdr qh; |
56 | struct ethhdr mac; | 56 | struct ethhdr mac; |
57 | u16 vlan[2]; | 57 | __be16 vlan[2]; |
58 | union { | 58 | union { |
59 | struct { | 59 | struct { |
60 | struct iphdr h; | 60 | struct iphdr h; |