aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/msg.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/msg.h')
-rw-r--r--net/tipc/msg.h34
1 files changed, 7 insertions, 27 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 8452454731f..d93178f2e85 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -68,10 +68,10 @@
68 * Message header sizes 68 * Message header sizes
69 */ 69 */
70 70
71#define SHORT_H_SIZE 24 /* Connected, in-cluster messages */ 71#define SHORT_H_SIZE 24 /* In-cluster basic payload message */
72#define DIR_MSG_H_SIZE 32 /* Directly addressed messages */ 72#define BASIC_H_SIZE 32 /* Basic payload message */
73#define LONG_H_SIZE 40 /* Named messages */ 73#define NAMED_H_SIZE 40 /* Named payload message */
74#define MCAST_H_SIZE 44 /* Multicast messages */ 74#define MCAST_H_SIZE 44 /* Multicast payload message */
75#define INT_H_SIZE 40 /* Internal messages */ 75#define INT_H_SIZE 40 /* Internal messages */
76#define MIN_H_SIZE 24 /* Smallest legal TIPC header size */ 76#define MIN_H_SIZE 24 /* Smallest legal TIPC header size */
77#define MAX_H_SIZE 60 /* Largest possible TIPC header size */ 77#define MAX_H_SIZE 60 /* Largest possible TIPC header size */
@@ -311,26 +311,6 @@ static inline void msg_set_seqno(struct tipc_msg *m, u32 n)
311} 311}
312 312
313/* 313/*
314 * TIPC may utilize the "link ack #" and "link seq #" fields of a short
315 * message header to hold the destination node for the message, since the
316 * normal "dest node" field isn't present. This cache is only referenced
317 * when required, so populating the cache of a longer message header is
318 * harmless (as long as the header has the two link sequence fields present).
319 *
320 * Note: Host byte order is OK here, since the info never goes off-card.
321 */
322
323static inline u32 msg_destnode_cache(struct tipc_msg *m)
324{
325 return m->hdr[2];
326}
327
328static inline void msg_set_destnode_cache(struct tipc_msg *m, u32 dnode)
329{
330 m->hdr[2] = dnode;
331}
332
333/*
334 * Words 3-10 314 * Words 3-10
335 */ 315 */
336 316
@@ -377,7 +357,7 @@ static inline void msg_set_mc_netid(struct tipc_msg *m, u32 p)
377 357
378static inline int msg_short(struct tipc_msg *m) 358static inline int msg_short(struct tipc_msg *m)
379{ 359{
380 return msg_hdr_sz(m) == 24; 360 return msg_hdr_sz(m) == SHORT_H_SIZE;
381} 361}
382 362
383static inline u32 msg_orignode(struct tipc_msg *m) 363static inline u32 msg_orignode(struct tipc_msg *m)
@@ -635,7 +615,7 @@ static inline u32 msg_link_selector(struct tipc_msg *m)
635 615
636static inline void msg_set_link_selector(struct tipc_msg *m, u32 n) 616static inline void msg_set_link_selector(struct tipc_msg *m, u32 n)
637{ 617{
638 msg_set_bits(m, 4, 0, 1, (n & 1)); 618 msg_set_bits(m, 4, 0, 1, n);
639} 619}
640 620
641/* 621/*
@@ -659,7 +639,7 @@ static inline u32 msg_probe(struct tipc_msg *m)
659 639
660static inline void msg_set_probe(struct tipc_msg *m, u32 val) 640static inline void msg_set_probe(struct tipc_msg *m, u32 val)
661{ 641{
662 msg_set_bits(m, 5, 0, 1, (val & 1)); 642 msg_set_bits(m, 5, 0, 1, val);
663} 643}
664 644
665static inline char msg_net_plane(struct tipc_msg *m) 645static inline char msg_net_plane(struct tipc_msg *m)