aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/msg.h
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2015-01-09 02:27:01 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-12 16:24:31 -0500
commit859fc7c0cedca0f84dac471fa31e9512259e1ecd (patch)
treef2a691e4a01426aa4c44f202a409eca43e18f7c6 /net/tipc/msg.h
parent2f55c43788df7358be8c6e78ae2a3d3268e7afb6 (diff)
tipc: cleanup core.c and core.h files
Only the works of initializing and shutting down tipc module are done in core.h and core.c files, so all stuffs which are not closely associated with the two tasks should be moved to appropriate places. Signed-off-by: Ying Xue <ying.xue@windriver.com> Tested-by: Tero Aho <Tero.Aho@coriant.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/msg.h')
-rw-r--r--net/tipc/msg.h37
1 files changed, 29 insertions, 8 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 1a52f7cf3cd3..0065a2e8ad9b 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -77,10 +77,38 @@
77 77
78#define TIPC_MEDIA_ADDR_OFFSET 5 78#define TIPC_MEDIA_ADDR_OFFSET 5
79 79
80/**
81 * TIPC message buffer code
82 *
83 * TIPC message buffer headroom reserves space for the worst-case
84 * link-level device header (in case the message is sent off-node).
85 *
86 * Note: Headroom should be a multiple of 4 to ensure the TIPC header fields
87 * are word aligned for quicker access
88 */
89#define BUF_HEADROOM LL_MAX_HEADER
90
91struct tipc_skb_cb {
92 void *handle;
93 struct sk_buff *tail;
94 bool deferred;
95 bool wakeup_pending;
96 bool bundling;
97 u16 chain_sz;
98 u16 chain_imp;
99};
100
101#define TIPC_SKB_CB(__skb) ((struct tipc_skb_cb *)&((__skb)->cb[0]))
102
80struct tipc_msg { 103struct tipc_msg {
81 __be32 hdr[15]; 104 __be32 hdr[15];
82}; 105};
83 106
107static inline struct tipc_msg *buf_msg(struct sk_buff *skb)
108{
109 return (struct tipc_msg *)skb->data;
110}
111
84static inline u32 msg_word(struct tipc_msg *m, u32 pos) 112static inline u32 msg_word(struct tipc_msg *m, u32 pos)
85{ 113{
86 return ntohl(m->hdr[pos]); 114 return ntohl(m->hdr[pos]);
@@ -719,27 +747,20 @@ static inline u32 msg_tot_origport(struct tipc_msg *m)
719 return msg_origport(m); 747 return msg_origport(m);
720} 748}
721 749
750struct sk_buff *tipc_buf_acquire(u32 size);
722bool tipc_msg_reverse(struct sk_buff *buf, u32 *dnode, int err); 751bool tipc_msg_reverse(struct sk_buff *buf, u32 *dnode, int err);
723
724int tipc_msg_eval(struct sk_buff *buf, u32 *dnode); 752int tipc_msg_eval(struct sk_buff *buf, u32 *dnode);
725
726void tipc_msg_init(struct tipc_msg *m, u32 user, u32 type, u32 hsize, 753void tipc_msg_init(struct tipc_msg *m, u32 user, u32 type, u32 hsize,
727 u32 destnode); 754 u32 destnode);
728
729struct sk_buff *tipc_msg_create(uint user, uint type, uint hdr_sz, 755struct sk_buff *tipc_msg_create(uint user, uint type, uint hdr_sz,
730 uint data_sz, u32 dnode, u32 onode, 756 uint data_sz, u32 dnode, u32 onode,
731 u32 dport, u32 oport, int errcode); 757 u32 dport, u32 oport, int errcode);
732
733int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf); 758int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf);
734
735bool tipc_msg_bundle(struct sk_buff_head *list, struct sk_buff *skb, u32 mtu); 759bool tipc_msg_bundle(struct sk_buff_head *list, struct sk_buff *skb, u32 mtu);
736
737bool tipc_msg_make_bundle(struct sk_buff_head *list, struct sk_buff *skb, 760bool tipc_msg_make_bundle(struct sk_buff_head *list, struct sk_buff *skb,
738 u32 mtu, u32 dnode); 761 u32 mtu, u32 dnode);
739
740int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m, int offset, 762int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m, int offset,
741 int dsz, int mtu, struct sk_buff_head *list); 763 int dsz, int mtu, struct sk_buff_head *list);
742
743struct sk_buff *tipc_msg_reassemble(struct sk_buff_head *list); 764struct sk_buff *tipc_msg_reassemble(struct sk_buff_head *list);
744 765
745#endif 766#endif