diff options
Diffstat (limited to 'include/linux/if_tun.h')
-rw-r--r-- | include/linux/if_tun.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index bf9bdf42d577..c5b0a75a7812 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
@@ -17,9 +17,14 @@ | |||
17 | 17 | ||
18 | #include <uapi/linux/if_tun.h> | 18 | #include <uapi/linux/if_tun.h> |
19 | 19 | ||
20 | #define TUN_XDP_FLAG 0x1UL | ||
21 | |||
20 | #if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) | 22 | #if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) |
21 | struct socket *tun_get_socket(struct file *); | 23 | struct socket *tun_get_socket(struct file *); |
22 | struct skb_array *tun_get_skb_array(struct file *file); | 24 | struct ptr_ring *tun_get_tx_ring(struct file *file); |
25 | bool tun_is_xdp_buff(void *ptr); | ||
26 | void *tun_xdp_to_ptr(void *ptr); | ||
27 | void *tun_ptr_to_xdp(void *ptr); | ||
23 | #else | 28 | #else |
24 | #include <linux/err.h> | 29 | #include <linux/err.h> |
25 | #include <linux/errno.h> | 30 | #include <linux/errno.h> |
@@ -29,9 +34,21 @@ static inline struct socket *tun_get_socket(struct file *f) | |||
29 | { | 34 | { |
30 | return ERR_PTR(-EINVAL); | 35 | return ERR_PTR(-EINVAL); |
31 | } | 36 | } |
32 | static inline struct skb_array *tun_get_skb_array(struct file *f) | 37 | static inline struct ptr_ring *tun_get_tx_ring(struct file *f) |
33 | { | 38 | { |
34 | return ERR_PTR(-EINVAL); | 39 | return ERR_PTR(-EINVAL); |
35 | } | 40 | } |
41 | static inline bool tun_is_xdp_buff(void *ptr) | ||
42 | { | ||
43 | return false; | ||
44 | } | ||
45 | static inline void *tun_xdp_to_ptr(void *ptr) | ||
46 | { | ||
47 | return NULL; | ||
48 | } | ||
49 | static inline void *tun_ptr_to_xdp(void *ptr) | ||
50 | { | ||
51 | return NULL; | ||
52 | } | ||
36 | #endif /* CONFIG_TUN */ | 53 | #endif /* CONFIG_TUN */ |
37 | #endif /* __IF_TUN_H */ | 54 | #endif /* __IF_TUN_H */ |