aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/msg.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-03-19 20:02:01 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-03-19 20:02:01 -0400
commit10ce3cc919f50c2043b41ca968b43c26a3672600 (patch)
treeea409366a5208aced495bc0516a08b81fd43222e /net/tipc/msg.h
parent24e3e5ae1e4c2a3a32f5b1f96b4e3fd721806acd (diff)
parent5c6a7a62c130afef3d61c1dee153012231ff5cd9 (diff)
Merge branch 'next' into for-linus
Diffstat (limited to 'net/tipc/msg.h')
-rw-r--r--net/tipc/msg.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index d93178f2e852..7b0cda167107 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -78,6 +78,8 @@
78 78
79#define MAX_MSG_SIZE (MAX_H_SIZE + TIPC_MAX_USER_MSG_SIZE) 79#define MAX_MSG_SIZE (MAX_H_SIZE + TIPC_MAX_USER_MSG_SIZE)
80 80
81#define TIPC_MEDIA_ADDR_OFFSET 5
82
81 83
82struct tipc_msg { 84struct tipc_msg {
83 __be32 hdr[15]; 85 __be32 hdr[15];
@@ -682,6 +684,10 @@ static inline void msg_set_redundant_link(struct tipc_msg *m, u32 r)
682 msg_set_bits(m, 5, 12, 0x1, r); 684 msg_set_bits(m, 5, 12, 0x1, r);
683} 685}
684 686
687static inline char *msg_media_addr(struct tipc_msg *m)
688{
689 return (char *)&m->hdr[TIPC_MEDIA_ADDR_OFFSET];
690}
685 691
686/* 692/*
687 * Word 9 693 * Word 9
@@ -734,14 +740,4 @@ int tipc_msg_build(struct tipc_msg *hdr, struct iovec const *msg_sect,
734 u32 num_sect, unsigned int total_len, 740 u32 num_sect, unsigned int total_len,
735 int max_size, int usrmem, struct sk_buff **buf); 741 int max_size, int usrmem, struct sk_buff **buf);
736 742
737static inline void msg_set_media_addr(struct tipc_msg *m, struct tipc_media_addr *a)
738{
739 memcpy(&((int *)m)[5], a, sizeof(*a));
740}
741
742static inline void msg_get_media_addr(struct tipc_msg *m, struct tipc_media_addr *a)
743{
744 memcpy(a, &((int *)m)[5], sizeof(*a));
745}
746
747#endif 743#endif