summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-10-13 07:42:57 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-10-20 18:49:24 -0400
commita6f773891a836abfa16fcbb8af14c29c3e109336 (patch)
tree97e5b62ea7604491c007b0935ee04427c22cc933 /include/net
parentbf513fd6fc609590b7835c0dba624ccb9f8f9214 (diff)
6lowpan: cleanup lowpan_header_compress
This patch changes the lowpan_header_compress function by removing unused parameters like "len" and drop static value parameters of protocol type. Instead we really check the protocol type inside inside the skb structure. Also we drop the use of IEEE802154_ADDR_LEN which is link-layer specific. Instead we using EUI64_ADDR_LEN which should always the default case for now. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/6lowpan.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
index aa5a82380e4e..6f1e0bd3d211 100644
--- a/include/net/6lowpan.h
+++ b/include/net/6lowpan.h
@@ -258,7 +258,7 @@ struct lowpan_802154_cb *lowpan_802154_cb(const struct sk_buff *skb)
258#ifdef DEBUG 258#ifdef DEBUG
259/* print data in line */ 259/* print data in line */
260static inline void raw_dump_inline(const char *caller, char *msg, 260static inline void raw_dump_inline(const char *caller, char *msg,
261 unsigned char *buf, int len) 261 const unsigned char *buf, int len)
262{ 262{
263 if (msg) 263 if (msg)
264 pr_debug("%s():%s: ", caller, msg); 264 pr_debug("%s():%s: ", caller, msg);
@@ -273,7 +273,7 @@ static inline void raw_dump_inline(const char *caller, char *msg,
273 * ... 273 * ...
274 */ 274 */
275static inline void raw_dump_table(const char *caller, char *msg, 275static inline void raw_dump_table(const char *caller, char *msg,
276 unsigned char *buf, int len) 276 const unsigned char *buf, int len)
277{ 277{
278 if (msg) 278 if (msg)
279 pr_debug("%s():%s:\n", caller, msg); 279 pr_debug("%s():%s:\n", caller, msg);
@@ -282,9 +282,9 @@ static inline void raw_dump_table(const char *caller, char *msg,
282} 282}
283#else 283#else
284static inline void raw_dump_table(const char *caller, char *msg, 284static inline void raw_dump_table(const char *caller, char *msg,
285 unsigned char *buf, int len) { } 285 const unsigned char *buf, int len) { }
286static inline void raw_dump_inline(const char *caller, char *msg, 286static inline void raw_dump_inline(const char *caller, char *msg,
287 unsigned char *buf, int len) { } 287 const unsigned char *buf, int len) { }
288#endif 288#endif
289 289
290static inline int lowpan_fetch_skb_u8(struct sk_buff *skb, u8 *val) 290static inline int lowpan_fetch_skb_u8(struct sk_buff *skb, u8 *val)
@@ -325,8 +325,24 @@ lowpan_header_decompress(struct sk_buff *skb, struct net_device *dev,
325 const u8 saddr_len, const u8 *daddr, 325 const u8 saddr_len, const u8 *daddr,
326 const u8 daddr_type, const u8 daddr_len, 326 const u8 daddr_type, const u8 daddr_len,
327 u8 iphc0, u8 iphc1); 327 u8 iphc0, u8 iphc1);
328int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev, 328
329 unsigned short type, const void *_daddr, 329/**
330 const void *_saddr, unsigned int len); 330 * lowpan_header_compress - replace IPv6 header with 6LoWPAN header
331 *
332 * This function replaces the IPv6 header which should be pointed at
333 * skb->data and skb_network_header, with the IPHC 6LoWPAN header.
334 * The caller need to be sure that the sk buffer is not shared and at have
335 * at least a headroom which is smaller or equal LOWPAN_IPHC_MAX_HEADER_LEN,
336 * which is the IPHC "more bytes than IPv6 header" at worst case.
337 *
338 * @skb: the buffer which should be manipulate.
339 * @dev: the lowpan net device pointer.
340 * @daddr: destination lladdr of mac header which is used for compression
341 * methods.
342 * @saddr: source lladdr of mac header which is used for compression
343 * methods.
344 */
345int lowpan_header_compress(struct sk_buff *skb, const struct net_device *dev,
346 const void *daddr, const void *saddr);
331 347
332#endif /* __6LOWPAN_H__ */ 348#endif /* __6LOWPAN_H__ */