xref: /linux/net/ieee802154/6lowpan/6lowpan_i.h (revision c74a7469f97c0f40b46e82ee979f9fb1bb6e847c)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
28691ee59SAlexander Aring #ifndef __IEEE802154_6LOWPAN_I_H__
38691ee59SAlexander Aring #define __IEEE802154_6LOWPAN_I_H__
48691ee59SAlexander Aring 
54662a0daSAlexander Aring #include <linux/list.h>
64662a0daSAlexander Aring 
74dc315e2SAlexander Aring #include <net/ieee802154_netdev.h>
88691ee59SAlexander Aring #include <net/inet_frag.h>
9b72f6f51SAlexander Aring #include <net/6lowpan.h>
108691ee59SAlexander Aring 
119efeccacSMichael S. Tsirkin typedef unsigned __bitwise lowpan_rx_result;
1272a5e6bbSAlexander Aring #define RX_CONTINUE		((__force lowpan_rx_result) 0u)
1372a5e6bbSAlexander Aring #define RX_DROP_UNUSABLE	((__force lowpan_rx_result) 1u)
1472a5e6bbSAlexander Aring #define RX_DROP			((__force lowpan_rx_result) 2u)
1572a5e6bbSAlexander Aring #define RX_QUEUED		((__force lowpan_rx_result) 3u)
1672a5e6bbSAlexander Aring 
1772a5e6bbSAlexander Aring #define LOWPAN_DISPATCH_FRAG1           0xc0
1872a5e6bbSAlexander Aring #define LOWPAN_DISPATCH_FRAGN           0xe0
1972a5e6bbSAlexander Aring 
20648700f7SEric Dumazet struct frag_lowpan_compare_key {
218691ee59SAlexander Aring 	u16 tag;
228691ee59SAlexander Aring 	u16 d_size;
23*f18fa5deSAlexander Aring 	struct ieee802154_addr src;
24*f18fa5deSAlexander Aring 	struct ieee802154_addr dst;
258691ee59SAlexander Aring };
268691ee59SAlexander Aring 
27648700f7SEric Dumazet /* Equivalent of ipv4 struct ipq
288691ee59SAlexander Aring  */
298691ee59SAlexander Aring struct lowpan_frag_queue {
308691ee59SAlexander Aring 	struct inet_frag_queue	q;
318691ee59SAlexander Aring };
328691ee59SAlexander Aring 
338691ee59SAlexander Aring int lowpan_frag_rcv(struct sk_buff *skb, const u8 frag_type);
348691ee59SAlexander Aring void lowpan_net_frag_exit(void);
358691ee59SAlexander Aring int lowpan_net_frag_init(void);
368691ee59SAlexander Aring 
374662a0daSAlexander Aring void lowpan_rx_init(void);
384662a0daSAlexander Aring void lowpan_rx_exit(void);
394662a0daSAlexander Aring 
404dc315e2SAlexander Aring int lowpan_header_create(struct sk_buff *skb, struct net_device *dev,
414dc315e2SAlexander Aring 			 unsigned short type, const void *_daddr,
424dc315e2SAlexander Aring 			 const void *_saddr, unsigned int len);
434dc315e2SAlexander Aring netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *dev);
444dc315e2SAlexander Aring 
4572a5e6bbSAlexander Aring int lowpan_iphc_decompress(struct sk_buff *skb);
4672a5e6bbSAlexander Aring lowpan_rx_result lowpan_rx_h_ipv6(struct sk_buff *skb);
4772a5e6bbSAlexander Aring 
488691ee59SAlexander Aring #endif /* __IEEE802154_6LOWPAN_I_H__ */
49