summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5379160)
raw | patch | inline | side by side (parent: 5379160)
author | Arnie Reynoso <ariner@ti.com> | |
Wed, 16 Oct 2013 17:11:11 +0000 (10:11 -0700) | ||
committer | Chris Ring <cring@ti.com> | |
Thu, 17 Oct 2013 17:07:20 +0000 (10:07 -0700) |
IPC's Linux user space support contains a copy of a few
kernel-defined structs and definitions. This is necessary
because the kernel headers are not include-able by user space.
One of these values is the socket address family used for
rpmsg-based sockets - AF_RPMSG. This definition is always
'one more' than the last address family defined by the kernel's
socket.h.
Prior to Linux 3.9, this was aways 40. In Linux 3.9, a new
address family was introduced (AF_VSOCK), and as a result we
needed to set AF_RPMSG to 41. To enable this, the user space
header reflects on the kernel version and appropriately assigns
the value of AF_RPMSG.
Note that in addition to adding 3.9+ support, this commit also
cleans up some dead code.
kernel-defined structs and definitions. This is necessary
because the kernel headers are not include-able by user space.
One of these values is the socket address family used for
rpmsg-based sockets - AF_RPMSG. This definition is always
'one more' than the last address family defined by the kernel's
socket.h.
Prior to Linux 3.9, this was aways 40. In Linux 3.9, a new
address family was introduced (AF_VSOCK), and as a result we
needed to set AF_RPMSG to 41. To enable this, the user space
header reflects on the kernel version and appropriately assigns
the value of AF_RPMSG.
Note that in addition to adding 3.9+ support, this commit also
cleans up some dead code.
linux/include/net/rpmsg.h | patch | blob | history |
index 223d6c4cc1d0407f6b79c3a07e152be20a2b30a6..3afb8350a75cca0c3a6111f34334a939b1b33dd5 100644 (file)
/* user space needs this */
#ifndef AF_RPMSG
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
#define AF_RPMSG 40
-#define PF_RPMSG AF_RPMSG
-#endif
+#else
+#define AF_RPMSG 41
+#endif /* LINUX_VERSION_CODE */
+#endif /* AF_RPMSG */
/* Connection and socket states */
enum {
#define RPMSG_LOCALHOST ((__u32) ~0UL)
-#ifdef __KERNEL__
-
-#include <net/sock.h>
-#include <linux/rpmsg.h>
-
-struct rpmsg_socket {
- struct sock sk;
- struct rpmsg_channel *rpdev;
- bool unregister_rpdev;
-};
-
-#endif /* __KERNEL__ */
#endif /* __NET_RPMSG_H */