Re: [Linux-zigbee-devel] [PATCH 03/12] 6lowpan: init 6lowpan header and ipv6hdr to zero

2013-07-24 Thread Werner Almesberger
Alexander Aring wrote:
> u8 head[100] = {};

What I mean is: I don't see the original code doing a memset on
"head", so I'm a bit puzzled why you have to do this now.

Was the original code broken by not zeroing "head" ? If yes,
that would be a bug fix, not a mere optimization.

Or did I overlook something ?

> It's ugly to make the 100 byte magic number here, what we need is a
> number MAX_LOWPAN_HEADER_LENGTH.

Yeah, since you have that evil [100] in the patch, it will draw
attention :)

- Werner

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


Re: [Linux-zigbee-devel] [PATCH 03/12] 6lowpan: init 6lowpan header and ipv6hdr to zero

2013-07-24 Thread Alexander Aring
Hi Werner,


2013/7/24 Werner Almesberger 

> Alexander Aring wrote:
> > u8 head[100] = {};
>
> What I mean is: I don't see the original code doing a memset on
> "head", so I'm a bit puzzled why you have to do this now.
>
> Was the original code broken by not zeroing "head" ? If yes,
> that would be a bug fix, not a mere optimization.
>
> You are right, we set each inline data and we doesn't care if it already
zero or something. I will change that to the old behavior.


But to set the ipv6 struct to zero makes sense. Then we don't need to set
the traffic class to zero when we need it set to zero or the uncompression
of addresses. The old code calculates are interval between the pre and
postfix of inline data and run a memset zero on it.

Or did I overlook something ?
>
> No, I overlook something, we don't need it in the header create part, sry
:-)


> > It's ugly to make the 100 byte magic number here, what we need is a
> > number MAX_LOWPAN_HEADER_LENGTH.
>
>
I will try to calculate this number. I have some 6lowpan lecture which I
can confirm this number, or this number stands in some rfc's, I will take a
look.

Yeah, since you have that evil [100] in the patch, it will draw
> attention :)
>
>
Thanks for your reply.

- Alex
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 13/14] 6lowpan: add comment for unspec address

2013-07-24 Thread Alexander Aring
Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 8454b22..5de520b 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -565,9 +565,10 @@ static int lowpan_header_create(struct sk_buff *skb,
 
/* source address compression */
if (is_addr_unspecified(&hdr->saddr)) {
+   /* Case SAM = 0 and SAC = 1 */
pr_debug("source address is unspecified, setting SAC\n");
iphc1 |= LOWPAN_IPHC_SAC;
-   /* TODO: context lookup */
+   /* TODO: context lookup */
} else if (is_addr_link_local(&hdr->saddr)) {
pr_debug("source address is link-local\n");
iphc1 |= lowpan_compress_addr_64(&hc06_ptr,
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 06/14] 6lowpan: Fix fragmentation with link-local compressed addresses

2013-07-24 Thread Alexander Aring
From: David Hauweele 

When a new 6lowpan fragment is received, a skbuff is allocated for
the reassembled packet. However when a 6lowpan packet compresses
link-local addresses based on link-layer addresses, the processing
function relies on the skb mac control block to find the related
link-layer address.

This patch copies the control block from the first fragment into
the newly allocated skb to keep a trace of the link-layer addresses
in case of a link-local compressed address.

Signed-off-by: David Hauweele 
Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 286d7e9..1a90bdd 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -698,6 +698,13 @@ lowpan_alloc_new_frame(struct sk_buff *skb, u16 len, u16 
tag)
skb_reserve(frame->skb, sizeof(struct ipv6hdr));
skb_put(frame->skb, frame->length);
 
+   /*
+* copy the first control block to keep a
+* trace of the link-layer addresses in case
+* of a link-local compressed address
+*/
+   memcpy(frame->skb->cb, skb->cb, sizeof(skb->cb));
+
init_timer(&frame->timer);
/* time out is the same as for ipv6 - 60 sec */
frame->timer.expires = jiffies + LOWPAN_FRAG_TIMEOUT;
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 08/14] 6lowpan: add function to uncompress multicast addr

2013-07-24 Thread Alexander Aring
Add function to uncompress multicast address.
This function split the uncompress function for a multicast address
in a seperate function.

To uncompress a multicast address is different than a other
non-multicasts addresses according to rfc6282.

Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 82 +---
 1 file changed, 63 insertions(+), 19 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 62791df..e9d6cbd 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -88,15 +88,6 @@ static const u8 lowpan_unc_llconf[] = {0x0f, 0x28, 0x22, 
0x20};
  */
 static const u8 lowpan_unc_ctxconf[] = {0x00, 0x88, 0x82, 0x80};
 
-/*
- * Uncompression of ctx-base
- *   0 -> 0 bits from packet
- *   1 -> 2 bytes from prefix - bunch of zeroes 5 from packet
- *   2 -> 2 bytes from prefix - zeroes + 3 from packet
- *   3 -> 2 bytes from prefix - infer 1 bytes from lladdr
- */
-static const u8 lowpan_unc_mxconf[] = {0x0f, 0x25, 0x23, 0x21};
-
 /* Link local prefix */
 static const u8 lowpan_llprefix[] = {0xfe, 0x80};
 
@@ -240,6 +231,67 @@ lowpan_uncompress_addr(struct sk_buff *skb, struct 
in6_addr *ipaddr,
return 0;
 }
 
+/*
+ * Uncompress function for multicast destination address,
+ * when M bit is set.
+ */
+static int
+lowpan_uncompress_multicast_daddr(struct sk_buff *skb,
+   struct in6_addr *ipaddr,
+   const u8 dam)
+{
+   switch (dam) {
+   case LOWPAN_IPHC_DAM_00:
+   /*
+* 00:  128 bits.  The full address
+* is carried in-line.
+*/
+   memcpy(ipaddr->s6_addr, skb->data, 16);
+   skb_pull(skb, 16);
+   break;
+   case LOWPAN_IPHC_DAM_01:
+   /*
+* 01:  48 bits.  The address takes
+* the form ffXX::00XX::.
+*/
+   ipaddr->s6_addr[0] = 0xFF;
+   ipaddr->s6_addr[1] = *skb->data;
+   skb_pull(skb, 1);
+   memcpy(&ipaddr->s6_addr[11], skb->data, 5);
+   skb_pull(skb, 5);
+   break;
+   case LOWPAN_IPHC_DAM_10:
+   /*
+* 10:  32 bits.  The address takes
+* the form ffXX::00XX:.
+*/
+   ipaddr->s6_addr[0] = 0xFF;
+   ipaddr->s6_addr[1] = *skb->data;
+   skb_pull(skb, 1);
+   memcpy(&ipaddr->s6_addr[13], skb->data, 3);
+   skb_pull(skb, 3);
+   break;
+   case LOWPAN_IPHC_DAM_11:
+   /*
+* 11:  8 bits.  The address takes
+* the form ff02::00XX.
+*/
+   ipaddr->s6_addr[0] = 0xFF;
+   ipaddr->s6_addr[1] = 0x02;
+   ipaddr->s6_addr[15] = *skb->data;
+   skb_pull(skb, 1);
+   break;
+   default:
+   pr_debug("DAM value has a wrong value: 0x%x\n", dam);
+   return -EINVAL;
+   }
+
+   pr_debug("Reconstructed ipv6 multicast addr is:\n");
+   lowpan_raw_dump_inline(NULL, NULL, ipaddr->s6_addr, 16);
+
+   return 0;
+}
+
 static void
 lowpan_compress_udp_header(u8 **hc06_ptr, struct sk_buff *skb)
 {
@@ -929,16 +981,8 @@ lowpan_process_data(struct sk_buff *skb)
pr_debug("dest: context-based mcast compression\n");
/* TODO: implement this */
} else {
-   u8 prefix[] = {0xff, 0x02};
-
-   pr_debug("dest: non context-based mcast compression\n");
-   if (0 < tmp && tmp < 3) {
-   if (lowpan_fetch_skb_u8(skb, &prefix[1]))
-   goto drop;
-   }
-
-   err = lowpan_uncompress_addr(skb, &hdr.daddr, prefix,
-   lowpan_unc_mxconf[tmp], NULL);
+   err = lowpan_uncompress_multicast_daddr(
+   skb, &hdr.daddr, tmp);
if (err)
goto drop;
}
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 05/14] 6lowpan: remove setting some memory regions to zero

2013-07-24 Thread Alexander Aring
While we can assume that the memory is already be zero, we can drop some
memsets while parsing.

Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index d231bef..286d7e9 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -223,10 +223,6 @@ lowpan_uncompress_addr(struct sk_buff *skb, struct 
in6_addr *ipaddr,
if (prefcount > 0)
memcpy(ipaddr, prefix, prefcount);
 
-   if (prefcount + postcount < 16)
-   memset(&ipaddr->s6_addr[prefcount], 0,
-   16 - (prefcount + postcount));
-
if (postcount > 0) {
memcpy(&ipaddr->s6_addr[16 - postcount], skb->data, postcount);
skb_pull(skb, postcount);
@@ -869,8 +865,6 @@ lowpan_process_data(struct sk_buff *skb)
 
hdr.priority = ((tmp >> 2) & 0x0f);
hdr.flow_lbl[0] = ((tmp << 6) & 0xC0) | ((tmp >> 2) & 0x30);
-   hdr.flow_lbl[1] = 0;
-   hdr.flow_lbl[2] = 0;
break;
/*
 * Flow Label carried in-line
@@ -886,10 +880,6 @@ lowpan_process_data(struct sk_buff *skb)
break;
/* Traffic Class and Flow Label are elided */
case 3: /* 11b */
-   hdr.priority = 0;
-   hdr.flow_lbl[0] = 0;
-   hdr.flow_lbl[1] = 0;
-   hdr.flow_lbl[2] = 0;
break;
default:
break;
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 01/14] 6lowpan: fix small comment issue

2013-07-24 Thread Alexander Aring
Fix a little comment issue.
Number 2 is 10 in bits and 1 is 01.

Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 55e1fd5..1ec14ef 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -862,7 +862,7 @@ lowpan_process_data(struct sk_buff *skb)
 * Traffic class carried in-line
 * ECN + DSCP (1 byte), Flow Label is elided
 */
-   case 1: /* 10b */
+   case 1: /* 01b */
if (lowpan_fetch_skb_u8(skb, &tmp))
goto drop;
 
@@ -875,7 +875,7 @@ lowpan_process_data(struct sk_buff *skb)
 * Flow Label carried in-line
 * ECN + 2-bit Pad + Flow Label (3 bytes), DSCP is elided
 */
-   case 2: /* 01b */
+   case 2: /* 10b */
if (lowpan_fetch_skb_u8(skb, &tmp))
goto drop;
 
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 07/14] 6lowpan: use _saddr and _daddr instead of skb data

2013-07-24 Thread Alexander Aring
Pointers _saddr and _daddr points to source and destination address.
Use this for a link-layer compression to get these addresses.

Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 1a90bdd..62791df 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -916,7 +916,7 @@ lowpan_process_data(struct sk_buff *skb)
/* Source address uncompression */
pr_debug("source address stateless compression\n");
err = lowpan_uncompress_addr(skb, &hdr.saddr, lowpan_llprefix,
-   lowpan_unc_llconf[tmp], skb->data);
+   lowpan_unc_llconf[tmp], _saddr);
if (err)
goto drop;
 
@@ -945,7 +945,7 @@ lowpan_process_data(struct sk_buff *skb)
} else {
pr_debug("dest: stateless compression\n");
err = lowpan_uncompress_addr(skb, &hdr.daddr, lowpan_llprefix,
-   lowpan_unc_llconf[tmp], skb->data);
+   lowpan_unc_llconf[tmp], _daddr);
if (err)
goto drop;
}
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCHv6 00/14] minor fixes

2013-07-24 Thread Alexander Aring
Next part of this patch series to fix uncompression of some addresses.
This patch doesn't fix the payload_length and parsing of traffic class.

v6:
 - Add patch "6lowpan: fix magic number"
 - Add patch "6lowpan: handle only real local link addresses"
 - remove useless zero setting to head buffer in patch
   "6lowpan: remove setting some memory regions to zero".
   Thanks Werner for this hint.
 - Handle short address based addresses when address_mode == 03
   I got a anonymous hint for that fix. Thanks. I hope this is correct.
   See patch "6lowpan: lowpan_uncompress_addr with address_mode"
 - Remove memcpy(... , 1) and memset(..., 1) in address uncompression

v5:
 - fix handle of uncompress_context_based_addr if SAC Bit is set. We handle 
currently the
   case if SAC = 1 and SAM = 00, otherwise we print a warning and drop the 
package.

v4:
 - Got a "Mail delivery failed" - I resend this patch series

v3:
 - add David Hauweele patch to fix fragmentation with link-local compressed
   addresses
 - add warnings for CID and DAC bit
 - handle SAC bit to :: address
 - rename layer_addr to lladdr in function lowpan_uncompress_addr

v2:
 - add patch to add uncompress multicast addresses
 - add patch for new uncompress address function

Alexander Aring (13):
  6lowpan: fix small comment issue
  6lowpan: fix magic number
  6lowpan: fix return value with comment operator
  6lowpan: init 6lowpan header and ipv6hdr to zero
  6lowpan: remove setting some memory regions to zero
  6lowpan: use _saddr and _daddr instead of skb data
  6lowpan: add function to uncompress multicast addr
  6lowpan: handle only real local link addresses
  6lowpan: lowpan_uncompress_addr with address_mode
  6lowpan: add warning for CID bit
  6lowpan: add warning for DAC bit
  6lowpan: add comment for unspec address
  6lowpan: handle context based source address

David Hauweele (1):
  6lowpan: Fix fragmentation with link-local compressed addresses

 net/ieee802154/6lowpan.c | 336 ++-
 net/ieee802154/6lowpan.h |  15 ++-
 2 files changed, 229 insertions(+), 122 deletions(-)

-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 10/14] 6lowpan: lowpan_uncompress_addr with address_mode

2013-07-24 Thread Alexander Aring
This patch drop the pre and postcount calculation from the
lowpan_uncompress_addr function.

We use instead a switch case over address_mode value, it's easier
to understand what's going on there.

Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 151 +--
 net/ieee802154/6lowpan.h |   8 ++-
 2 files changed, 87 insertions(+), 72 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index e9d6cbd..c711441 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -67,30 +67,6 @@ static const u8 lowpan_ttl_values[] = {0, 1, 64, 255};
 
 static LIST_HEAD(lowpan_devices);
 
-/*
- * Uncompression of linklocal:
- *   0 -> 16 bytes from packet
- *   1 -> 2  bytes from prefix - bunch of zeroes and 8 from packet
- *   2 -> 2  bytes from prefix - zeroes + 2 from packet
- *   3 -> 2  bytes from prefix - infer 8 bytes from lladdr
- *
- *  NOTE: => the uncompress function does change 0xf to 0x10
- *  NOTE: 0x00 => no-autoconfig => unspecified
- */
-static const u8 lowpan_unc_llconf[] = {0x0f, 0x28, 0x22, 0x20};
-
-/*
- * Uncompression of ctx-based:
- *   0 -> 0 bits  from packet [unspecified / reserved]
- *   1 -> 8 bytes from prefix - bunch of zeroes and 8 from packet
- *   2 -> 8 bytes from prefix - zeroes + 2 from packet
- *   3 -> 8 bytes from prefix - infer 8 bytes from lladdr
- */
-static const u8 lowpan_unc_ctxconf[] = {0x00, 0x88, 0x82, 0x80};
-
-/* Link local prefix */
-static const u8 lowpan_llprefix[] = {0xfe, 0x80};
-
 /* private device info */
 struct lowpan_dev_info {
struct net_device   *real_dev; /* real WPAN device ptr */
@@ -182,50 +158,89 @@ lowpan_compress_addr_64(u8 **hc06_ptr, u8 shift, const 
struct in6_addr *ipaddr,
return rol8(val, shift);
 }
 
-static void
-lowpan_uip_ds6_set_addr_iid(struct in6_addr *ipaddr, unsigned char *lladdr)
-{
-   memcpy(&ipaddr->s6_addr[8], lladdr, IEEE802154_ADDR_LEN);
-   /* second bit-flip (Universe/Local) is done according RFC2464 */
-   ipaddr->s6_addr[8] ^= 0x02;
-}
-
 /*
- * Uncompress addresses based on a prefix and a postfix with zeroes in
- * between. If the postfix is zero in length it will use the link address
- * to configure the IP address (autoconf style).
- * pref_post_count takes a byte where the first nibble specify prefix count
- * and the second postfix count (NOTE: 15/0xf => 16 bytes copy).
+ * Uncompress address function for source and
+ * destination address(non-multicast).
+ *
+ * address_mode is sam value or dam value.
  */
 static int
-lowpan_uncompress_addr(struct sk_buff *skb, struct in6_addr *ipaddr,
-   u8 const *prefix, u8 pref_post_count, unsigned char *lladdr)
+lowpan_uncompress_addr(struct sk_buff *skb,
+   struct in6_addr *ipaddr,
+   const u8 address_mode,
+   const struct ieee802154_addr *lladdr)
 {
-   u8 prefcount = pref_post_count >> 4;
-   u8 postcount = pref_post_count & 0x0f;
-
-   /* full nibble 15 => 16 */
-   prefcount = (prefcount == 15 ? 16 : prefcount);
-   postcount = (postcount == 15 ? 16 : postcount);
-
-   if (lladdr)
-   lowpan_raw_dump_inline(__func__, "linklocal address",
-   lladdr, IEEE802154_ADDR_LEN);
-   if (prefcount > 0)
-   memcpy(ipaddr, prefix, prefcount);
-
-   if (postcount > 0) {
-   memcpy(&ipaddr->s6_addr[16 - postcount], skb->data, postcount);
-   skb_pull(skb, postcount);
-   } else if (prefcount > 0) {
-   if (lladdr == NULL)
+   switch (address_mode) {
+   case LOWPAN_IPHC_ADDR_00:
+   /*
+* for global link addresses
+*/
+   memcpy(ipaddr->s6_addr, skb->data, 16);
+   skb_pull(skb, 16);
+   break;
+   case LOWPAN_IPHC_ADDR_01:
+   /*
+* fe:80:::::
+*/
+   ipaddr->s6_addr[0] = 0xFE;
+   ipaddr->s6_addr[1] = 0x80;
+   memcpy(&ipaddr->s6_addr[8], skb->data, 8);
+   skb_pull(skb, 8);
+   break;
+   case LOWPAN_IPHC_ADDR_02:
+   /*
+* fe:80::ff:fe00:
+*/
+   ipaddr->s6_addr[0] = 0xFE;
+   ipaddr->s6_addr[1] = 0x80;
+   ipaddr->s6_addr[11] = 0xFF;
+   ipaddr->s6_addr[12] = 0xFE;
+   memcpy(&ipaddr->s6_addr[14], skb->data, 2);
+   skb_pull(skb, 2);
+   break;
+   case LOWPAN_IPHC_ADDR_03:
+   switch (lladdr->addr_type) {
+   case IEEE802154_ADDR_LONG:
+   /*
+* fe:80:::::
+*\_/
+*  lladdr
+*/
+   ipaddr->s6_addr[0] = 0xFE;
+   

[Linux-zigbee-devel] [PATCH 14/14] 6lowpan: handle context based source address

2013-07-24 Thread Alexander Aring
Handle context based address when a unspecific address is specified.
For other context based address we print a warning and drop the package
currently because we don't support it right now.

Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 54 +++-
 1 file changed, 49 insertions(+), 5 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 5de520b..a3c722a 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -247,6 +247,41 @@ lowpan_uncompress_addr(struct sk_buff *skb,
 }
 
 /*
+ * Uncompress address function for source context
+ * based address(non-multicast).
+ */
+static int
+lowpan_uncompress_context_based_src_addr(struct sk_buff *skb,
+   struct in6_addr *ipaddr,
+   const u8 sam)
+{
+   switch (sam) {
+   case LOWPAN_IPHC_ADDR_00:
+   /*
+* unspec address ::
+* Do nothing, address is already ::
+*/
+   break;
+   case LOWPAN_IPHC_ADDR_01:
+   /* TODO */
+   case LOWPAN_IPHC_ADDR_02:
+   /* TODO */
+   case LOWPAN_IPHC_ADDR_03:
+   /* TODO */
+   netdev_warn(skb->dev, "SAM value 0x%x not supported\n", sam);
+   return -EINVAL;
+   default:
+   pr_debug("Invalid sam value: 0x%x\n", sam);
+   return -EINVAL;
+   }
+
+   pr_debug("Reconstructed context based ipv6 src addr is:\n");
+   lowpan_raw_dump_inline(NULL, NULL, ipaddr->s6_addr, 16);
+
+   return 0;
+}
+
+/*
  * Uncompress function for multicast destination address,
  * when M bit is set.
  */
@@ -981,11 +1016,20 @@ lowpan_process_data(struct sk_buff *skb)
/* Extract SAM to the tmp variable */
tmp = ((iphc1 & LOWPAN_IPHC_SAM) >> LOWPAN_IPHC_SAM_BIT) & 0x03;
 
-   /* Source address uncompression */
-   pr_debug("source address stateless compression\n");
-   err = lowpan_uncompress_addr(skb, &hdr.saddr, tmp, _saddr);
-   if (err)
-   goto drop;
+   if (iphc1 & LOWPAN_IPHC_SAC) {
+   /* Source address context based uncompression */
+   pr_debug("SAC bit is set. Handle context based source 
address.\n");
+   err = lowpan_uncompress_context_based_src_addr(
+   skb, &hdr.saddr, tmp);
+   if (err)
+   goto drop;
+   } else {
+   /* Source address uncompression */
+   pr_debug("source address stateless compression\n");
+   err = lowpan_uncompress_addr(skb, &hdr.saddr, tmp, _saddr);
+   if (err)
+   goto drop;
+   }
 
/* Extract DAM to the tmp variable */
tmp = ((iphc1 & LOWPAN_IPHC_DAM_11) >> LOWPAN_IPHC_DAM_BIT) & 0x03;
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 02/14] 6lowpan: fix magic number

2013-07-24 Thread Alexander Aring
Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 1ec14ef..90b9b90 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -589,7 +589,7 @@ static int lowpan_header_create(struct sk_buff *skb,
sa.addr_type = IEEE802154_ADDR_LONG;
sa.pan_id = ieee802154_mlme_ops(dev)->get_pan_id(dev);
 
-   memcpy(&(sa.hwaddr), saddr, 8);
+   memcpy(&(sa.hwaddr), saddr, IEEE802154_ADDR_LEN);
/* intra-PAN communications */
da.pan_id = ieee802154_mlme_ops(dev)->get_pan_id(dev);
 
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 03/14] 6lowpan: fix return value with comment operator

2013-07-24 Thread Alexander Aring
Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 90b9b90..2399c8f 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -819,7 +819,8 @@ lowpan_process_data(struct sk_buff *skb)
}
spin_unlock_bh(&flist_lock);
 
-   return kfree_skb(skb), 0;
+   kfree_skb(skb);
+   return 0;
}
default:
break;
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 04/14] 6lowpan: init 6lowpan header and ipv6hdr to zero

2013-07-24 Thread Alexander Aring
When we set it to zero, we can assume that the memory is already zero
while parsing.

Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 2399c8f..d231bef 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -723,7 +723,7 @@ frame_err:
 static int
 lowpan_process_data(struct sk_buff *skb)
 {
-   struct ipv6hdr hdr;
+   struct ipv6hdr hdr = {};
u8 tmp, iphc0, iphc1, num_context = 0;
u8 *_saddr, *_daddr;
int err;
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 12/14] 6lowpan: add warning for DAC bit

2013-07-24 Thread Alexander Aring
We don't handle the DAC bit currently, so I add a warning and drop the
package.

Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index d26d22b..8454b22 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -989,22 +989,24 @@ lowpan_process_data(struct sk_buff *skb)
/* Extract DAM to the tmp variable */
tmp = ((iphc1 & LOWPAN_IPHC_DAM_11) >> LOWPAN_IPHC_DAM_BIT) & 0x03;
 
-   /* check for Multicast Compression */
-   if (iphc1 & LOWPAN_IPHC_M) {
-   if (iphc1 & LOWPAN_IPHC_DAC) {
-   pr_debug("dest: context-based mcast compression\n");
-   /* TODO: implement this */
-   } else {
+   if (iphc1 & LOWPAN_IPHC_DAC) {
+   /* TODO: implement this */
+   netdev_warn(skb->dev, "DAC bit is set. Context-based not 
implemented. Drop packet.\n");
+   goto drop;
+   } else {
+   /* check for Multicast Compression */
+   if (iphc1 & LOWPAN_IPHC_M) {
err = lowpan_uncompress_multicast_daddr(
skb, &hdr.daddr, tmp);
if (err)
goto drop;
+   } else {
+   pr_debug("dest: stateless compression\n");
+   err = lowpan_uncompress_addr(
+   skb, &hdr.daddr, tmp, _daddr);
+   if (err)
+   goto drop;
}
-   } else {
-   pr_debug("dest: stateless compression\n");
-   err = lowpan_uncompress_addr(skb, &hdr.daddr, tmp, _daddr);
-   if (err)
-   goto drop;
}
 
/* UDP data uncompression */
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 09/14] 6lowpan: handle only real local link addresses

2013-07-24 Thread Alexander Aring
Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.h | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ieee802154/6lowpan.h b/net/ieee802154/6lowpan.h
index 4b8f917..a4a307b 100644
--- a/net/ieee802154/6lowpan.h
+++ b/net/ieee802154/6lowpan.h
@@ -83,8 +83,11 @@
 #define ipaddr_prefixcmp(addr1, addr2, length) \
(memcmp(addr1, addr2, length >> 3) == 0)
 
-/* local link, i.e. FE80::/10 */
-#define is_addr_link_local(a) (((a)->s6_addr16[0]) == htons(0xFE80))
+/* local link, i.e. FE80::/64 */
+#define is_addr_link_local(a) (((a)->s6_addr16[0]) == htons(0xFE80) && \
+   (((a)->s6_addr16[1]) == 0) &&   \
+   (((a)->s6_addr16[2]) == 0) &&   \
+   (((a)->s6_addr16[3]) == 0))
 
 /*
  * check whether we can compress the IID to 16 bits,
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


[Linux-zigbee-devel] [PATCH 11/14] 6lowpan: add warning for CID bit

2013-07-24 Thread Alexander Aring
We don't handle the CID bit currently, so I add a warning and drop the
package.

Signed-off-by: Alexander Aring 
---
 net/ieee802154/6lowpan.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index c711441..d26d22b 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -906,9 +906,9 @@ lowpan_process_data(struct sk_buff *skb)
 
/* another if the CID flag is set */
if (iphc1 & LOWPAN_IPHC_CID) {
-   pr_debug("CID flag is set, increase header with one\n");
-   if (lowpan_fetch_skb_u8(skb, &num_context))
-   goto drop;
+   /* TODO: implement this */
+   netdev_warn(skb->dev, "CID bit is set. Context-based not 
implemented. Drop packet.\n");
+   goto drop;
}
 
hdr.version = 6;
-- 
1.8.3.3


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


Re: [Linux-zigbee-devel] [PATCH 02/14] 6lowpan: fix magic number

2013-07-24 Thread Werner Almesberger
Alexander Aring wrote:
> - memcpy(&(sa.hwaddr), saddr, 8);
> + memcpy(&(sa.hwaddr), saddr, IEEE802154_ADDR_LEN);

Nice. While we're at it, we don't need parentheses around sa.hwaddr.

- Werner

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


Re: [Linux-zigbee-devel] [PATCH 05/14] 6lowpan: remove setting some memory regions to zero

2013-07-24 Thread Werner Almesberger
Alexander Aring wrote:
>   hdr.priority = ((tmp >> 2) & 0x0f);
>   hdr.flow_lbl[0] = ((tmp << 6) & 0xC0) | ((tmp >> 2) & 0x30);

Some more opportinities to kill unnecessary parentheses :-)
(Just the outermost ones. The rest is fine.)

- Werner

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


Re: [Linux-zigbee-devel] [PATCH 02/14] 6lowpan: fix magic number

2013-07-24 Thread Alexander Aring
Hi Werner,

On Wed, Jul 24, 2013 at 10:17:51AM -0300, Werner Almesberger wrote:
> Alexander Aring wrote:
> > -   memcpy(&(sa.hwaddr), saddr, 8);
> > +   memcpy(&(sa.hwaddr), saddr, IEEE802154_ADDR_LEN);
> 
> Nice. While we're at it, we don't need parentheses around sa.hwaddr.
> 
Thanks. I will put this on my TODO list, also the forgotten
MAX_LOWPAN_HEADER_SIZE :-)

- Alex

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


Re: [Linux-zigbee-devel] [PATCH 09/14] 6lowpan: handle only real local link addresses

2013-07-24 Thread Werner Almesberger
Alexander Aring wrote:
> +#define is_addr_link_local(a) (((a)->s6_addr16[0]) == htons(0xFE80) &&   
> \
> + (((a)->s6_addr16[1]) == 0) &&   \
> + (((a)->s6_addr16[2]) == 0) &&   \
> + (((a)->s6_addr16[3]) == 0))

More parenthesis paranoia: the (a) is good and so are the outermost
parentheses. The ones around the tests for equality are a pascalism
(alas, rather common). The ones around  (a)->s6_addr16[*]  are just
weird.

- Werner

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


Re: [Linux-zigbee-devel] [PATCH 05/14] 6lowpan: remove setting some memory regions to zero

2013-07-24 Thread Alexander Aring
Hi Werner,

On Wed, Jul 24, 2013 at 10:20:05AM -0300, Werner Almesberger wrote:
> Alexander Aring wrote:
> > hdr.priority = ((tmp >> 2) & 0x0f);
> > hdr.flow_lbl[0] = ((tmp << 6) & 0xC0) | ((tmp >> 2) & 0x30);
> 
> Some more opportinities to kill unnecessary parentheses :-)
> (Just the outermost ones. The rest is fine.)
> 

Ok I will do this, but I know the traffic class has some other issues
inside... should I try to fix this, too?

I would handle a fix for the traffic class in a separate patch series.
Thanks.

- Alex

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


Re: [Linux-zigbee-devel] [PATCH 09/14] 6lowpan: handle only real local link addresses

2013-07-24 Thread Alexander Aring
Hi Werner,

On Wed, Jul 24, 2013 at 10:25:03AM -0300, Werner Almesberger wrote:
> Alexander Aring wrote:
> > +#define is_addr_link_local(a) (((a)->s6_addr16[0]) == htons(0xFE80) && 
> > \
> > +   (((a)->s6_addr16[1]) == 0) &&   \
> > +   (((a)->s6_addr16[2]) == 0) &&   \
> > +   (((a)->s6_addr16[3]) == 0))
> 
> More parenthesis paranoia: the (a) is good and so are the outermost
> parentheses. The ones around the tests for equality are a pascalism
> (alas, rather common). The ones around  (a)->s6_addr16[*]  are just
> weird.
> 

Ok, I don't like it myself, but then I can fix it for all macros that
checks is_addr_. I use the same style for this...

So should I change it only for this or for all macros?

- Alex

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


Re: [Linux-zigbee-devel] [PATCH 05/14] 6lowpan: remove setting some memory regions to zero

2013-07-24 Thread Werner Almesberger
Alexander Aring wrote:
> Ok I will do this, but I know the traffic class has some other issues
> inside... should I try to fix this, too?

While you're at it ... why not ? :)

This is basically the long overdue major rewrite of all the compression
stuff, so fixing the traffic class would seem to fit.

Of course, it's your choice up to what size of the patch stack you're
still comfortable.

- Werner

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


Re: [Linux-zigbee-devel] [PATCH 09/14] 6lowpan: handle only real local link addresses

2013-07-24 Thread Werner Almesberger
Alexander Aring wrote:
> So should I change it only for this or for all macros?

Since the pascalism is so widespread I usually point it out when I
see it but don't try to strip it from other people's code.

I would get rid of the other unnecessary parentheses, though. They
just make the code harder to read and encourage cargo cult
programming.

- Werner

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


Re: [Linux-zigbee-devel] [PATCH 09/14] 6lowpan: handle only real local link addresses

2013-07-24 Thread Alexander Aring
Hi Werner,

On Wed, Jul 24, 2013 at 10:44:26AM -0300, Werner Almesberger wrote:
> Alexander Aring wrote:
> > So should I change it only for this or for all macros?
> 
> Since the pascalism is so widespread I usually point it out when I
> see it but don't try to strip it from other people's code.
> 
> I would get rid of the other unnecessary parentheses, though. They
> just make the code harder to read and encourage cargo cult
> programming.
> 

ok I will change this in the complete headerfile or when I see
unnecessary brackets. Thanks for your opinion.

- Alex

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel