summaryrefslogtreecommitdiffstatshomepage
path: root/src/compat.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-11-06 12:12:20 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-11-06 12:12:20 +0100
commit7cc2e9953226d80e1fe20bbf51d5e5fdd00851f4 (patch)
tree56dc2ef465a1af6c1edb2fe2464fbe42b8c9945d /src/compat.h
parentchacha20poly1305: cleanup magic constants (diff)
downloadwireguard-monolithic-historical-7cc2e9953226d80e1fe20bbf51d5e5fdd00851f4.tar.xz
wireguard-monolithic-historical-7cc2e9953226d80e1fe20bbf51d5e5fdd00851f4.zip
data: we care about per-peer, not per-device, inflight encryptions
Diffstat (limited to 'src/compat.h')
-rw-r--r--src/compat.h27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/compat.h b/src/compat.h
index 3c73207..28c1aca 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -141,26 +141,6 @@ static inline int dst_cache_init(struct dst_cache *dst_cache, gfp_t gfp) { retur
static inline void dst_cache_destroy(struct dst_cache *dst_cache) { }
#endif
-/* https://lkml.org/lkml/2015/6/12/415 */
-#include <linux/netdevice.h>
-static inline struct net_device *netdev_pub(void *dev)
-{
- return (struct net_device *)((char *)dev - ALIGN(sizeof(struct net_device), NETDEV_ALIGN));
-}
-
-/* https://lkml.org/lkml/2016/10/1/187 */
-#ifdef CONFIG_WIREGUARD_PARALLEL
-#include <linux/padata.h>
-static inline int padata_queue_len(struct padata_instance *pinst)
-{
- int len;
- rcu_read_lock_bh();
- len = atomic_read(&rcu_dereference_bh(pinst->pd)->refcnt);
- rcu_read_unlock_bh();
- return len;
-}
-#endif
-
/* PaX compatibility */
#ifdef CONSTIFY_PLUGIN
#include <linux/cache.h>
@@ -168,4 +148,11 @@ static inline int padata_queue_len(struct padata_instance *pinst)
#define __read_mostly
#endif
+/* https://lkml.org/lkml/2015/6/12/415 */
+#include <linux/netdevice.h>
+static inline struct net_device *netdev_pub(void *dev)
+{
+ return (struct net_device *)((char *)dev - ALIGN(sizeof(struct net_device), NETDEV_ALIGN));
+}
+
#endif