aboutsummaryrefslogtreecommitdiffstats
path: root/net/6lowpan
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-07-29 21:48:40 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-30 13:28:40 -0400
commit89f534905ad6e7f18d89759efcbfc8225f254de1 (patch)
tree35e5f9076c4b6e4d9a3842cf81587c18532a9192 /net/6lowpan
parent004942445da78b6fd250dc933c5d7859fde8fb1f (diff)
6lowpan: iphc: Fix block comments to match networking style
This patch fixes all the block comment issues found by checkpatch.pl and makes them match the network style now. WARNING: networking block comments don't use an empty /* line, use /* Comment... +/* + * Based on patches from Jon Smirl <jonsmirl@gmail.com> WARNING: networking block comments don't use an empty /* line, use /* Comment... +/* + * Uncompress address function for source and WARNING: networking block comments don't use an empty /* line, use /* Comment... +/* + * Uncompress address function for source context WARNING: networking block comments don't use an empty /* line, use /* Comment... + /* + * UDP lenght needs to be infered from the lower layers WARNING: networking block comments don't use an empty /* line, use /* Comment... + /* + * Traffic Class and FLow Label carried in-line WARNING: networking block comments don't use an empty /* line, use /* Comment... + /* + * Traffic class carried in-line WARNING: networking block comments don't use an empty /* line, use /* Comment... + /* + * Flow Label carried in-line WARNING: networking block comments don't use an empty /* line, use /* Comment... + /* + * replace the compressed UDP head by the uncompressed UDP WARNING: networking block comments don't use an empty /* line, use /* Comment... + /* + * As we copy some bit-length fields, in the IPHC encoding bytes, WARNING: networking block comments don't use an empty /* line, use /* Comment... + /* + * Traffic class, flow label WARNING: networking block comments don't use an empty /* line, use /* Comment... + /* + * Hop limit Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/6lowpan')
-rw-r--r--net/6lowpan/iphc.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
index de78deb49959..3069eb615ace 100644
--- a/net/6lowpan/iphc.c
+++ b/net/6lowpan/iphc.c
@@ -3,8 +3,7 @@
3 * written by Alexander Smirnov <alex.bluesman.smirnov@gmail.com> 3 * written by Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
4 */ 4 */
5 5
6/* 6/* Based on patches from Jon Smirl <jonsmirl@gmail.com>
7 * Based on patches from Jon Smirl <jonsmirl@gmail.com>
8 * Copyright (c) 2011 Jon Smirl <jonsmirl@gmail.com> 7 * Copyright (c) 2011 Jon Smirl <jonsmirl@gmail.com>
9 * 8 *
10 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -58,8 +57,7 @@
58#include <net/ipv6.h> 57#include <net/ipv6.h>
59#include <net/af_ieee802154.h> 58#include <net/af_ieee802154.h>
60 59
61/* 60/* Uncompress address function for source and
62 * Uncompress address function for source and
63 * destination address(non-multicast). 61 * destination address(non-multicast).
64 * 62 *
65 * address_mode is sam value or dam value. 63 * address_mode is sam value or dam value.
@@ -140,8 +138,7 @@ static int uncompress_addr(struct sk_buff *skb,
140 return 0; 138 return 0;
141} 139}
142 140
143/* 141/* Uncompress address function for source context
144 * Uncompress address function for source context
145 * based address(non-multicast). 142 * based address(non-multicast).
146 */ 143 */
147static int uncompress_context_based_src_addr(struct sk_buff *skb, 144static int uncompress_context_based_src_addr(struct sk_buff *skb,
@@ -316,8 +313,7 @@ uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh)
316 sizeof(uh->check)); 313 sizeof(uh->check));
317 } 314 }
318 315
319 /* 316 /* UDP length needs to be infered from the lower layers
320 * UDP lenght needs to be infered from the lower layers
321 * here, we obtain the hint from the remaining size of the 317 * here, we obtain the hint from the remaining size of the
322 * frame 318 * frame
323 */ 319 */
@@ -362,8 +358,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
362 358
363 /* Traffic Class and Flow Label */ 359 /* Traffic Class and Flow Label */
364 switch ((iphc0 & LOWPAN_IPHC_TF) >> 3) { 360 switch ((iphc0 & LOWPAN_IPHC_TF) >> 3) {
365 /* 361 /* Traffic Class and FLow Label carried in-line
366 * Traffic Class and FLow Label carried in-line
367 * ECN + DSCP + 4-bit Pad + Flow Label (4 bytes) 362 * ECN + DSCP + 4-bit Pad + Flow Label (4 bytes)
368 */ 363 */
369 case 0: /* 00b */ 364 case 0: /* 00b */
@@ -376,8 +371,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
376 hdr.flow_lbl[0] = ((tmp >> 2) & 0x30) | (tmp << 6) | 371 hdr.flow_lbl[0] = ((tmp >> 2) & 0x30) | (tmp << 6) |
377 (hdr.flow_lbl[0] & 0x0f); 372 (hdr.flow_lbl[0] & 0x0f);
378 break; 373 break;
379 /* 374 /* Traffic class carried in-line
380 * Traffic class carried in-line
381 * ECN + DSCP (1 byte), Flow Label is elided 375 * ECN + DSCP (1 byte), Flow Label is elided
382 */ 376 */
383 case 2: /* 10b */ 377 case 2: /* 10b */
@@ -387,8 +381,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
387 hdr.priority = ((tmp >> 2) & 0x0f); 381 hdr.priority = ((tmp >> 2) & 0x0f);
388 hdr.flow_lbl[0] = ((tmp << 6) & 0xC0) | ((tmp >> 2) & 0x30); 382 hdr.flow_lbl[0] = ((tmp << 6) & 0xC0) | ((tmp >> 2) & 0x30);
389 break; 383 break;
390 /* 384 /* Flow Label carried in-line
391 * Flow Label carried in-line
392 * ECN + 2-bit Pad + Flow Label (3 bytes), DSCP is elided 385 * ECN + 2-bit Pad + Flow Label (3 bytes), DSCP is elided
393 */ 386 */
394 case 1: /* 01b */ 387 case 1: /* 01b */
@@ -474,8 +467,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
474 if (uncompress_udp_header(skb, &uh)) 467 if (uncompress_udp_header(skb, &uh))
475 goto drop; 468 goto drop;
476 469
477 /* 470 /* replace the compressed UDP head by the uncompressed UDP
478 * replace the compressed UDP head by the uncompressed UDP
479 * header 471 * header
480 */ 472 */
481 new = skb_copy_expand(skb, sizeof(struct udphdr), 473 new = skb_copy_expand(skb, sizeof(struct udphdr),
@@ -624,8 +616,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
624 raw_dump_table(__func__, "raw skb network header dump", 616 raw_dump_table(__func__, "raw skb network header dump",
625 skb_network_header(skb), sizeof(struct ipv6hdr)); 617 skb_network_header(skb), sizeof(struct ipv6hdr));
626 618
627 /* 619 /* As we copy some bit-length fields, in the IPHC encoding bytes,
628 * As we copy some bit-length fields, in the IPHC encoding bytes,
629 * we sometimes use |= 620 * we sometimes use |=
630 * If the field is 0, and the current bit value in memory is 1, 621 * If the field is 0, and the current bit value in memory is 1,
631 * this does not work. We therefore reset the IPHC encoding here 622 * this does not work. We therefore reset the IPHC encoding here
@@ -644,8 +635,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
644 "sending raw skb network uncompressed packet", 635 "sending raw skb network uncompressed packet",
645 skb->data, skb->len); 636 skb->data, skb->len);
646 637
647 /* 638 /* Traffic class, flow label
648 * Traffic class, flow label
649 * If flow label is 0, compress it. If traffic class is 0, compress it 639 * If flow label is 0, compress it. If traffic class is 0, compress it
650 * We have to process both in the same time as the offset of traffic 640 * We have to process both in the same time as the offset of traffic
651 * class depends on the presence of version and flow label 641 * class depends on the presence of version and flow label
@@ -696,8 +686,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
696 lowpan_push_hc_data(&hc_ptr, &hdr->nexthdr, 686 lowpan_push_hc_data(&hc_ptr, &hdr->nexthdr,
697 sizeof(hdr->nexthdr)); 687 sizeof(hdr->nexthdr));
698 688
699 /* 689 /* Hop limit
700 * Hop limit
701 * if 1: compress, encoding is 01 690 * if 1: compress, encoding is 01
702 * if 64: compress, encoding is 10 691 * if 64: compress, encoding is 10
703 * if 255: compress, encoding is 11 692 * if 255: compress, encoding is 11