aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/discover.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/discover.c')
-rw-r--r--net/tipc/discover.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index fa026bd91a68..59a86fc5b6d0 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -2,7 +2,7 @@
2 * net/tipc/discover.c 2 * net/tipc/discover.c
3 * 3 *
4 * Copyright (c) 2003-2006, Ericsson AB 4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005-2006, Wind River Systems 5 * Copyright (c) 2005-2006, 2010-2011, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -57,7 +57,7 @@
57 * @timer_intv: current interval between requests (in ms) 57 * @timer_intv: current interval between requests (in ms)
58 */ 58 */
59struct link_req { 59struct link_req {
60 struct bearer *bearer; 60 struct tipc_bearer *bearer;
61 struct tipc_media_addr dest; 61 struct tipc_media_addr dest;
62 struct sk_buff *buf; 62 struct sk_buff *buf;
63 struct timer_list timer; 63 struct timer_list timer;
@@ -75,7 +75,7 @@ struct link_req {
75static struct sk_buff *tipc_disc_init_msg(u32 type, 75static struct sk_buff *tipc_disc_init_msg(u32 type,
76 u32 req_links, 76 u32 req_links,
77 u32 dest_domain, 77 u32 dest_domain,
78 struct bearer *b_ptr) 78 struct tipc_bearer *b_ptr)
79{ 79{
80 struct sk_buff *buf = tipc_buf_acquire(DSC_H_SIZE); 80 struct sk_buff *buf = tipc_buf_acquire(DSC_H_SIZE);
81 struct tipc_msg *msg; 81 struct tipc_msg *msg;
@@ -87,7 +87,7 @@ static struct sk_buff *tipc_disc_init_msg(u32 type,
87 msg_set_req_links(msg, req_links); 87 msg_set_req_links(msg, req_links);
88 msg_set_dest_domain(msg, dest_domain); 88 msg_set_dest_domain(msg, dest_domain);
89 msg_set_bc_netid(msg, tipc_net_id); 89 msg_set_bc_netid(msg, tipc_net_id);
90 msg_set_media_addr(msg, &b_ptr->publ.addr); 90 msg_set_media_addr(msg, &b_ptr->addr);
91 } 91 }
92 return buf; 92 return buf;
93} 93}
@@ -99,7 +99,7 @@ static struct sk_buff *tipc_disc_init_msg(u32 type,
99 * @media_addr: media address advertised by duplicated node 99 * @media_addr: media address advertised by duplicated node
100 */ 100 */
101 101
102static void disc_dupl_alert(struct bearer *b_ptr, u32 node_addr, 102static void disc_dupl_alert(struct tipc_bearer *b_ptr, u32 node_addr,
103 struct tipc_media_addr *media_addr) 103 struct tipc_media_addr *media_addr)
104{ 104{
105 char node_addr_str[16]; 105 char node_addr_str[16];
@@ -111,7 +111,7 @@ static void disc_dupl_alert(struct bearer *b_ptr, u32 node_addr,
111 tipc_media_addr_printf(&pb, media_addr); 111 tipc_media_addr_printf(&pb, media_addr);
112 tipc_printbuf_validate(&pb); 112 tipc_printbuf_validate(&pb);
113 warn("Duplicate %s using %s seen on <%s>\n", 113 warn("Duplicate %s using %s seen on <%s>\n",
114 node_addr_str, media_addr_str, b_ptr->publ.name); 114 node_addr_str, media_addr_str, b_ptr->name);
115} 115}
116 116
117/** 117/**
@@ -120,7 +120,7 @@ static void disc_dupl_alert(struct bearer *b_ptr, u32 node_addr,
120 * @b_ptr: bearer that message arrived on 120 * @b_ptr: bearer that message arrived on
121 */ 121 */
122 122
123void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr) 123void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr)
124{ 124{
125 struct link *link; 125 struct link *link;
126 struct tipc_media_addr media_addr; 126 struct tipc_media_addr media_addr;
@@ -140,7 +140,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr)
140 if (!tipc_addr_node_valid(orig)) 140 if (!tipc_addr_node_valid(orig))
141 return; 141 return;
142 if (orig == tipc_own_addr) { 142 if (orig == tipc_own_addr) {
143 if (memcmp(&media_addr, &b_ptr->publ.addr, sizeof(media_addr))) 143 if (memcmp(&media_addr, &b_ptr->addr, sizeof(media_addr)))
144 disc_dupl_alert(b_ptr, tipc_own_addr, &media_addr); 144 disc_dupl_alert(b_ptr, tipc_own_addr, &media_addr);
145 return; 145 return;
146 } 146 }
@@ -193,7 +193,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr)
193 return; 193 return;
194 rbuf = tipc_disc_init_msg(DSC_RESP_MSG, 1, orig, b_ptr); 194 rbuf = tipc_disc_init_msg(DSC_RESP_MSG, 1, orig, b_ptr);
195 if (rbuf != NULL) { 195 if (rbuf != NULL) {
196 b_ptr->media->send_msg(rbuf, &b_ptr->publ, &media_addr); 196 b_ptr->media->send_msg(rbuf, b_ptr, &media_addr);
197 buf_discard(rbuf); 197 buf_discard(rbuf);
198 } 198 }
199 } 199 }
@@ -249,9 +249,9 @@ void tipc_disc_update_link_req(struct link_req *req)
249 249
250static void disc_timeout(struct link_req *req) 250static void disc_timeout(struct link_req *req)
251{ 251{
252 spin_lock_bh(&req->bearer->publ.lock); 252 spin_lock_bh(&req->bearer->lock);
253 253
254 req->bearer->media->send_msg(req->buf, &req->bearer->publ, &req->dest); 254 req->bearer->media->send_msg(req->buf, req->bearer, &req->dest);
255 255
256 if ((req->timer_intv == TIPC_LINK_REQ_SLOW) || 256 if ((req->timer_intv == TIPC_LINK_REQ_SLOW) ||
257 (req->timer_intv == TIPC_LINK_REQ_FAST)) { 257 (req->timer_intv == TIPC_LINK_REQ_FAST)) {
@@ -266,7 +266,7 @@ static void disc_timeout(struct link_req *req)
266 } 266 }
267 k_start_timer(&req->timer, req->timer_intv); 267 k_start_timer(&req->timer, req->timer_intv);
268 268
269 spin_unlock_bh(&req->bearer->publ.lock); 269 spin_unlock_bh(&req->bearer->lock);
270} 270}
271 271
272/** 272/**
@@ -279,7 +279,7 @@ static void disc_timeout(struct link_req *req)
279 * Returns pointer to link request structure, or NULL if unable to create. 279 * Returns pointer to link request structure, or NULL if unable to create.
280 */ 280 */
281 281
282struct link_req *tipc_disc_init_link_req(struct bearer *b_ptr, 282struct link_req *tipc_disc_init_link_req(struct tipc_bearer *b_ptr,
283 const struct tipc_media_addr *dest, 283 const struct tipc_media_addr *dest,
284 u32 dest_domain, 284 u32 dest_domain,
285 u32 req_links) 285 u32 req_links)