Lines Matching +full:- +full:m

4  * Copyright (c) 2000-2007, 2014-2017 Ericsson AB
5 * Copyright (c) 2005-2008, 2010-2011, Wind River Systems
53 * - TIPC_LOW_IMPORTANCE
54 * - TIPC_MEDIUM_IMPORTANCE
55 * - TIPC_HIGH_IMPORTANCE
56 * - TIPC_CRITICAL_IMPORTANCE
92 #define SHORT_H_SIZE 24 /* In-cluster basic payload message */
145 #define TIPC_SKB_CB(__skb) ((struct tipc_skb_cb *)&((__skb)->cb[0]))
151 /* struct tipc_gap_ack - TIPC Gap ACK block
157 * --> Gap ACK blocks: <4, 5>, <11, 1>, <15, 4>, <20, 0>
173 * +-------------+-------------+-------------+-------------+
175 * +-------------+-------------+-------------+-------------+ -
177 * +-------------+-------------+-------------+-------------+ > bc gacks
179 * +-------------+-------------+-------------+-------------+ -
181 * +-------------+-------------+-------------+-------------+ > uc gacks
183 * +-------------+-------------+-------------+-------------+ -
201 return (struct tipc_msg *)skb->data; in buf_msg()
204 static inline u32 msg_word(struct tipc_msg *m, u32 pos) in msg_word() argument
206 return ntohl(m->hdr[pos]); in msg_word()
209 static inline void msg_set_word(struct tipc_msg *m, u32 w, u32 val) in msg_set_word() argument
211 m->hdr[w] = htonl(val); in msg_set_word()
214 static inline u32 msg_bits(struct tipc_msg *m, u32 w, u32 pos, u32 mask) in msg_bits() argument
216 return (msg_word(m, w) >> pos) & mask; in msg_bits()
219 static inline void msg_set_bits(struct tipc_msg *m, u32 w, in msg_set_bits() argument
224 m->hdr[w] &= ~htonl(mask); in msg_set_bits()
225 m->hdr[w] |= htonl(val); in msg_set_bits()
230 u32 temp = msg->hdr[a]; in msg_swap_words()
232 msg->hdr[a] = msg->hdr[b]; in msg_swap_words()
233 msg->hdr[b] = temp; in msg_swap_words()
239 static inline u32 msg_version(struct tipc_msg *m) in msg_version() argument
241 return msg_bits(m, 0, 29, 7); in msg_version()
244 static inline void msg_set_version(struct tipc_msg *m) in msg_set_version() argument
246 msg_set_bits(m, 0, 29, 7, TIPC_VERSION); in msg_set_version()
249 static inline u32 msg_user(struct tipc_msg *m) in msg_user() argument
251 return msg_bits(m, 0, 25, 0xf); in msg_user()
254 static inline u32 msg_isdata(struct tipc_msg *m) in msg_isdata() argument
256 return msg_user(m) <= TIPC_CRITICAL_IMPORTANCE; in msg_isdata()
259 static inline void msg_set_user(struct tipc_msg *m, u32 n) in msg_set_user() argument
261 msg_set_bits(m, 0, 25, 0xf, n); in msg_set_user()
264 static inline u32 msg_hdr_sz(struct tipc_msg *m) in msg_hdr_sz() argument
266 return msg_bits(m, 0, 21, 0xf) << 2; in msg_hdr_sz()
269 static inline void msg_set_hdr_sz(struct tipc_msg *m, u32 n) in msg_set_hdr_sz() argument
271 msg_set_bits(m, 0, 21, 0xf, n>>2); in msg_set_hdr_sz()
274 static inline u32 msg_size(struct tipc_msg *m) in msg_size() argument
276 return msg_bits(m, 0, 0, 0x1ffff); in msg_size()
279 static inline u32 msg_blocks(struct tipc_msg *m) in msg_blocks() argument
281 return (msg_size(m) / 1024) + 1; in msg_blocks()
284 static inline u32 msg_data_sz(struct tipc_msg *m) in msg_data_sz() argument
286 return msg_size(m) - msg_hdr_sz(m); in msg_data_sz()
289 static inline int msg_non_seq(struct tipc_msg *m) in msg_non_seq() argument
291 return msg_bits(m, 0, 20, 1); in msg_non_seq()
294 static inline void msg_set_non_seq(struct tipc_msg *m, u32 n) in msg_set_non_seq() argument
296 msg_set_bits(m, 0, 20, 1, n); in msg_set_non_seq()
299 static inline int msg_is_syn(struct tipc_msg *m) in msg_is_syn() argument
301 return msg_bits(m, 0, 17, 1); in msg_is_syn()
304 static inline void msg_set_syn(struct tipc_msg *m, u32 d) in msg_set_syn() argument
306 msg_set_bits(m, 0, 17, 1, d); in msg_set_syn()
309 static inline int msg_dest_droppable(struct tipc_msg *m) in msg_dest_droppable() argument
311 return msg_bits(m, 0, 19, 1); in msg_dest_droppable()
314 static inline void msg_set_dest_droppable(struct tipc_msg *m, u32 d) in msg_set_dest_droppable() argument
316 msg_set_bits(m, 0, 19, 1, d); in msg_set_dest_droppable()
319 static inline int msg_is_keepalive(struct tipc_msg *m) in msg_is_keepalive() argument
321 return msg_bits(m, 0, 19, 1); in msg_is_keepalive()
324 static inline void msg_set_is_keepalive(struct tipc_msg *m, u32 d) in msg_set_is_keepalive() argument
326 msg_set_bits(m, 0, 19, 1, d); in msg_set_is_keepalive()
329 static inline int msg_src_droppable(struct tipc_msg *m) in msg_src_droppable() argument
331 return msg_bits(m, 0, 18, 1); in msg_src_droppable()
334 static inline void msg_set_src_droppable(struct tipc_msg *m, u32 d) in msg_set_src_droppable() argument
336 msg_set_bits(m, 0, 18, 1, d); in msg_set_src_droppable()
339 static inline int msg_ack_required(struct tipc_msg *m) in msg_ack_required() argument
341 return msg_bits(m, 0, 18, 1); in msg_ack_required()
344 static inline void msg_set_ack_required(struct tipc_msg *m) in msg_set_ack_required() argument
346 msg_set_bits(m, 0, 18, 1, 1); in msg_set_ack_required()
349 static inline int msg_nagle_ack(struct tipc_msg *m) in msg_nagle_ack() argument
351 return msg_bits(m, 0, 18, 1); in msg_nagle_ack()
354 static inline void msg_set_nagle_ack(struct tipc_msg *m) in msg_set_nagle_ack() argument
356 msg_set_bits(m, 0, 18, 1, 1); in msg_set_nagle_ack()
359 static inline bool msg_is_rcast(struct tipc_msg *m) in msg_is_rcast() argument
361 return msg_bits(m, 0, 18, 0x1); in msg_is_rcast()
364 static inline void msg_set_is_rcast(struct tipc_msg *m, bool d) in msg_set_is_rcast() argument
366 msg_set_bits(m, 0, 18, 0x1, d); in msg_set_is_rcast()
369 static inline void msg_set_size(struct tipc_msg *m, u32 sz) in msg_set_size() argument
371 m->hdr[0] = htonl((msg_word(m, 0) & ~0x1ffff) | sz); in msg_set_size()
374 static inline unchar *msg_data(struct tipc_msg *m) in msg_data() argument
376 return ((unchar *)m) + msg_hdr_sz(m); in msg_data()
379 static inline struct tipc_msg *msg_inner_hdr(struct tipc_msg *m) in msg_inner_hdr() argument
381 return (struct tipc_msg *)msg_data(m); in msg_inner_hdr()
387 static inline u32 msg_type(struct tipc_msg *m) in msg_type() argument
389 return msg_bits(m, 1, 29, 0x7); in msg_type()
392 static inline void msg_set_type(struct tipc_msg *m, u32 n) in msg_set_type() argument
394 msg_set_bits(m, 1, 29, 0x7, n); in msg_set_type()
397 static inline int msg_in_group(struct tipc_msg *m) in msg_in_group() argument
399 int mtyp = msg_type(m); in msg_in_group()
404 static inline bool msg_is_grp_evt(struct tipc_msg *m) in msg_is_grp_evt() argument
406 return msg_type(m) == TIPC_GRP_MEMBER_EVT; in msg_is_grp_evt()
409 static inline u32 msg_named(struct tipc_msg *m) in msg_named() argument
411 return msg_type(m) == TIPC_NAMED_MSG; in msg_named()
414 static inline u32 msg_mcast(struct tipc_msg *m) in msg_mcast() argument
416 int mtyp = msg_type(m); in msg_mcast()
422 static inline u32 msg_connected(struct tipc_msg *m) in msg_connected() argument
424 return msg_type(m) == TIPC_CONN_MSG; in msg_connected()
427 static inline u32 msg_direct(struct tipc_msg *m) in msg_direct() argument
429 return msg_type(m) == TIPC_DIRECT_MSG; in msg_direct()
432 static inline u32 msg_errcode(struct tipc_msg *m) in msg_errcode() argument
434 return msg_bits(m, 1, 25, 0xf); in msg_errcode()
437 static inline void msg_set_errcode(struct tipc_msg *m, u32 err) in msg_set_errcode() argument
439 msg_set_bits(m, 1, 25, 0xf, err); in msg_set_errcode()
442 static inline void msg_set_bulk(struct tipc_msg *m) in msg_set_bulk() argument
444 msg_set_bits(m, 1, 28, 0x1, 1); in msg_set_bulk()
447 static inline u32 msg_is_bulk(struct tipc_msg *m) in msg_is_bulk() argument
449 return msg_bits(m, 1, 28, 0x1); in msg_is_bulk()
452 static inline void msg_set_last_bulk(struct tipc_msg *m) in msg_set_last_bulk() argument
454 msg_set_bits(m, 1, 27, 0x1, 1); in msg_set_last_bulk()
457 static inline u32 msg_is_last_bulk(struct tipc_msg *m) in msg_is_last_bulk() argument
459 return msg_bits(m, 1, 27, 0x1); in msg_is_last_bulk()
462 static inline void msg_set_non_legacy(struct tipc_msg *m) in msg_set_non_legacy() argument
464 msg_set_bits(m, 1, 26, 0x1, 1); in msg_set_non_legacy()
467 static inline u32 msg_is_legacy(struct tipc_msg *m) in msg_is_legacy() argument
469 return !msg_bits(m, 1, 26, 0x1); in msg_is_legacy()
472 static inline u32 msg_reroute_cnt(struct tipc_msg *m) in msg_reroute_cnt() argument
474 return msg_bits(m, 1, 21, 0xf); in msg_reroute_cnt()
477 static inline void msg_incr_reroute_cnt(struct tipc_msg *m) in msg_incr_reroute_cnt() argument
479 msg_set_bits(m, 1, 21, 0xf, msg_reroute_cnt(m) + 1); in msg_incr_reroute_cnt()
482 static inline void msg_reset_reroute_cnt(struct tipc_msg *m) in msg_reset_reroute_cnt() argument
484 msg_set_bits(m, 1, 21, 0xf, 0); in msg_reset_reroute_cnt()
487 static inline u32 msg_lookup_scope(struct tipc_msg *m) in msg_lookup_scope() argument
489 return msg_bits(m, 1, 19, 0x3); in msg_lookup_scope()
492 static inline void msg_set_lookup_scope(struct tipc_msg *m, u32 n) in msg_set_lookup_scope() argument
494 msg_set_bits(m, 1, 19, 0x3, n); in msg_set_lookup_scope()
497 static inline u16 msg_bcast_ack(struct tipc_msg *m) in msg_bcast_ack() argument
499 return msg_bits(m, 1, 0, 0xffff); in msg_bcast_ack()
502 static inline void msg_set_bcast_ack(struct tipc_msg *m, u16 n) in msg_set_bcast_ack() argument
504 msg_set_bits(m, 1, 0, 0xffff, n); in msg_set_bcast_ack()
507 /* Note: reusing bits in word 1 for ACTIVATE_MSG only, to re-synch
510 static inline bool msg_dest_session_valid(struct tipc_msg *m) in msg_dest_session_valid() argument
512 return msg_bits(m, 1, 16, 0x1); in msg_dest_session_valid()
515 static inline void msg_set_dest_session_valid(struct tipc_msg *m, bool valid) in msg_set_dest_session_valid() argument
517 msg_set_bits(m, 1, 16, 0x1, valid); in msg_set_dest_session_valid()
520 static inline u16 msg_dest_session(struct tipc_msg *m) in msg_dest_session() argument
522 return msg_bits(m, 1, 0, 0xffff); in msg_dest_session()
525 static inline void msg_set_dest_session(struct tipc_msg *m, u16 n) in msg_set_dest_session() argument
527 msg_set_bits(m, 1, 0, 0xffff, n); in msg_set_dest_session()
533 static inline u16 msg_ack(struct tipc_msg *m) in msg_ack() argument
535 return msg_bits(m, 2, 16, 0xffff); in msg_ack()
538 static inline void msg_set_ack(struct tipc_msg *m, u16 n) in msg_set_ack() argument
540 msg_set_bits(m, 2, 16, 0xffff, n); in msg_set_ack()
543 static inline u16 msg_seqno(struct tipc_msg *m) in msg_seqno() argument
545 return msg_bits(m, 2, 0, 0xffff); in msg_seqno()
548 static inline void msg_set_seqno(struct tipc_msg *m, u16 n) in msg_set_seqno() argument
550 msg_set_bits(m, 2, 0, 0xffff, n); in msg_set_seqno()
554 * Words 3-10
556 static inline u32 msg_importance(struct tipc_msg *m) in msg_importance() argument
558 int usr = msg_user(m); in msg_importance()
560 if (likely((usr <= TIPC_CRITICAL_IMPORTANCE) && !msg_errcode(m))) in msg_importance()
563 return msg_bits(m, 9, 0, 0x7); in msg_importance()
567 static inline void msg_set_importance(struct tipc_msg *m, u32 i) in msg_set_importance() argument
569 int usr = msg_user(m); in msg_set_importance()
572 msg_set_bits(m, 9, 0, 0x7, i); in msg_set_importance()
574 msg_set_user(m, i); in msg_set_importance()
579 static inline u32 msg_prevnode(struct tipc_msg *m) in msg_prevnode() argument
581 return msg_word(m, 3); in msg_prevnode()
584 static inline void msg_set_prevnode(struct tipc_msg *m, u32 a) in msg_set_prevnode() argument
586 msg_set_word(m, 3, a); in msg_set_prevnode()
589 static inline u32 msg_origport(struct tipc_msg *m) in msg_origport() argument
591 if (msg_user(m) == MSG_FRAGMENTER) in msg_origport()
592 m = msg_inner_hdr(m); in msg_origport()
593 return msg_word(m, 4); in msg_origport()
596 static inline void msg_set_origport(struct tipc_msg *m, u32 p) in msg_set_origport() argument
598 msg_set_word(m, 4, p); in msg_set_origport()
601 static inline u16 msg_named_seqno(struct tipc_msg *m) in msg_named_seqno() argument
603 return msg_bits(m, 4, 0, 0xffff); in msg_named_seqno()
606 static inline void msg_set_named_seqno(struct tipc_msg *m, u16 n) in msg_set_named_seqno() argument
608 msg_set_bits(m, 4, 0, 0xffff, n); in msg_set_named_seqno()
611 static inline u32 msg_destport(struct tipc_msg *m) in msg_destport() argument
613 return msg_word(m, 5); in msg_destport()
616 static inline void msg_set_destport(struct tipc_msg *m, u32 p) in msg_set_destport() argument
618 msg_set_word(m, 5, p); in msg_set_destport()
621 static inline u32 msg_mc_netid(struct tipc_msg *m) in msg_mc_netid() argument
623 return msg_word(m, 5); in msg_mc_netid()
626 static inline void msg_set_mc_netid(struct tipc_msg *m, u32 p) in msg_set_mc_netid() argument
628 msg_set_word(m, 5, p); in msg_set_mc_netid()
631 static inline int msg_short(struct tipc_msg *m) in msg_short() argument
633 return msg_hdr_sz(m) == SHORT_H_SIZE; in msg_short()
636 static inline u32 msg_orignode(struct tipc_msg *m) in msg_orignode() argument
638 if (likely(msg_short(m))) in msg_orignode()
639 return msg_prevnode(m); in msg_orignode()
640 return msg_word(m, 6); in msg_orignode()
643 static inline void msg_set_orignode(struct tipc_msg *m, u32 a) in msg_set_orignode() argument
645 msg_set_word(m, 6, a); in msg_set_orignode()
648 static inline u32 msg_destnode(struct tipc_msg *m) in msg_destnode() argument
650 return msg_word(m, 7); in msg_destnode()
653 static inline void msg_set_destnode(struct tipc_msg *m, u32 a) in msg_set_destnode() argument
655 msg_set_word(m, 7, a); in msg_set_destnode()
658 static inline u32 msg_nametype(struct tipc_msg *m) in msg_nametype() argument
660 return msg_word(m, 8); in msg_nametype()
663 static inline void msg_set_nametype(struct tipc_msg *m, u32 n) in msg_set_nametype() argument
665 msg_set_word(m, 8, n); in msg_set_nametype()
668 static inline u32 msg_nameinst(struct tipc_msg *m) in msg_nameinst() argument
670 return msg_word(m, 9); in msg_nameinst()
673 static inline u32 msg_namelower(struct tipc_msg *m) in msg_namelower() argument
675 return msg_nameinst(m); in msg_namelower()
678 static inline void msg_set_namelower(struct tipc_msg *m, u32 n) in msg_set_namelower() argument
680 msg_set_word(m, 9, n); in msg_set_namelower()
683 static inline void msg_set_nameinst(struct tipc_msg *m, u32 n) in msg_set_nameinst() argument
685 msg_set_namelower(m, n); in msg_set_nameinst()
688 static inline u32 msg_nameupper(struct tipc_msg *m) in msg_nameupper() argument
690 return msg_word(m, 10); in msg_nameupper()
693 static inline void msg_set_nameupper(struct tipc_msg *m, u32 n) in msg_set_nameupper() argument
695 msg_set_word(m, 10, n); in msg_set_nameupper()
759 static inline u32 msg_seq_gap(struct tipc_msg *m) in msg_seq_gap() argument
761 return msg_bits(m, 1, 16, 0x1fff); in msg_seq_gap()
764 static inline void msg_set_seq_gap(struct tipc_msg *m, u32 n) in msg_set_seq_gap() argument
766 msg_set_bits(m, 1, 16, 0x1fff, n); in msg_set_seq_gap()
769 static inline u32 msg_node_sig(struct tipc_msg *m) in msg_node_sig() argument
771 return msg_bits(m, 1, 0, 0xffff); in msg_node_sig()
774 static inline void msg_set_node_sig(struct tipc_msg *m, u32 n) in msg_set_node_sig() argument
776 msg_set_bits(m, 1, 0, 0xffff, n); in msg_set_node_sig()
779 static inline u32 msg_node_capabilities(struct tipc_msg *m) in msg_node_capabilities() argument
781 return msg_bits(m, 1, 15, 0x1fff); in msg_node_capabilities()
784 static inline void msg_set_node_capabilities(struct tipc_msg *m, u32 n) in msg_set_node_capabilities() argument
786 msg_set_bits(m, 1, 15, 0x1fff, n); in msg_set_node_capabilities()
792 static inline u32 msg_dest_domain(struct tipc_msg *m) in msg_dest_domain() argument
794 return msg_word(m, 2); in msg_dest_domain()
797 static inline void msg_set_dest_domain(struct tipc_msg *m, u32 n) in msg_set_dest_domain() argument
799 msg_set_word(m, 2, n); in msg_set_dest_domain()
802 static inline u32 msg_bcgap_after(struct tipc_msg *m) in msg_bcgap_after() argument
804 return msg_bits(m, 2, 16, 0xffff); in msg_bcgap_after()
807 static inline void msg_set_bcgap_after(struct tipc_msg *m, u32 n) in msg_set_bcgap_after() argument
809 msg_set_bits(m, 2, 16, 0xffff, n); in msg_set_bcgap_after()
812 static inline u32 msg_bcgap_to(struct tipc_msg *m) in msg_bcgap_to() argument
814 return msg_bits(m, 2, 0, 0xffff); in msg_bcgap_to()
817 static inline void msg_set_bcgap_to(struct tipc_msg *m, u32 n) in msg_set_bcgap_to() argument
819 msg_set_bits(m, 2, 0, 0xffff, n); in msg_set_bcgap_to()
825 static inline u32 msg_last_bcast(struct tipc_msg *m) in msg_last_bcast() argument
827 return msg_bits(m, 4, 16, 0xffff); in msg_last_bcast()
830 static inline u32 msg_bc_snd_nxt(struct tipc_msg *m) in msg_bc_snd_nxt() argument
832 return msg_last_bcast(m) + 1; in msg_bc_snd_nxt()
835 static inline void msg_set_last_bcast(struct tipc_msg *m, u32 n) in msg_set_last_bcast() argument
837 msg_set_bits(m, 4, 16, 0xffff, n); in msg_set_last_bcast()
840 static inline u32 msg_nof_fragms(struct tipc_msg *m) in msg_nof_fragms() argument
842 return msg_bits(m, 4, 0, 0xffff); in msg_nof_fragms()
845 static inline void msg_set_nof_fragms(struct tipc_msg *m, u32 n) in msg_set_nof_fragms() argument
847 msg_set_bits(m, 4, 0, 0xffff, n); in msg_set_nof_fragms()
850 static inline u32 msg_fragm_no(struct tipc_msg *m) in msg_fragm_no() argument
852 return msg_bits(m, 4, 16, 0xffff); in msg_fragm_no()
855 static inline void msg_set_fragm_no(struct tipc_msg *m, u32 n) in msg_set_fragm_no() argument
857 msg_set_bits(m, 4, 16, 0xffff, n); in msg_set_fragm_no()
860 static inline u16 msg_next_sent(struct tipc_msg *m) in msg_next_sent() argument
862 return msg_bits(m, 4, 0, 0xffff); in msg_next_sent()
865 static inline void msg_set_next_sent(struct tipc_msg *m, u16 n) in msg_set_next_sent() argument
867 msg_set_bits(m, 4, 0, 0xffff, n); in msg_set_next_sent()
870 static inline void msg_set_long_msgno(struct tipc_msg *m, u32 n) in msg_set_long_msgno() argument
872 msg_set_bits(m, 4, 0, 0xffff, n); in msg_set_long_msgno()
875 static inline u32 msg_bc_netid(struct tipc_msg *m) in msg_bc_netid() argument
877 return msg_word(m, 4); in msg_bc_netid()
880 static inline void msg_set_bc_netid(struct tipc_msg *m, u32 id) in msg_set_bc_netid() argument
882 msg_set_word(m, 4, id); in msg_set_bc_netid()
885 static inline u32 msg_link_selector(struct tipc_msg *m) in msg_link_selector() argument
887 if (msg_user(m) == MSG_FRAGMENTER) in msg_link_selector()
888 m = (void *)msg_data(m); in msg_link_selector()
889 return msg_bits(m, 4, 0, 1); in msg_link_selector()
895 static inline u16 msg_session(struct tipc_msg *m) in msg_session() argument
897 return msg_bits(m, 5, 16, 0xffff); in msg_session()
900 static inline void msg_set_session(struct tipc_msg *m, u16 n) in msg_set_session() argument
902 msg_set_bits(m, 5, 16, 0xffff, n); in msg_set_session()
905 static inline u32 msg_probe(struct tipc_msg *m) in msg_probe() argument
907 return msg_bits(m, 5, 0, 1); in msg_probe()
910 static inline void msg_set_probe(struct tipc_msg *m, u32 val) in msg_set_probe() argument
912 msg_set_bits(m, 5, 0, 1, val); in msg_set_probe()
915 static inline char msg_net_plane(struct tipc_msg *m) in msg_net_plane() argument
917 return msg_bits(m, 5, 1, 7) + 'A'; in msg_net_plane()
920 static inline void msg_set_net_plane(struct tipc_msg *m, char n) in msg_set_net_plane() argument
922 msg_set_bits(m, 5, 1, 7, (n - 'A')); in msg_set_net_plane()
925 static inline u32 msg_linkprio(struct tipc_msg *m) in msg_linkprio() argument
927 return msg_bits(m, 5, 4, 0x1f); in msg_linkprio()
930 static inline void msg_set_linkprio(struct tipc_msg *m, u32 n) in msg_set_linkprio() argument
932 msg_set_bits(m, 5, 4, 0x1f, n); in msg_set_linkprio()
935 static inline u32 msg_bearer_id(struct tipc_msg *m) in msg_bearer_id() argument
937 return msg_bits(m, 5, 9, 0x7); in msg_bearer_id()
940 static inline void msg_set_bearer_id(struct tipc_msg *m, u32 n) in msg_set_bearer_id() argument
942 msg_set_bits(m, 5, 9, 0x7, n); in msg_set_bearer_id()
945 static inline u32 msg_redundant_link(struct tipc_msg *m) in msg_redundant_link() argument
947 return msg_bits(m, 5, 12, 0x1); in msg_redundant_link()
950 static inline void msg_set_redundant_link(struct tipc_msg *m, u32 r) in msg_set_redundant_link() argument
952 msg_set_bits(m, 5, 12, 0x1, r); in msg_set_redundant_link()
955 static inline u32 msg_peer_stopping(struct tipc_msg *m) in msg_peer_stopping() argument
957 return msg_bits(m, 5, 13, 0x1); in msg_peer_stopping()
960 static inline void msg_set_peer_stopping(struct tipc_msg *m, u32 s) in msg_set_peer_stopping() argument
962 msg_set_bits(m, 5, 13, 0x1, s); in msg_set_peer_stopping()
965 static inline bool msg_bc_ack_invalid(struct tipc_msg *m) in msg_bc_ack_invalid() argument
967 switch (msg_user(m)) { in msg_bc_ack_invalid()
971 return msg_bits(m, 5, 14, 0x1); in msg_bc_ack_invalid()
977 static inline void msg_set_bc_ack_invalid(struct tipc_msg *m, bool invalid) in msg_set_bc_ack_invalid() argument
979 msg_set_bits(m, 5, 14, 0x1, invalid); in msg_set_bc_ack_invalid()
982 static inline char *msg_media_addr(struct tipc_msg *m) in msg_media_addr() argument
984 return (char *)&m->hdr[TIPC_MEDIA_INFO_OFFSET]; in msg_media_addr()
987 static inline u32 msg_bc_gap(struct tipc_msg *m) in msg_bc_gap() argument
989 return msg_bits(m, 8, 0, 0x3ff); in msg_bc_gap()
992 static inline void msg_set_bc_gap(struct tipc_msg *m, u32 n) in msg_set_bc_gap() argument
994 msg_set_bits(m, 8, 0, 0x3ff, n); in msg_set_bc_gap()
1000 static inline u16 msg_msgcnt(struct tipc_msg *m) in msg_msgcnt() argument
1002 return msg_bits(m, 9, 16, 0xffff); in msg_msgcnt()
1005 static inline void msg_set_msgcnt(struct tipc_msg *m, u16 n) in msg_set_msgcnt() argument
1007 msg_set_bits(m, 9, 16, 0xffff, n); in msg_set_msgcnt()
1010 static inline u16 msg_syncpt(struct tipc_msg *m) in msg_syncpt() argument
1012 return msg_bits(m, 9, 16, 0xffff); in msg_syncpt()
1015 static inline void msg_set_syncpt(struct tipc_msg *m, u16 n) in msg_set_syncpt() argument
1017 msg_set_bits(m, 9, 16, 0xffff, n); in msg_set_syncpt()
1020 static inline u32 msg_conn_ack(struct tipc_msg *m) in msg_conn_ack() argument
1022 return msg_bits(m, 9, 16, 0xffff); in msg_conn_ack()
1025 static inline void msg_set_conn_ack(struct tipc_msg *m, u32 n) in msg_set_conn_ack() argument
1027 msg_set_bits(m, 9, 16, 0xffff, n); in msg_set_conn_ack()
1030 static inline u16 msg_adv_win(struct tipc_msg *m) in msg_adv_win() argument
1032 return msg_bits(m, 9, 0, 0xffff); in msg_adv_win()
1035 static inline void msg_set_adv_win(struct tipc_msg *m, u16 n) in msg_set_adv_win() argument
1037 msg_set_bits(m, 9, 0, 0xffff, n); in msg_set_adv_win()
1040 static inline u32 msg_max_pkt(struct tipc_msg *m) in msg_max_pkt() argument
1042 return msg_bits(m, 9, 16, 0xffff) * 4; in msg_max_pkt()
1045 static inline void msg_set_max_pkt(struct tipc_msg *m, u32 n) in msg_set_max_pkt() argument
1047 msg_set_bits(m, 9, 16, 0xffff, (n / 4)); in msg_set_max_pkt()
1050 static inline u32 msg_link_tolerance(struct tipc_msg *m) in msg_link_tolerance() argument
1052 return msg_bits(m, 9, 0, 0xffff); in msg_link_tolerance()
1055 static inline void msg_set_link_tolerance(struct tipc_msg *m, u32 n) in msg_set_link_tolerance() argument
1057 msg_set_bits(m, 9, 0, 0xffff, n); in msg_set_link_tolerance()
1060 static inline u16 msg_grp_bc_syncpt(struct tipc_msg *m) in msg_grp_bc_syncpt() argument
1062 return msg_bits(m, 9, 16, 0xffff); in msg_grp_bc_syncpt()
1065 static inline void msg_set_grp_bc_syncpt(struct tipc_msg *m, u16 n) in msg_set_grp_bc_syncpt() argument
1067 msg_set_bits(m, 9, 16, 0xffff, n); in msg_set_grp_bc_syncpt()
1070 static inline u16 msg_grp_bc_acked(struct tipc_msg *m) in msg_grp_bc_acked() argument
1072 return msg_bits(m, 9, 16, 0xffff); in msg_grp_bc_acked()
1075 static inline void msg_set_grp_bc_acked(struct tipc_msg *m, u16 n) in msg_set_grp_bc_acked() argument
1077 msg_set_bits(m, 9, 16, 0xffff, n); in msg_set_grp_bc_acked()
1080 static inline u16 msg_grp_remitted(struct tipc_msg *m) in msg_grp_remitted() argument
1082 return msg_bits(m, 9, 16, 0xffff); in msg_grp_remitted()
1085 static inline void msg_set_grp_remitted(struct tipc_msg *m, u16 n) in msg_set_grp_remitted() argument
1087 msg_set_bits(m, 9, 16, 0xffff, n); in msg_set_grp_remitted()
1092 static inline u16 msg_grp_evt(struct tipc_msg *m) in msg_grp_evt() argument
1094 return msg_bits(m, 10, 0, 0x3); in msg_grp_evt()
1097 static inline void msg_set_grp_evt(struct tipc_msg *m, int n) in msg_set_grp_evt() argument
1099 msg_set_bits(m, 10, 0, 0x3, n); in msg_set_grp_evt()
1102 static inline u16 msg_grp_bc_ack_req(struct tipc_msg *m) in msg_grp_bc_ack_req() argument
1104 return msg_bits(m, 10, 0, 0x1); in msg_grp_bc_ack_req()
1107 static inline void msg_set_grp_bc_ack_req(struct tipc_msg *m, bool n) in msg_set_grp_bc_ack_req() argument
1109 msg_set_bits(m, 10, 0, 0x1, n); in msg_set_grp_bc_ack_req()
1112 static inline u16 msg_grp_bc_seqno(struct tipc_msg *m) in msg_grp_bc_seqno() argument
1114 return msg_bits(m, 10, 16, 0xffff); in msg_grp_bc_seqno()
1117 static inline void msg_set_grp_bc_seqno(struct tipc_msg *m, u32 n) in msg_set_grp_bc_seqno() argument
1119 msg_set_bits(m, 10, 16, 0xffff, n); in msg_set_grp_bc_seqno()
1122 static inline bool msg_peer_link_is_up(struct tipc_msg *m) in msg_peer_link_is_up() argument
1124 if (likely(msg_user(m) != LINK_PROTOCOL)) in msg_peer_link_is_up()
1126 if (msg_type(m) == STATE_MSG) in msg_peer_link_is_up()
1131 static inline bool msg_peer_node_is_up(struct tipc_msg *m) in msg_peer_node_is_up() argument
1133 if (msg_peer_link_is_up(m)) in msg_peer_node_is_up()
1135 return msg_redundant_link(m); in msg_peer_node_is_up()
1145 static inline void msg_set_peer_net_hash(struct tipc_msg *m, u32 n) in msg_set_peer_net_hash() argument
1147 msg_set_word(m, 13, n); in msg_set_peer_net_hash()
1150 static inline u32 msg_peer_net_hash(struct tipc_msg *m) in msg_peer_net_hash() argument
1152 return msg_word(m, 13); in msg_peer_net_hash()
1157 static inline u32 msg_sugg_node_addr(struct tipc_msg *m) in msg_sugg_node_addr() argument
1159 return msg_word(m, 14); in msg_sugg_node_addr()
1162 static inline void msg_set_sugg_node_addr(struct tipc_msg *m, u32 n) in msg_set_sugg_node_addr() argument
1164 msg_set_word(m, 14, n); in msg_set_sugg_node_addr()
1182 void tipc_msg_init(u32 own_addr, struct tipc_msg *m, u32 user, u32 type,
1193 int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m,
1195 int tipc_msg_append(struct tipc_msg *hdr, struct msghdr *m, int dlen,
1213 return (skb->len / 1024 + 1) * 1024; in buf_roundup_len()
1247 spin_lock_bh(&list->lock); in tipc_skb_peek_port()
1257 spin_unlock_bh(&list->lock); in tipc_skb_peek_port()
1270 spin_lock_bh(&list->lock); in tipc_skb_dequeue()
1278 spin_unlock_bh(&list->lock); in tipc_skb_dequeue()
1282 /* tipc_skb_queue_splice_tail - append an skb list to lock protected list
1289 spin_lock_bh(&head->lock); in tipc_skb_queue_splice_tail()
1291 spin_unlock_bh(&head->lock); in tipc_skb_queue_splice_tail()
1294 /* tipc_skb_queue_splice_tail_init - merge two lock protected skb lists
1305 spin_lock_bh(&list->lock); in tipc_skb_queue_splice_tail_init()
1307 spin_unlock_bh(&list->lock); in tipc_skb_queue_splice_tail_init()
1311 /* __tipc_skb_dequeue() - dequeue the head skb according to expected seqno