diff options
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r-- | net/tipc/link.c | 112 |
1 files changed, 1 insertions, 111 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index b8cf1e9d0b86..4be78ecf4a67 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -99,23 +99,6 @@ struct link_name { | |||
99 | char if_peer[TIPC_MAX_IF_NAME]; | 99 | char if_peer[TIPC_MAX_IF_NAME]; |
100 | }; | 100 | }; |
101 | 101 | ||
102 | #if 0 | ||
103 | |||
104 | /* LINK EVENT CODE IS NOT SUPPORTED AT PRESENT */ | ||
105 | |||
106 | /** | ||
107 | * struct link_event - link up/down event notification | ||
108 | */ | ||
109 | |||
110 | struct link_event { | ||
111 | u32 addr; | ||
112 | int up; | ||
113 | void (*fcn)(u32, char *, int); | ||
114 | char name[TIPC_MAX_LINK_NAME]; | ||
115 | }; | ||
116 | |||
117 | #endif | ||
118 | |||
119 | static void link_handle_out_of_seq_msg(struct link *l_ptr, | 102 | static void link_handle_out_of_seq_msg(struct link *l_ptr, |
120 | struct sk_buff *buf); | 103 | struct sk_buff *buf); |
121 | static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf); | 104 | static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf); |
@@ -634,39 +617,9 @@ void tipc_link_stop(struct link *l_ptr) | |||
634 | l_ptr->proto_msg_queue = NULL; | 617 | l_ptr->proto_msg_queue = NULL; |
635 | } | 618 | } |
636 | 619 | ||
637 | #if 0 | ||
638 | |||
639 | /* LINK EVENT CODE IS NOT SUPPORTED AT PRESENT */ | 620 | /* LINK EVENT CODE IS NOT SUPPORTED AT PRESENT */ |
640 | |||
641 | static void link_recv_event(struct link_event *ev) | ||
642 | { | ||
643 | ev->fcn(ev->addr, ev->name, ev->up); | ||
644 | kfree(ev); | ||
645 | } | ||
646 | |||
647 | static void link_send_event(void (*fcn)(u32 a, char *n, int up), | ||
648 | struct link *l_ptr, int up) | ||
649 | { | ||
650 | struct link_event *ev; | ||
651 | |||
652 | ev = kmalloc(sizeof(*ev), GFP_ATOMIC); | ||
653 | if (!ev) { | ||
654 | warn("Link event allocation failure\n"); | ||
655 | return; | ||
656 | } | ||
657 | ev->addr = l_ptr->addr; | ||
658 | ev->up = up; | ||
659 | ev->fcn = fcn; | ||
660 | memcpy(ev->name, l_ptr->name, TIPC_MAX_LINK_NAME); | ||
661 | tipc_k_signal((Handler)link_recv_event, (unsigned long)ev); | ||
662 | } | ||
663 | |||
664 | #else | ||
665 | |||
666 | #define link_send_event(fcn, l_ptr, up) do { } while (0) | 621 | #define link_send_event(fcn, l_ptr, up) do { } while (0) |
667 | 622 | ||
668 | #endif | ||
669 | |||
670 | void tipc_link_reset(struct link *l_ptr) | 623 | void tipc_link_reset(struct link *l_ptr) |
671 | { | 624 | { |
672 | struct sk_buff *buf; | 625 | struct sk_buff *buf; |
@@ -690,10 +643,7 @@ void tipc_link_reset(struct link *l_ptr) | |||
690 | 643 | ||
691 | tipc_node_link_down(l_ptr->owner, l_ptr); | 644 | tipc_node_link_down(l_ptr->owner, l_ptr); |
692 | tipc_bearer_remove_dest(l_ptr->b_ptr, l_ptr->addr); | 645 | tipc_bearer_remove_dest(l_ptr->b_ptr, l_ptr->addr); |
693 | #if 0 | 646 | |
694 | tipc_printf(TIPC_CONS, "\nReset link <%s>\n", l_ptr->name); | ||
695 | dbg_link_dump(); | ||
696 | #endif | ||
697 | if (was_active_link && tipc_node_has_active_links(l_ptr->owner) && | 647 | if (was_active_link && tipc_node_has_active_links(l_ptr->owner) && |
698 | l_ptr->owner->permit_changeover) { | 648 | l_ptr->owner->permit_changeover) { |
699 | l_ptr->reset_checkpoint = checkpoint; | 649 | l_ptr->reset_checkpoint = checkpoint; |
@@ -3197,44 +3147,6 @@ struct sk_buff *tipc_link_cmd_show_stats(const void *req_tlv_area, int req_tlv_s | |||
3197 | return buf; | 3147 | return buf; |
3198 | } | 3148 | } |
3199 | 3149 | ||
3200 | #if 0 | ||
3201 | int link_control(const char *name, u32 op, u32 val) | ||
3202 | { | ||
3203 | int res = -EINVAL; | ||
3204 | struct link *l_ptr; | ||
3205 | u32 bearer_id; | ||
3206 | struct tipc_node * node; | ||
3207 | u32 a; | ||
3208 | |||
3209 | a = link_name2addr(name, &bearer_id); | ||
3210 | read_lock_bh(&tipc_net_lock); | ||
3211 | node = tipc_node_find(a); | ||
3212 | if (node) { | ||
3213 | tipc_node_lock(node); | ||
3214 | l_ptr = node->links[bearer_id]; | ||
3215 | if (l_ptr) { | ||
3216 | if (op == TIPC_REMOVE_LINK) { | ||
3217 | struct bearer *b_ptr = l_ptr->b_ptr; | ||
3218 | spin_lock_bh(&b_ptr->publ.lock); | ||
3219 | tipc_link_delete(l_ptr); | ||
3220 | spin_unlock_bh(&b_ptr->publ.lock); | ||
3221 | } | ||
3222 | if (op == TIPC_CMD_BLOCK_LINK) { | ||
3223 | tipc_link_reset(l_ptr); | ||
3224 | l_ptr->blocked = 1; | ||
3225 | } | ||
3226 | if (op == TIPC_CMD_UNBLOCK_LINK) { | ||
3227 | l_ptr->blocked = 0; | ||
3228 | } | ||
3229 | res = 0; | ||
3230 | } | ||
3231 | tipc_node_unlock(node); | ||
3232 | } | ||
3233 | read_unlock_bh(&tipc_net_lock); | ||
3234 | return res; | ||
3235 | } | ||
3236 | #endif | ||
3237 | |||
3238 | /** | 3150 | /** |
3239 | * tipc_link_get_max_pkt - get maximum packet size to use when sending to destination | 3151 | * tipc_link_get_max_pkt - get maximum packet size to use when sending to destination |
3240 | * @dest: network address of destination node | 3152 | * @dest: network address of destination node |
@@ -3265,28 +3177,6 @@ u32 tipc_link_get_max_pkt(u32 dest, u32 selector) | |||
3265 | return res; | 3177 | return res; |
3266 | } | 3178 | } |
3267 | 3179 | ||
3268 | #if 0 | ||
3269 | static void link_dump_rec_queue(struct link *l_ptr) | ||
3270 | { | ||
3271 | struct sk_buff *crs; | ||
3272 | |||
3273 | if (!l_ptr->oldest_deferred_in) { | ||
3274 | info("Reception queue empty\n"); | ||
3275 | return; | ||
3276 | } | ||
3277 | info("Contents of Reception queue:\n"); | ||
3278 | crs = l_ptr->oldest_deferred_in; | ||
3279 | while (crs) { | ||
3280 | if (crs->data == (void *)0x0000a3a3) { | ||
3281 | info("buffer %x invalid\n", crs); | ||
3282 | return; | ||
3283 | } | ||
3284 | msg_dbg(buf_msg(crs), "In rec queue:\n"); | ||
3285 | crs = crs->next; | ||
3286 | } | ||
3287 | } | ||
3288 | #endif | ||
3289 | |||
3290 | static void link_dump_send_queue(struct link *l_ptr) | 3180 | static void link_dump_send_queue(struct link *l_ptr) |
3291 | { | 3181 | { |
3292 | if (l_ptr->next_out) { | 3182 | if (l_ptr->next_out) { |