diff options
Diffstat (limited to 'include/linux/if_tun.h')
| -rw-r--r-- | include/linux/if_tun.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index bdee9b83baf6..08e66827ad8e 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 ptr_ring *tun_get_tx_ring(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> |
| @@ -33,5 +38,17 @@ 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 | void *tun_xdp_to_ptr(void *ptr) | ||
| 46 | { | ||
| 47 | return NULL; | ||
| 48 | } | ||
| 49 | 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 */ |
