Merge tag 'dmaengine-fix-5.2' of git://git.infradead.org/users/vkoul/slave-dma
[linux-2.6/linux-2.6-arm.git] / net / batman-adv / network-coding.h
blob74f56113a5d06f0afaa02706c7318a8d6762527e
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors:
4 * Martin Hundebøll, Jeppe Ledet-Pedersen
5 */
7 #ifndef _NET_BATMAN_ADV_NETWORK_CODING_H_
8 #define _NET_BATMAN_ADV_NETWORK_CODING_H_
10 #include "main.h"
12 #include <linux/types.h>
14 struct batadv_ogm_packet;
15 struct net_device;
16 struct seq_file;
17 struct sk_buff;
19 #ifdef CONFIG_BATMAN_ADV_NC
21 void batadv_nc_status_update(struct net_device *net_dev);
22 int batadv_nc_init(void);
23 int batadv_nc_mesh_init(struct batadv_priv *bat_priv);
24 void batadv_nc_mesh_free(struct batadv_priv *bat_priv);
25 void batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
26 struct batadv_orig_node *orig_node,
27 struct batadv_orig_node *orig_neigh_node,
28 struct batadv_ogm_packet *ogm_packet,
29 int is_single_hop_neigh);
30 void batadv_nc_purge_orig(struct batadv_priv *bat_priv,
31 struct batadv_orig_node *orig_node,
32 bool (*to_purge)(struct batadv_priv *,
33 struct batadv_nc_node *));
34 void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv);
35 void batadv_nc_init_orig(struct batadv_orig_node *orig_node);
36 bool batadv_nc_skb_forward(struct sk_buff *skb,
37 struct batadv_neigh_node *neigh_node);
38 void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv,
39 struct sk_buff *skb);
40 void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv,
41 struct sk_buff *skb);
42 int batadv_nc_nodes_seq_print_text(struct seq_file *seq, void *offset);
43 int batadv_nc_init_debugfs(struct batadv_priv *bat_priv);
45 #else /* ifdef CONFIG_BATMAN_ADV_NC */
47 static inline void batadv_nc_status_update(struct net_device *net_dev)
51 static inline int batadv_nc_init(void)
53 return 0;
56 static inline int batadv_nc_mesh_init(struct batadv_priv *bat_priv)
58 return 0;
61 static inline void batadv_nc_mesh_free(struct batadv_priv *bat_priv)
65 static inline void
66 batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
67 struct batadv_orig_node *orig_node,
68 struct batadv_orig_node *orig_neigh_node,
69 struct batadv_ogm_packet *ogm_packet,
70 int is_single_hop_neigh)
74 static inline void
75 batadv_nc_purge_orig(struct batadv_priv *bat_priv,
76 struct batadv_orig_node *orig_node,
77 bool (*to_purge)(struct batadv_priv *,
78 struct batadv_nc_node *))
82 static inline void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv)
86 static inline void batadv_nc_init_orig(struct batadv_orig_node *orig_node)
90 static inline bool batadv_nc_skb_forward(struct sk_buff *skb,
91 struct batadv_neigh_node *neigh_node)
93 return false;
96 static inline void
97 batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv,
98 struct sk_buff *skb)
102 static inline void
103 batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv,
104 struct sk_buff *skb)
108 static inline int batadv_nc_nodes_seq_print_text(struct seq_file *seq,
109 void *offset)
111 return 0;
114 static inline int batadv_nc_init_debugfs(struct batadv_priv *bat_priv)
116 return 0;
119 #endif /* ifdef CONFIG_BATMAN_ADV_NC */
121 #endif /* _NET_BATMAN_ADV_NETWORK_CODING_H_ */