aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 9fb0f6b96b45..471973ff134f 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -87,7 +87,6 @@ static int link_send_sections_long(struct tipc_port *sender,
87static void link_state_event(struct tipc_link *l_ptr, u32 event); 87static void link_state_event(struct tipc_link *l_ptr, u32 event);
88static void link_reset_statistics(struct tipc_link *l_ptr); 88static void link_reset_statistics(struct tipc_link *l_ptr);
89static void link_print(struct tipc_link *l_ptr, const char *str); 89static void link_print(struct tipc_link *l_ptr, const char *str);
90static void link_start(struct tipc_link *l_ptr);
91static int link_send_long_buf(struct tipc_link *l_ptr, struct sk_buff *buf); 90static int link_send_long_buf(struct tipc_link *l_ptr, struct sk_buff *buf);
92static void tipc_link_send_sync(struct tipc_link *l); 91static void tipc_link_send_sync(struct tipc_link *l);
93static void tipc_link_recv_sync(struct tipc_node *n, struct sk_buff *buf); 92static void tipc_link_recv_sync(struct tipc_node *n, struct sk_buff *buf);
@@ -281,7 +280,8 @@ struct tipc_link *tipc_link_create(struct tipc_node *n_ptr,
281 k_init_timer(&l_ptr->timer, (Handler)link_timeout, 280 k_init_timer(&l_ptr->timer, (Handler)link_timeout,
282 (unsigned long)l_ptr); 281 (unsigned long)l_ptr);
283 list_add_tail(&l_ptr->link_list, &b_ptr->links); 282 list_add_tail(&l_ptr->link_list, &b_ptr->links);
284 tipc_k_signal((Handler)link_start, (unsigned long)l_ptr); 283
284 link_state_event(l_ptr, STARTING_EVT);
285 285
286 return l_ptr; 286 return l_ptr;
287} 287}
@@ -306,19 +306,13 @@ void tipc_link_delete(struct tipc_link *l_ptr)
306 tipc_node_lock(l_ptr->owner); 306 tipc_node_lock(l_ptr->owner);
307 tipc_link_reset(l_ptr); 307 tipc_link_reset(l_ptr);
308 tipc_node_detach_link(l_ptr->owner, l_ptr); 308 tipc_node_detach_link(l_ptr->owner, l_ptr);
309 tipc_link_stop(l_ptr); 309 tipc_link_purge_queues(l_ptr);
310 list_del_init(&l_ptr->link_list); 310 list_del_init(&l_ptr->link_list);
311 tipc_node_unlock(l_ptr->owner); 311 tipc_node_unlock(l_ptr->owner);
312 k_term_timer(&l_ptr->timer); 312 k_term_timer(&l_ptr->timer);
313 kfree(l_ptr); 313 kfree(l_ptr);
314} 314}
315 315
316static void link_start(struct tipc_link *l_ptr)
317{
318 tipc_node_lock(l_ptr->owner);
319 link_state_event(l_ptr, STARTING_EVT);
320 tipc_node_unlock(l_ptr->owner);
321}
322 316
323/** 317/**
324 * link_schedule_port - schedule port for deferred sending 318 * link_schedule_port - schedule port for deferred sending
@@ -404,10 +398,10 @@ void tipc_link_reset_fragments(struct tipc_link *l_ptr)
404} 398}
405 399
406/** 400/**
407 * tipc_link_stop - purge all inbound and outbound messages associated with link 401 * tipc_link_purge_queues - purge all pkt queues associated with link
408 * @l_ptr: pointer to link 402 * @l_ptr: pointer to link
409 */ 403 */
410void tipc_link_stop(struct tipc_link *l_ptr) 404void tipc_link_purge_queues(struct tipc_link *l_ptr)
411{ 405{
412 kfree_skb_list(l_ptr->oldest_deferred_in); 406 kfree_skb_list(l_ptr->oldest_deferred_in);
413 kfree_skb_list(l_ptr->first_out); 407 kfree_skb_list(l_ptr->first_out);