diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2010-05-11 16:30:11 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-13 08:02:24 +0200 |
commit | 01fee256a675f6492fc6945bbb9b59640d8705d4 (patch) | |
tree | ab5ac9e161298795006b85a53eb9354a1605d3a0 /net/tipc/link.h | |
parent | tipc: remove abstraction for link_max_pkt (diff) | |
download | linux-01fee256a675f6492fc6945bbb9b59640d8705d4.tar.xz linux-01fee256a675f6492fc6945bbb9b59640d8705d4.zip |
tipc: Relocate trivial link status functions to header file
Rather than live in link.c where they can only be used in that file alone,
these helper routines are better served by being in link.h
Relocated are the following:
link_working_working
link_working_unknown
link_reset_unknown
link_reset_reset
link_blocked
link_congested
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | net/tipc/link.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/net/tipc/link.h b/net/tipc/link.h index 6a51e38ad25c..2e5385c47d30 100644 --- a/net/tipc/link.h +++ b/net/tipc/link.h @@ -292,4 +292,39 @@ static inline u32 lesser(u32 left, u32 right) return less_eq(left, right) ? left : right; } + +/* + * Link status checking routines + */ + +static inline int link_working_working(struct link *l_ptr) +{ + return (l_ptr->state == WORKING_WORKING); +} + +static inline int link_working_unknown(struct link *l_ptr) +{ + return (l_ptr->state == WORKING_UNKNOWN); +} + +static inline int link_reset_unknown(struct link *l_ptr) +{ + return (l_ptr->state == RESET_UNKNOWN); +} + +static inline int link_reset_reset(struct link *l_ptr) +{ + return (l_ptr->state == RESET_RESET); +} + +static inline int link_blocked(struct link *l_ptr) +{ + return (l_ptr->exp_msg_count || l_ptr->blocked); +} + +static inline int link_congested(struct link *l_ptr) +{ + return (l_ptr->out_queue_size >= l_ptr->queue_limit[0]); +} + #endif |