6lowpan.h (4ba24fef3eb3b142197135223b90ced2f319cd53) 6lowpan.h (b72f6f51dc5abce94c1b5ee0186e9407ea0f919f)
1/*
2 * Copyright 2011, Siemens AG
3 * written by Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
4 */
5
6/*
7 * Based on patches from Jon Smirl <jonsmirl@gmail.com>
8 * Copyright (c) 2011 Jon Smirl <jonsmirl@gmail.com>

--- 183 unchanged lines hidden (view full) ---

192#define LOWPAN_NHC_UDP_CS_P_00 0xF0 /* all inline */
193#define LOWPAN_NHC_UDP_CS_P_01 0xF1 /* source 16bit inline,
194 dest = 0xF0 + 8 bit inline */
195#define LOWPAN_NHC_UDP_CS_P_10 0xF2 /* source = 0xF0 + 8bit inline,
196 dest = 16 bit inline */
197#define LOWPAN_NHC_UDP_CS_P_11 0xF3 /* source & dest = 0xF0B + 4bit inline */
198#define LOWPAN_NHC_UDP_CS_C 0x04 /* checksum elided */
199
1/*
2 * Copyright 2011, Siemens AG
3 * written by Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
4 */
5
6/*
7 * Based on patches from Jon Smirl <jonsmirl@gmail.com>
8 * Copyright (c) 2011 Jon Smirl <jonsmirl@gmail.com>

--- 183 unchanged lines hidden (view full) ---

192#define LOWPAN_NHC_UDP_CS_P_00 0xF0 /* all inline */
193#define LOWPAN_NHC_UDP_CS_P_01 0xF1 /* source 16bit inline,
194 dest = 0xF0 + 8 bit inline */
195#define LOWPAN_NHC_UDP_CS_P_10 0xF2 /* source = 0xF0 + 8bit inline,
196 dest = 16 bit inline */
197#define LOWPAN_NHC_UDP_CS_P_11 0xF3 /* source & dest = 0xF0B + 4bit inline */
198#define LOWPAN_NHC_UDP_CS_C 0x04 /* checksum elided */
199
200#define LOWPAN_PRIV_SIZE(llpriv_size) \
201 (sizeof(struct lowpan_priv) + llpriv_size)
202
203enum lowpan_lltypes {
204 LOWPAN_LLTYPE_BTLE,
205 LOWPAN_LLTYPE_IEEE802154,
206};
207
208struct lowpan_priv {
209 enum lowpan_lltypes lltype;
210
211 /* must be last */
212 u8 priv[0] __aligned(sizeof(void *));
213};
214
215static inline
216struct lowpan_priv *lowpan_priv(const struct net_device *dev)
217{
218 return netdev_priv(dev);
219}
220
200#ifdef DEBUG
201/* print data in line */
202static inline void raw_dump_inline(const char *caller, char *msg,
203 unsigned char *buf, int len)
204{
205 if (msg)
206 pr_debug("%s():%s: ", caller, msg);
207

--- 159 unchanged lines hidden (view full) ---

367 }
368
369 if (dgram_offset)
370 *dgram_offset = uncomp_header;
371
372 return skb->len + uncomp_header - ret;
373}
374
221#ifdef DEBUG
222/* print data in line */
223static inline void raw_dump_inline(const char *caller, char *msg,
224 unsigned char *buf, int len)
225{
226 if (msg)
227 pr_debug("%s():%s: ", caller, msg);
228

--- 159 unchanged lines hidden (view full) ---

388 }
389
390 if (dgram_offset)
391 *dgram_offset = uncomp_header;
392
393 return skb->len + uncomp_header - ret;
394}
395
396void lowpan_netdev_setup(struct net_device *dev, enum lowpan_lltypes lltype);
397
375int
376lowpan_header_decompress(struct sk_buff *skb, struct net_device *dev,
377 const u8 *saddr, const u8 saddr_type,
378 const u8 saddr_len, const u8 *daddr,
379 const u8 daddr_type, const u8 daddr_len,
380 u8 iphc0, u8 iphc1);
381int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
382 unsigned short type, const void *_daddr,
383 const void *_saddr, unsigned int len);
384
385#endif /* __6LOWPAN_H__ */
398int
399lowpan_header_decompress(struct sk_buff *skb, struct net_device *dev,
400 const u8 *saddr, const u8 saddr_type,
401 const u8 saddr_len, const u8 *daddr,
402 const u8 daddr_type, const u8 daddr_len,
403 u8 iphc0, u8 iphc1);
404int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
405 unsigned short type, const void *_daddr,
406 const void *_saddr, unsigned int len);
407
408#endif /* __6LOWPAN_H__ */