All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Aring <aar@pengutronix.de>
To: linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, jukka.rissanen@linux.intel.com,
	Alexander Aring <aar@pengutronix.de>
Subject: [PATCH bluetooth-next 09/11] 6lowpan: move eui64 uncompress function
Date: Mon, 11 Apr 2016 11:04:22 +0200	[thread overview]
Message-ID: <1460365464-12435-10-git-send-email-aar@pengutronix.de> (raw)
In-Reply-To: <1460365464-12435-1-git-send-email-aar@pengutronix.de>

This function will be use in later functionality in other branches than
generic 6lowpan, so we move it to the global 6lowpan header.

Signed-off-by: Alexander Aring <aar@pengutronix.de>
---
 include/net/6lowpan.h | 16 ++++++++++++++++
 net/6lowpan/iphc.c    | 16 ----------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
index a0c01f5..04b877c 100644
--- a/include/net/6lowpan.h
+++ b/include/net/6lowpan.h
@@ -169,6 +169,22 @@ struct lowpan_802154_cb *lowpan_802154_cb(const struct sk_buff *skb)
 	return (struct lowpan_802154_cb *)skb->cb;
 }
 
+static inline void lowpan_iphc_uncompress_eui64_lladdr(struct in6_addr *ipaddr,
+						       const void *lladdr)
+{
+	/* fe:80::XXXX:XXXX:XXXX:XXXX
+	 *        \_________________/
+	 *              hwaddr
+	 */
+	ipaddr->s6_addr[0] = 0xFE;
+	ipaddr->s6_addr[1] = 0x80;
+	memcpy(&ipaddr->s6_addr[8], lladdr, EUI64_ADDR_LEN);
+	/* second bit-flip (Universe/Local)
+	 * is done according RFC2464
+	 */
+	ipaddr->s6_addr[8] ^= 0x02;
+}
+
 #ifdef DEBUG
 /* print data in line */
 static inline void raw_dump_inline(const char *caller, char *msg,
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
index 2999240..dff1591 100644
--- a/net/6lowpan/iphc.c
+++ b/net/6lowpan/iphc.c
@@ -156,22 +156,6 @@
 #define LOWPAN_IPHC_CID_DCI(cid)	(cid & 0x0f)
 #define LOWPAN_IPHC_CID_SCI(cid)	((cid & 0xf0) >> 4)
 
-static inline void lowpan_iphc_uncompress_eui64_lladdr(struct in6_addr *ipaddr,
-						       const void *lladdr)
-{
-	/* fe:80::XXXX:XXXX:XXXX:XXXX
-	 *        \_________________/
-	 *              hwaddr
-	 */
-	ipaddr->s6_addr[0] = 0xFE;
-	ipaddr->s6_addr[1] = 0x80;
-	memcpy(&ipaddr->s6_addr[8], lladdr, EUI64_ADDR_LEN);
-	/* second bit-flip (Universe/Local)
-	 * is done according RFC2464
-	 */
-	ipaddr->s6_addr[8] ^= 0x02;
-}
-
 static inline void
 lowpan_iphc_uncompress_802154_lladdr(struct in6_addr *ipaddr,
 				     const void *lladdr)
-- 
2.8.0


  parent reply	other threads:[~2016-04-11  9:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11  9:04 [PATCH bluetooth-next 00/11] 6lowpan: prepare for 6lowpan ndisc implementation Alexander Aring
2016-04-11  9:04 ` [PATCH bluetooth-next 01/11] ieee802154: cleanups for ieee802154.h Alexander Aring
2016-04-11  9:04 ` [PATCH bluetooth-next 02/11] ieee802154: add short address helpers Alexander Aring
2016-04-11  9:04 ` [PATCH bluetooth-next 03/11] nl802154: avoid address change while running lowpan Alexander Aring
2016-04-11  9:04 ` [PATCH bluetooth-next 04/11] ieee802154: 6lowpan: fix short addr hash Alexander Aring
2016-04-11  9:04 ` [PATCH bluetooth-next 05/11] 6lowpan: change naming for lowpan private data Alexander Aring
2016-04-11 16:54   ` Stefan Schmidt
2016-04-11  9:04 ` [PATCH bluetooth-next 06/11] 6lowpan: move lowpan_802154_dev to 6lowpan Alexander Aring
2016-04-11  9:04 ` [PATCH bluetooth-next 07/11] 6lowpan: iphc: rename add lowpan prefix Alexander Aring
2016-04-11  9:04 ` [PATCH bluetooth-next 08/11] 6lowpan: iphc: remove unnecessary zero data Alexander Aring
2016-04-11  9:04 ` Alexander Aring [this message]
2016-04-11 16:54   ` [PATCH bluetooth-next 09/11] 6lowpan: move eui64 uncompress function Stefan Schmidt
2016-04-11  9:04 ` [PATCH bluetooth-next 10/11] 6lowpan: add lowpan_is_ll function Alexander Aring
2016-04-11 16:55   ` Stefan Schmidt
2016-04-11  9:04 ` [PATCH bluetooth-next 11/11] 6lowpan: move mac802154 header Alexander Aring
2016-04-11 16:55   ` Stefan Schmidt
2016-04-12 11:16 ` [PATCH bluetooth-next 00/11] 6lowpan: prepare for 6lowpan ndisc implementation Jukka Rissanen
2016-04-13  8:42 ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460365464-12435-10-git-send-email-aar@pengutronix.de \
    --to=aar@pengutronix.de \
    --cc=jukka.rissanen@linux.intel.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-wpan@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.