Commit 5a5a852e authored by Al Viro's avatar Al Viro Committed by David S. Miller

[NET] driver/s390/net: Checksum annotations.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 43bc0ca7
...@@ -1147,7 +1147,7 @@ lcs_fix_multicast_list(struct lcs_card *card) ...@@ -1147,7 +1147,7 @@ lcs_fix_multicast_list(struct lcs_card *card)
* get mac address for the relevant Multicast address * get mac address for the relevant Multicast address
*/ */
static void static void
lcs_get_mac_for_ipm(__u32 ipm, char *mac, struct net_device *dev) lcs_get_mac_for_ipm(__be32 ipm, char *mac, struct net_device *dev)
{ {
LCS_DBF_TEXT(4,trace, "getmac"); LCS_DBF_TEXT(4,trace, "getmac");
if (dev->type == ARPHRD_IEEE802_TR) if (dev->type == ARPHRD_IEEE802_TR)
......
...@@ -169,7 +169,7 @@ struct lcs_header { ...@@ -169,7 +169,7 @@ struct lcs_header {
} __attribute__ ((packed)); } __attribute__ ((packed));
struct lcs_ip_mac_pair { struct lcs_ip_mac_pair {
__u32 ip_addr; __be32 ip_addr;
__u8 mac_addr[LCS_MAC_LENGTH]; __u8 mac_addr[LCS_MAC_LENGTH];
__u8 reserved[2]; __u8 reserved[2];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -287,7 +287,7 @@ struct lcs_card { ...@@ -287,7 +287,7 @@ struct lcs_card {
enum lcs_dev_states state; enum lcs_dev_states state;
struct net_device *dev; struct net_device *dev;
struct net_device_stats stats; struct net_device_stats stats;
unsigned short (*lan_type_trans)(struct sk_buff *skb, __be16 (*lan_type_trans)(struct sk_buff *skb,
struct net_device *dev); struct net_device *dev);
struct ccwgroup_device *gdev; struct ccwgroup_device *gdev;
struct lcs_channel read; struct lcs_channel read;
......
...@@ -258,7 +258,7 @@ qeth_eddp_create_segment_hdrs(struct qeth_eddp_context *ctx, ...@@ -258,7 +258,7 @@ qeth_eddp_create_segment_hdrs(struct qeth_eddp_context *ctx,
static inline void static inline void
qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len, qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len,
u32 *hcsum) __wsum *hcsum)
{ {
struct skb_frag_struct *frag; struct skb_frag_struct *frag;
int left_in_frag; int left_in_frag;
...@@ -305,7 +305,7 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len, ...@@ -305,7 +305,7 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len,
static inline void static inline void
qeth_eddp_create_segment_data_tcp(struct qeth_eddp_context *ctx, qeth_eddp_create_segment_data_tcp(struct qeth_eddp_context *ctx,
struct qeth_eddp_data *eddp, int data_len, struct qeth_eddp_data *eddp, int data_len,
u32 hcsum) __wsum hcsum)
{ {
u8 *page; u8 *page;
int page_remainder; int page_remainder;
...@@ -349,10 +349,10 @@ qeth_eddp_create_segment_data_tcp(struct qeth_eddp_context *ctx, ...@@ -349,10 +349,10 @@ qeth_eddp_create_segment_data_tcp(struct qeth_eddp_context *ctx,
((struct tcphdr *)eddp->th_in_ctx)->check = csum_fold(hcsum); ((struct tcphdr *)eddp->th_in_ctx)->check = csum_fold(hcsum);
} }
static inline u32 static inline __wsum
qeth_eddp_check_tcp4_hdr(struct qeth_eddp_data *eddp, int data_len) qeth_eddp_check_tcp4_hdr(struct qeth_eddp_data *eddp, int data_len)
{ {
u32 phcsum; /* pseudo header checksum */ __wsum phcsum; /* pseudo header checksum */
QETH_DBF_TEXT(trace, 5, "eddpckt4"); QETH_DBF_TEXT(trace, 5, "eddpckt4");
eddp->th.tcp.h.check = 0; eddp->th.tcp.h.check = 0;
...@@ -363,11 +363,11 @@ qeth_eddp_check_tcp4_hdr(struct qeth_eddp_data *eddp, int data_len) ...@@ -363,11 +363,11 @@ qeth_eddp_check_tcp4_hdr(struct qeth_eddp_data *eddp, int data_len)
return csum_partial((u8 *)&eddp->th, eddp->thl, phcsum); return csum_partial((u8 *)&eddp->th, eddp->thl, phcsum);
} }
static inline u32 static inline __wsum
qeth_eddp_check_tcp6_hdr(struct qeth_eddp_data *eddp, int data_len) qeth_eddp_check_tcp6_hdr(struct qeth_eddp_data *eddp, int data_len)
{ {
u32 proto; __be32 proto;
u32 phcsum; /* pseudo header checksum */ __wsum phcsum; /* pseudo header checksum */
QETH_DBF_TEXT(trace, 5, "eddpckt6"); QETH_DBF_TEXT(trace, 5, "eddpckt6");
eddp->th.tcp.h.check = 0; eddp->th.tcp.h.check = 0;
...@@ -405,7 +405,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, ...@@ -405,7 +405,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
{ {
struct tcphdr *tcph; struct tcphdr *tcph;
int data_len; int data_len;
u32 hcsum; __wsum hcsum;
QETH_DBF_TEXT(trace, 5, "eddpftcp"); QETH_DBF_TEXT(trace, 5, "eddpftcp");
eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl; 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,22 +433,22 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
eddp->qh.hdr.l3.length = data_len + eddp->nhl + eddp->qh.hdr.l3.length = data_len + eddp->nhl +
eddp->thl; eddp->thl;
/* prepare ip hdr */ /* prepare ip hdr */
if (eddp->skb->protocol == ETH_P_IP){ if (eddp->skb->protocol == htons(ETH_P_IP)){
eddp->nh.ip4.h.tot_len = data_len + eddp->nhl + eddp->nh.ip4.h.tot_len = htons(data_len + eddp->nhl +
eddp->thl; eddp->thl);
eddp->nh.ip4.h.check = 0; eddp->nh.ip4.h.check = 0;
eddp->nh.ip4.h.check = eddp->nh.ip4.h.check =
ip_fast_csum((u8 *)&eddp->nh.ip4.h, ip_fast_csum((u8 *)&eddp->nh.ip4.h,
eddp->nh.ip4.h.ihl); eddp->nh.ip4.h.ihl);
} else } else
eddp->nh.ip6.h.payload_len = data_len + eddp->thl; eddp->nh.ip6.h.payload_len = htons(data_len + eddp->thl);
/* prepare tcp hdr */ /* prepare tcp hdr */
if (data_len == (eddp->skb->len - eddp->skb_offset)){ if (data_len == (eddp->skb->len - eddp->skb_offset)){
/* last segment -> set FIN and PSH flags */ /* last segment -> set FIN and PSH flags */
eddp->th.tcp.h.fin = tcph->fin; eddp->th.tcp.h.fin = tcph->fin;
eddp->th.tcp.h.psh = tcph->psh; eddp->th.tcp.h.psh = tcph->psh;
} }
if (eddp->skb->protocol == ETH_P_IP) if (eddp->skb->protocol == htons(ETH_P_IP))
hcsum = qeth_eddp_check_tcp4_hdr(eddp, data_len); hcsum = qeth_eddp_check_tcp4_hdr(eddp, data_len);
else else
hcsum = qeth_eddp_check_tcp6_hdr(eddp, data_len); hcsum = qeth_eddp_check_tcp6_hdr(eddp, data_len);
...@@ -458,9 +458,9 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, ...@@ -458,9 +458,9 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
if (eddp->skb_offset >= eddp->skb->len) if (eddp->skb_offset >= eddp->skb->len)
break; break;
/* prepare headers for next round */ /* prepare headers for next round */
if (eddp->skb->protocol == ETH_P_IP) if (eddp->skb->protocol == htons(ETH_P_IP))
eddp->nh.ip4.h.id++; eddp->nh.ip4.h.id = htons(ntohs(eddp->nh.ip4.h.id) + 1);
eddp->th.tcp.h.seq += data_len; eddp->th.tcp.h.seq = htonl(ntohl(eddp->th.tcp.h.seq) + data_len);
} }
} }
...@@ -472,7 +472,7 @@ qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, ...@@ -472,7 +472,7 @@ qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
QETH_DBF_TEXT(trace, 5, "eddpficx"); QETH_DBF_TEXT(trace, 5, "eddpficx");
/* create our segmentation headers and copy original headers */ /* create our segmentation headers and copy original headers */
if (skb->protocol == ETH_P_IP) if (skb->protocol == htons(ETH_P_IP))
eddp = qeth_eddp_create_eddp_data(qhdr, (u8 *)skb->nh.iph, eddp = qeth_eddp_create_eddp_data(qhdr, (u8 *)skb->nh.iph,
skb->nh.iph->ihl*4, skb->nh.iph->ihl*4,
(u8 *)skb->h.th, skb->h.th->doff*4); (u8 *)skb->h.th, skb->h.th->doff*4);
...@@ -490,7 +490,7 @@ qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, ...@@ -490,7 +490,7 @@ qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
memcpy(&eddp->mac, eth_hdr(skb), ETH_HLEN); memcpy(&eddp->mac, eth_hdr(skb), ETH_HLEN);
#ifdef CONFIG_QETH_VLAN #ifdef CONFIG_QETH_VLAN
if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q)) { if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q)) {
eddp->vlan[0] = __constant_htons(skb->protocol); eddp->vlan[0] = skb->protocol;
eddp->vlan[1] = htons(vlan_tx_tag_get(skb)); eddp->vlan[1] = htons(vlan_tx_tag_get(skb));
} }
#endif /* CONFIG_QETH_VLAN */ #endif /* CONFIG_QETH_VLAN */
...@@ -588,11 +588,11 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb, ...@@ -588,11 +588,11 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb,
struct qeth_eddp_context *ctx = NULL; struct qeth_eddp_context *ctx = NULL;
QETH_DBF_TEXT(trace, 5, "creddpct"); QETH_DBF_TEXT(trace, 5, "creddpct");
if (skb->protocol == ETH_P_IP) if (skb->protocol == htons(ETH_P_IP))
ctx = qeth_eddp_create_context_generic(card, skb, ctx = qeth_eddp_create_context_generic(card, skb,
sizeof(struct qeth_hdr) + skb->nh.iph->ihl*4 + sizeof(struct qeth_hdr) + skb->nh.iph->ihl*4 +
skb->h.th->doff*4); skb->h.th->doff*4);
else if (skb->protocol == ETH_P_IPV6) else if (skb->protocol == htons(ETH_P_IPV6))
ctx = qeth_eddp_create_context_generic(card, skb, ctx = qeth_eddp_create_context_generic(card, skb,
sizeof(struct qeth_hdr) + sizeof(struct ipv6hdr) + sizeof(struct qeth_hdr) + sizeof(struct ipv6hdr) +
skb->h.th->doff*4); skb->h.th->doff*4);
......
...@@ -54,7 +54,7 @@ qeth_eddp_check_buffers_for_context(struct qeth_qdio_out_q *, ...@@ -54,7 +54,7 @@ qeth_eddp_check_buffers_for_context(struct qeth_qdio_out_q *,
struct qeth_eddp_data { struct qeth_eddp_data {
struct qeth_hdr qh; struct qeth_hdr qh;
struct ethhdr mac; struct ethhdr mac;
u16 vlan[2]; __be16 vlan[2];
union { union {
struct { struct {
struct iphdr h; struct iphdr h;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment