aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2014-02-13 17:29:08 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-13 17:57:05 -0500
commit135daee6d3959a6d7c4f59b448ed6f854d88ce27 (patch)
treeb79670bd960e4985a63d5d1e3967caf298658e22 /net/tipc
parent8d8439b686f15c23faef4d7d67c4a9f30ce0f2b5 (diff)
tipc: redefine 'started' flag in struct link to bitmap
Currently, the 'started' field in struct tipc_link represents only a binary state, 'started' or 'not started'. We need it to represent more link execution states in the coming commits in this series. Hence, we rename the field to 'flags', and define the current started/non-started state to be represented by the LSB bit of that field. Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/link.c4
-rw-r--r--net/tipc/link.h22
2 files changed, 13 insertions, 13 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 424e9f3acd81..2070d032c923 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -500,7 +500,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
500 struct tipc_link *other; 500 struct tipc_link *other;
501 u32 cont_intv = l_ptr->continuity_interval; 501 u32 cont_intv = l_ptr->continuity_interval;
502 502
503 if (!l_ptr->started && (event != STARTING_EVT)) 503 if (!(l_ptr->flags & LINK_STARTED) && (event != STARTING_EVT))
504 return; /* Not yet. */ 504 return; /* Not yet. */
505 505
506 /* Check whether changeover is going on */ 506 /* Check whether changeover is going on */
@@ -626,7 +626,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
626 link_set_timer(l_ptr, cont_intv); 626 link_set_timer(l_ptr, cont_intv);
627 break; 627 break;
628 case STARTING_EVT: 628 case STARTING_EVT:
629 l_ptr->started = 1; 629 l_ptr->flags |= LINK_STARTED;
630 /* fall through */ 630 /* fall through */
631 case TIMEOUT_EVT: 631 case TIMEOUT_EVT:
632 tipc_link_send_proto_msg(l_ptr, RESET_MSG, 0, 0, 0, 0, 0); 632 tipc_link_send_proto_msg(l_ptr, RESET_MSG, 0, 0, 0, 0, 0);
diff --git a/net/tipc/link.h b/net/tipc/link.h
index 994ebd16ddc3..a900e74b4f3a 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * net/tipc/link.h: Include file for TIPC link code 2 * net/tipc/link.h: Include file for TIPC link code
3 * 3 *
4 * Copyright (c) 1995-2006, Ericsson AB 4 * Copyright (c) 1995-2006, 2013, Ericsson AB
5 * Copyright (c) 2004-2005, 2010-2011, Wind River Systems 5 * Copyright (c) 2004-2005, 2010-2011, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
@@ -40,27 +40,27 @@
40#include "msg.h" 40#include "msg.h"
41#include "node.h" 41#include "node.h"
42 42
43/* 43/* Link reassembly status codes
44 * Link reassembly status codes
45 */ 44 */
46#define LINK_REASM_ERROR -1 45#define LINK_REASM_ERROR -1
47#define LINK_REASM_COMPLETE 1 46#define LINK_REASM_COMPLETE 1
48 47
49/* 48/* Out-of-range value for link sequence numbers
50 * Out-of-range value for link sequence numbers
51 */ 49 */
52#define INVALID_LINK_SEQ 0x10000 50#define INVALID_LINK_SEQ 0x10000
53 51
54/* 52/* Link working states
55 * Link states
56 */ 53 */
57#define WORKING_WORKING 560810u 54#define WORKING_WORKING 560810u
58#define WORKING_UNKNOWN 560811u 55#define WORKING_UNKNOWN 560811u
59#define RESET_UNKNOWN 560812u 56#define RESET_UNKNOWN 560812u
60#define RESET_RESET 560813u 57#define RESET_RESET 560813u
61 58
62/* 59/* Link endpoint execution states
63 * Starting value for maximum packet size negotiation on unicast links 60 */
61#define LINK_STARTED 0x0001
62
63/* Starting value for maximum packet size negotiation on unicast links
64 * (unless bearer MTU is less) 64 * (unless bearer MTU is less)
65 */ 65 */
66#define MAX_PKT_DEFAULT 1500 66#define MAX_PKT_DEFAULT 1500
@@ -103,7 +103,7 @@ struct tipc_stats {
103 * @timer: link timer 103 * @timer: link timer
104 * @owner: pointer to peer node 104 * @owner: pointer to peer node
105 * @link_list: adjacent links in bearer's list of links 105 * @link_list: adjacent links in bearer's list of links
106 * @started: indicates if link has been started 106 * @flags: execution state flags for link endpoint instance
107 * @checkpoint: reference point for triggering link continuity checking 107 * @checkpoint: reference point for triggering link continuity checking
108 * @peer_session: link session # being used by peer end of link 108 * @peer_session: link session # being used by peer end of link
109 * @peer_bearer_id: bearer id used by link's peer endpoint 109 * @peer_bearer_id: bearer id used by link's peer endpoint
@@ -152,7 +152,7 @@ struct tipc_link {
152 struct list_head link_list; 152 struct list_head link_list;
153 153
154 /* Management and link supervision data */ 154 /* Management and link supervision data */
155 int started; 155 unsigned int flags;
156 u32 checkpoint; 156 u32 checkpoint;
157 u32 peer_session; 157 u32 peer_session;
158 u32 peer_bearer_id; 158 u32 peer_bearer_id;