diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-11-27 03:12:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-27 03:12:47 -0500 |
commit | c4106aa88a440430d387e022f2ad6dc1e0d52e98 (patch) | |
tree | 09064e6e767301ca28357ed5125e99123f5beaca /net/decnet/dn_nsp_in.c | |
parent | 5b9ab2ec04ec1e1e53939768805612ac191d7ba2 (diff) |
decnet: remove private wrappers of endian helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Reviewed-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/dn_nsp_in.c')
-rw-r--r-- | net/decnet/dn_nsp_in.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c index 4074a6e5d0de..5d8a2a56fd39 100644 --- a/net/decnet/dn_nsp_in.c +++ b/net/decnet/dn_nsp_in.c | |||
@@ -83,7 +83,9 @@ static void dn_log_martian(struct sk_buff *skb, const char *msg) | |||
83 | if (decnet_log_martians && net_ratelimit()) { | 83 | if (decnet_log_martians && net_ratelimit()) { |
84 | char *devname = skb->dev ? skb->dev->name : "???"; | 84 | char *devname = skb->dev ? skb->dev->name : "???"; |
85 | struct dn_skb_cb *cb = DN_SKB_CB(skb); | 85 | struct dn_skb_cb *cb = DN_SKB_CB(skb); |
86 | printk(KERN_INFO "DECnet: Martian packet (%s) dev=%s src=0x%04hx dst=0x%04hx srcport=0x%04hx dstport=0x%04hx\n", msg, devname, dn_ntohs(cb->src), dn_ntohs(cb->dst), dn_ntohs(cb->src_port), dn_ntohs(cb->dst_port)); | 86 | printk(KERN_INFO "DECnet: Martian packet (%s) dev=%s src=0x%04hx dst=0x%04hx srcport=0x%04hx dstport=0x%04hx\n", |
87 | msg, devname, le16_to_cpu(cb->src), le16_to_cpu(cb->dst), | ||
88 | le16_to_cpu(cb->src_port), le16_to_cpu(cb->dst_port)); | ||
87 | } | 89 | } |
88 | } | 90 | } |
89 | 91 | ||
@@ -133,7 +135,7 @@ static int dn_process_ack(struct sock *sk, struct sk_buff *skb, int oth) | |||
133 | if (skb->len < 2) | 135 | if (skb->len < 2) |
134 | return len; | 136 | return len; |
135 | 137 | ||
136 | if ((ack = dn_ntohs(*ptr)) & 0x8000) { | 138 | if ((ack = le16_to_cpu(*ptr)) & 0x8000) { |
137 | skb_pull(skb, 2); | 139 | skb_pull(skb, 2); |
138 | ptr++; | 140 | ptr++; |
139 | len += 2; | 141 | len += 2; |
@@ -147,7 +149,7 @@ static int dn_process_ack(struct sock *sk, struct sk_buff *skb, int oth) | |||
147 | if (skb->len < 2) | 149 | if (skb->len < 2) |
148 | return len; | 150 | return len; |
149 | 151 | ||
150 | if ((ack = dn_ntohs(*ptr)) & 0x8000) { | 152 | if ((ack = le16_to_cpu(*ptr)) & 0x8000) { |
151 | skb_pull(skb, 2); | 153 | skb_pull(skb, 2); |
152 | len += 2; | 154 | len += 2; |
153 | if ((ack & 0x4000) == 0) { | 155 | if ((ack & 0x4000) == 0) { |
@@ -237,7 +239,7 @@ static struct sock *dn_find_listener(struct sk_buff *skb, unsigned short *reason | |||
237 | cb->dst_port = msg->dstaddr; | 239 | cb->dst_port = msg->dstaddr; |
238 | cb->services = msg->services; | 240 | cb->services = msg->services; |
239 | cb->info = msg->info; | 241 | cb->info = msg->info; |
240 | cb->segsize = dn_ntohs(msg->segsize); | 242 | cb->segsize = le16_to_cpu(msg->segsize); |
241 | 243 | ||
242 | if (!pskb_may_pull(skb, sizeof(*msg))) | 244 | if (!pskb_may_pull(skb, sizeof(*msg))) |
243 | goto err_out; | 245 | goto err_out; |
@@ -344,7 +346,7 @@ static void dn_nsp_conn_conf(struct sock *sk, struct sk_buff *skb) | |||
344 | ptr = skb->data; | 346 | ptr = skb->data; |
345 | cb->services = *ptr++; | 347 | cb->services = *ptr++; |
346 | cb->info = *ptr++; | 348 | cb->info = *ptr++; |
347 | cb->segsize = dn_ntohs(*(__le16 *)ptr); | 349 | cb->segsize = le16_to_cpu(*(__le16 *)ptr); |
348 | 350 | ||
349 | if ((scp->state == DN_CI) || (scp->state == DN_CD)) { | 351 | if ((scp->state == DN_CI) || (scp->state == DN_CD)) { |
350 | scp->persist = 0; | 352 | scp->persist = 0; |
@@ -361,7 +363,7 @@ static void dn_nsp_conn_conf(struct sock *sk, struct sk_buff *skb) | |||
361 | if (skb->len > 0) { | 363 | if (skb->len > 0) { |
362 | u16 dlen = *skb->data; | 364 | u16 dlen = *skb->data; |
363 | if ((dlen <= 16) && (dlen <= skb->len)) { | 365 | if ((dlen <= 16) && (dlen <= skb->len)) { |
364 | scp->conndata_in.opt_optl = dn_htons(dlen); | 366 | scp->conndata_in.opt_optl = cpu_to_le16(dlen); |
365 | skb_copy_from_linear_data_offset(skb, 1, | 367 | skb_copy_from_linear_data_offset(skb, 1, |
366 | scp->conndata_in.opt_data, dlen); | 368 | scp->conndata_in.opt_data, dlen); |
367 | } | 369 | } |
@@ -396,17 +398,17 @@ static void dn_nsp_disc_init(struct sock *sk, struct sk_buff *skb) | |||
396 | if (skb->len < 2) | 398 | if (skb->len < 2) |
397 | goto out; | 399 | goto out; |
398 | 400 | ||
399 | reason = dn_ntohs(*(__le16 *)skb->data); | 401 | reason = le16_to_cpu(*(__le16 *)skb->data); |
400 | skb_pull(skb, 2); | 402 | skb_pull(skb, 2); |
401 | 403 | ||
402 | scp->discdata_in.opt_status = dn_htons(reason); | 404 | scp->discdata_in.opt_status = cpu_to_le16(reason); |
403 | scp->discdata_in.opt_optl = 0; | 405 | scp->discdata_in.opt_optl = 0; |
404 | memset(scp->discdata_in.opt_data, 0, 16); | 406 | memset(scp->discdata_in.opt_data, 0, 16); |
405 | 407 | ||
406 | if (skb->len > 0) { | 408 | if (skb->len > 0) { |
407 | u16 dlen = *skb->data; | 409 | u16 dlen = *skb->data; |
408 | if ((dlen <= 16) && (dlen <= skb->len)) { | 410 | if ((dlen <= 16) && (dlen <= skb->len)) { |
409 | scp->discdata_in.opt_optl = dn_htons(dlen); | 411 | scp->discdata_in.opt_optl = cpu_to_le16(dlen); |
410 | skb_copy_from_linear_data_offset(skb, 1, scp->discdata_in.opt_data, dlen); | 412 | skb_copy_from_linear_data_offset(skb, 1, scp->discdata_in.opt_data, dlen); |
411 | } | 413 | } |
412 | } | 414 | } |
@@ -463,7 +465,7 @@ static void dn_nsp_disc_conf(struct sock *sk, struct sk_buff *skb) | |||
463 | if (skb->len != 2) | 465 | if (skb->len != 2) |
464 | goto out; | 466 | goto out; |
465 | 467 | ||
466 | reason = dn_ntohs(*(__le16 *)skb->data); | 468 | reason = le16_to_cpu(*(__le16 *)skb->data); |
467 | 469 | ||
468 | sk->sk_state = TCP_CLOSE; | 470 | sk->sk_state = TCP_CLOSE; |
469 | 471 | ||
@@ -512,7 +514,7 @@ static void dn_nsp_linkservice(struct sock *sk, struct sk_buff *skb) | |||
512 | if (skb->len != 4) | 514 | if (skb->len != 4) |
513 | goto out; | 515 | goto out; |
514 | 516 | ||
515 | segnum = dn_ntohs(*(__le16 *)ptr); | 517 | segnum = le16_to_cpu(*(__le16 *)ptr); |
516 | ptr += 2; | 518 | ptr += 2; |
517 | lsflags = *(unsigned char *)ptr++; | 519 | lsflags = *(unsigned char *)ptr++; |
518 | fcval = *ptr; | 520 | fcval = *ptr; |
@@ -620,7 +622,7 @@ static void dn_nsp_otherdata(struct sock *sk, struct sk_buff *skb) | |||
620 | if (skb->len < 2) | 622 | if (skb->len < 2) |
621 | goto out; | 623 | goto out; |
622 | 624 | ||
623 | cb->segnum = segnum = dn_ntohs(*(__le16 *)skb->data); | 625 | cb->segnum = segnum = le16_to_cpu(*(__le16 *)skb->data); |
624 | skb_pull(skb, 2); | 626 | skb_pull(skb, 2); |
625 | 627 | ||
626 | if (seq_next(scp->numoth_rcv, segnum)) { | 628 | if (seq_next(scp->numoth_rcv, segnum)) { |
@@ -648,7 +650,7 @@ static void dn_nsp_data(struct sock *sk, struct sk_buff *skb) | |||
648 | if (skb->len < 2) | 650 | if (skb->len < 2) |
649 | goto out; | 651 | goto out; |
650 | 652 | ||
651 | cb->segnum = segnum = dn_ntohs(*(__le16 *)skb->data); | 653 | cb->segnum = segnum = le16_to_cpu(*(__le16 *)skb->data); |
652 | skb_pull(skb, 2); | 654 | skb_pull(skb, 2); |
653 | 655 | ||
654 | if (seq_next(scp->numdat_rcv, segnum)) { | 656 | if (seq_next(scp->numdat_rcv, segnum)) { |