aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ax25.h
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2015-06-25 06:19:07 -0700
committerDavid S. Miller <davem@davemloft.net>2015-06-28 16:55:44 -0700
commit3200392b88dd25f0d60a500a38d1ce538eb7f933 (patch)
tree4a17b0714e23ce214d97d326c7a895a9f891426b /include/net/ax25.h
parentdrivers: net: xgene: Pre-initialize ret in xgene_enet_get_resources() (diff)
downloadlinux-dev-3200392b88dd25f0d60a500a38d1ce538eb7f933.tar.xz
linux-dev-3200392b88dd25f0d60a500a38d1ce538eb7f933.zip
ax25: Stop using sock->sk_protinfo.
Just make a ax25_sock structure that provides the ax25_cb pointer. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ax25.h')
-rw-r--r--include/net/ax25.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 16a923a3a43a..e602f8177ebf 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -13,6 +13,7 @@
#include <linux/slab.h>
#include <linux/atomic.h>
#include <net/neighbour.h>
+#include <net/sock.h>
#define AX25_T1CLAMPLO 1
#define AX25_T1CLAMPHI (30 * HZ)
@@ -246,7 +247,20 @@ typedef struct ax25_cb {
atomic_t refcount;
} ax25_cb;
-#define ax25_sk(__sk) ((ax25_cb *)(__sk)->sk_protinfo)
+struct ax25_sock {
+ struct sock sk;
+ struct ax25_cb *cb;
+};
+
+static inline struct ax25_sock *ax25_sk(const struct sock *sk)
+{
+ return (struct ax25_sock *) sk;
+}
+
+static inline struct ax25_cb *sk_to_ax25(const struct sock *sk)
+{
+ return ax25_sk(sk)->cb;
+}
#define ax25_for_each(__ax25, list) \
hlist_for_each_entry(__ax25, list, ax25_node)