aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/tipc/config.c141
-rw-r--r--net/tipc/discover.c20
-rw-r--r--net/tipc/discover.h3
-rw-r--r--net/tipc/link.c112
-rw-r--r--net/tipc/link.h4
-rw-r--r--net/tipc/name_table.c17
-rw-r--r--net/tipc/net.c9
-rw-r--r--net/tipc/node.c26
-rw-r--r--net/tipc/port.c44
9 files changed, 1 insertions, 375 deletions
diff --git a/net/tipc/config.c b/net/tipc/config.c
index 961d1b097146..c429b0d488a3 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -120,139 +120,6 @@ struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string)
120 return buf; 120 return buf;
121} 121}
122 122
123
124#if 0
125
126/* Now obsolete code for handling commands not yet implemented the new way */
127
128/*
129 * Some of this code assumed that the manager structure contains two added
130 * fields:
131 * u32 link_subscriptions;
132 * struct list_head link_subscribers;
133 * which are currently not present. These fields may need to be re-introduced
134 * if and when support for link subscriptions is added.
135 */
136
137void tipc_cfg_link_event(u32 addr, char *name, int up)
138{
139 /* TIPC DOESN'T HANDLE LINK EVENT SUBSCRIPTIONS AT THE MOMENT */
140}
141
142int tipc_cfg_cmd(const struct tipc_cmd_msg * msg,
143 char *data,
144 u32 sz,
145 u32 *ret_size,
146 struct tipc_portid *orig)
147{
148 int rv = -EINVAL;
149 u32 cmd = msg->cmd;
150
151 *ret_size = 0;
152 switch (cmd) {
153 case TIPC_REMOVE_LINK:
154 case TIPC_CMD_BLOCK_LINK:
155 case TIPC_CMD_UNBLOCK_LINK:
156 if (!cfg_check_connection(orig))
157 rv = link_control(msg->argv.link_name, msg->cmd, 0);
158 break;
159 case TIPC_ESTABLISH:
160 {
161 int connected;
162
163 tipc_isconnected(mng.conn_port_ref, &connected);
164 if (connected || !orig) {
165 rv = TIPC_FAILURE;
166 break;
167 }
168 rv = tipc_connect2port(mng.conn_port_ref, orig);
169 if (rv == TIPC_OK)
170 orig = 0;
171 break;
172 }
173 case TIPC_GET_PEER_ADDRESS:
174 *ret_size = link_peer_addr(msg->argv.link_name, data, sz);
175 break;
176 case TIPC_GET_ROUTES:
177 rv = TIPC_OK;
178 break;
179 default: {}
180 }
181 if (*ret_size)
182 rv = TIPC_OK;
183 return rv;
184}
185
186static void cfg_cmd_event(struct tipc_cmd_msg *msg,
187 char *data,
188 u32 sz,
189 struct tipc_portid const *orig)
190{
191 int rv = -EINVAL;
192 struct tipc_cmd_result_msg rmsg;
193 struct iovec msg_sect[2];
194 int *arg;
195
196 msg->cmd = ntohl(msg->cmd);
197
198 cfg_prepare_res_msg(msg->cmd, msg->usr_handle, rv, &rmsg, msg_sect,
199 data, 0);
200 if (ntohl(msg->magic) != TIPC_MAGIC)
201 goto exit;
202
203 switch (msg->cmd) {
204 case TIPC_CREATE_LINK:
205 if (!cfg_check_connection(orig))
206 rv = disc_create_link(&msg->argv.create_link);
207 break;
208 case TIPC_LINK_SUBSCRIBE:
209 {
210 struct subscr_data *sub;
211
212 if (mng.link_subscriptions > 64)
213 break;
214 sub = kmalloc(sizeof(*sub),
215 GFP_ATOMIC);
216 if (sub == NULL) {
217 warn("Memory squeeze; dropped remote link subscription\n");
218 break;
219 }
220 INIT_LIST_HEAD(&sub->subd_list);
221 tipc_createport(mng.user_ref,
222 (void *)sub,
223 TIPC_HIGH_IMPORTANCE,
224 0,
225 0,
226 (tipc_conn_shutdown_event)cfg_linksubscr_cancel,
227 0,
228 0,
229 (tipc_conn_msg_event)cfg_linksubscr_cancel,
230 0,
231 &sub->port_ref);
232 if (!sub->port_ref) {
233 kfree(sub);
234 break;
235 }
236 memcpy(sub->usr_handle,msg->usr_handle,
237 sizeof(sub->usr_handle));
238 sub->domain = msg->argv.domain;
239 list_add_tail(&sub->subd_list, &mng.link_subscribers);
240 tipc_connect2port(sub->port_ref, orig);
241 rmsg.retval = TIPC_OK;
242 tipc_send(sub->port_ref, 2u, msg_sect);
243 mng.link_subscriptions++;
244 return;
245 }
246 default:
247 rv = tipc_cfg_cmd(msg, data, sz, (u32 *)&msg_sect[1].iov_len, orig);
248 }
249exit:
250 rmsg.result_len = htonl(msg_sect[1].iov_len);
251 rmsg.retval = htonl(rv);
252 tipc_cfg_respond(msg_sect, 2u, orig);
253}
254#endif
255
256#define MAX_STATS_INFO 2000 123#define MAX_STATS_INFO 2000
257 124
258static struct sk_buff *tipc_show_stats(void) 125static struct sk_buff *tipc_show_stats(void)
@@ -557,14 +424,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
557 case TIPC_CMD_SHOW_PORTS: 424 case TIPC_CMD_SHOW_PORTS:
558 rep_tlv_buf = tipc_port_get_ports(); 425 rep_tlv_buf = tipc_port_get_ports();
559 break; 426 break;
560#if 0
561 case TIPC_CMD_SHOW_PORT_STATS:
562 rep_tlv_buf = port_show_stats(req_tlv_area, req_tlv_space);
563 break;
564 case TIPC_CMD_RESET_PORT_STATS:
565 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED);
566 break;
567#endif
568 case TIPC_CMD_SET_LOG_SIZE: 427 case TIPC_CMD_SET_LOG_SIZE:
569 rep_tlv_buf = tipc_log_resize_cmd(req_tlv_area, req_tlv_space); 428 rep_tlv_buf = tipc_log_resize_cmd(req_tlv_area, req_tlv_space);
570 break; 429 break;
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index f28d1ae93125..dbd79c67d7c0 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -46,16 +46,6 @@
46#define TIPC_LINK_REQ_FAST 2000 /* normal delay if bearer has no links */ 46#define TIPC_LINK_REQ_FAST 2000 /* normal delay if bearer has no links */
47#define TIPC_LINK_REQ_SLOW 600000 /* normal delay if bearer has links */ 47#define TIPC_LINK_REQ_SLOW 600000 /* normal delay if bearer has links */
48 48
49#if 0
50#define GET_NODE_INFO 300
51#define GET_NODE_INFO_RESULT 301
52#define FORWARD_LINK_PROBE 302
53#define LINK_REQUEST_REJECTED 303
54#define LINK_REQUEST_ACCEPTED 304
55#define DROP_LINK_REQUEST 305
56#define CHECK_LINK_COUNT 306
57#endif
58
59/* 49/*
60 * TODO: Most of the inter-cluster setup stuff should be 50 * TODO: Most of the inter-cluster setup stuff should be
61 * rewritten, and be made conformant with specification. 51 * rewritten, and be made conformant with specification.
@@ -79,16 +69,6 @@ struct link_req {
79}; 69};
80 70
81 71
82#if 0
83int disc_create_link(const struct tipc_link_create *argv)
84{
85 /*
86 * Code for inter cluster link setup here
87 */
88 return TIPC_OK;
89}
90#endif
91
92/* 72/*
93 * disc_lost_link(): A link has lost contact 73 * disc_lost_link(): A link has lost contact
94 */ 74 */
diff --git a/net/tipc/discover.h b/net/tipc/discover.h
index c36eaeb7d5d0..9d064c3639bf 100644
--- a/net/tipc/discover.h
+++ b/net/tipc/discover.h
@@ -51,8 +51,5 @@ void tipc_disc_stop_link_req(struct link_req *req);
51void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr); 51void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr);
52 52
53void tipc_disc_link_event(u32 addr, char *name, int up); 53void tipc_disc_link_event(u32 addr, char *name, int up);
54#if 0
55int disc_create_link(const struct tipc_link_create *argv);
56#endif
57 54
58#endif 55#endif
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
110struct 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
119static void link_handle_out_of_seq_msg(struct link *l_ptr, 102static void link_handle_out_of_seq_msg(struct link *l_ptr,
120 struct sk_buff *buf); 103 struct sk_buff *buf);
121static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf); 104static 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
641static void link_recv_event(struct link_event *ev)
642{
643 ev->fcn(ev->addr, ev->name, ev->up);
644 kfree(ev);
645}
646
647static 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
670void tipc_link_reset(struct link *l_ptr) 623void 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
3201int 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
3269static 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
3290static void link_dump_send_queue(struct link *l_ptr) 3180static void link_dump_send_queue(struct link *l_ptr)
3291{ 3181{
3292 if (l_ptr->next_out) { 3182 if (l_ptr->next_out) {
diff --git a/net/tipc/link.h b/net/tipc/link.h
index 26151d30589d..4e944ef4a540 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -210,10 +210,6 @@ struct link {
210 u32 msg_length_counts; 210 u32 msg_length_counts;
211 u32 msg_lengths_total; 211 u32 msg_lengths_total;
212 u32 msg_length_profile[7]; 212 u32 msg_length_profile[7];
213#if 0
214 u32 sent_tunneled;
215 u32 recv_tunneled;
216#endif
217 } stats; 213 } stats;
218 214
219 struct print_buf print_buf; 215 struct print_buf print_buf;
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 9ca4b0689237..3a8de4334da1 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -1009,16 +1009,6 @@ static void nametbl_list(struct print_buf *buf, u32 depth_info,
1009 } 1009 }
1010} 1010}
1011 1011
1012#if 0
1013void tipc_nametbl_print(struct print_buf *buf, const char *str)
1014{
1015 tipc_printf(buf, str);
1016 read_lock_bh(&tipc_nametbl_lock);
1017 nametbl_list(buf, 0, 0, 0, 0);
1018 read_unlock_bh(&tipc_nametbl_lock);
1019}
1020#endif
1021
1022#define MAX_NAME_TBL_QUERY 32768 1012#define MAX_NAME_TBL_QUERY 32768
1023 1013
1024struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space) 1014struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space)
@@ -1051,13 +1041,6 @@ struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space)
1051 return buf; 1041 return buf;
1052} 1042}
1053 1043
1054#if 0
1055void tipc_nametbl_dump(void)
1056{
1057 nametbl_list(TIPC_CONS, 0, 0, 0, 0);
1058}
1059#endif
1060
1061int tipc_nametbl_init(void) 1044int tipc_nametbl_init(void)
1062{ 1045{
1063 table.types = kcalloc(tipc_nametbl_size, sizeof(struct hlist_head), 1046 table.types = kcalloc(tipc_nametbl_size, sizeof(struct hlist_head),
diff --git a/net/tipc/net.c b/net/tipc/net.c
index 7e05af47a196..1a621cfd6604 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -129,15 +129,6 @@ u32 tipc_net_select_router(u32 addr, u32 ref)
129 return tipc_zone_select_router(tipc_net.zones[tipc_zone(addr)], addr, ref); 129 return tipc_zone_select_router(tipc_net.zones[tipc_zone(addr)], addr, ref);
130} 130}
131 131
132#if 0
133u32 tipc_net_next_node(u32 a)
134{
135 if (tipc_net.zones[tipc_zone(a)])
136 return tipc_zone_next_node(a);
137 return 0;
138}
139#endif
140
141void tipc_net_remove_as_router(u32 router) 132void tipc_net_remove_as_router(u32 router)
142{ 133{
143 u32 z_num; 134 u32 z_num;
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 7c49cd056df7..823e9abb7ef5 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -125,16 +125,6 @@ void tipc_node_delete(struct tipc_node *n_ptr)
125 if (!n_ptr) 125 if (!n_ptr)
126 return; 126 return;
127 127
128#if 0
129 /* Not needed because links are already deleted via tipc_bearer_stop() */
130
131 u32 l_num;
132
133 for (l_num = 0; l_num < MAX_BEARERS; l_num++) {
134 link_delete(n_ptr->links[l_num]);
135 }
136#endif
137
138 dbg("node %x deleted\n", n_ptr->addr); 128 dbg("node %x deleted\n", n_ptr->addr);
139 kfree(n_ptr); 129 kfree(n_ptr);
140} 130}
@@ -597,22 +587,6 @@ void tipc_node_remove_router(struct tipc_node *n_ptr, u32 router)
597 node_lost_contact(n_ptr); 587 node_lost_contact(n_ptr);
598} 588}
599 589
600#if 0
601void node_print(struct print_buf *buf, struct tipc_node *n_ptr, char *str)
602{
603 u32 i;
604
605 tipc_printf(buf, "\n\n%s", str);
606 for (i = 0; i < MAX_BEARERS; i++) {
607 if (!n_ptr->links[i])
608 continue;
609 tipc_printf(buf, "Links[%u]: %x, ", i, n_ptr->links[i]);
610 }
611 tipc_printf(buf, "Active links: [%x,%x]\n",
612 n_ptr->active_links[0], n_ptr->active_links[1]);
613}
614#endif
615
616u32 tipc_available_nodes(const u32 domain) 590u32 tipc_available_nodes(const u32 domain)
617{ 591{
618 struct tipc_node *n_ptr; 592 struct tipc_node *n_ptr;
diff --git a/net/tipc/port.c b/net/tipc/port.c
index d760336f2ca8..5c4285b2d555 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -710,50 +710,6 @@ struct sk_buff *tipc_port_get_ports(void)
710 return buf; 710 return buf;
711} 711}
712 712
713#if 0
714
715#define MAX_PORT_STATS 2000
716
717struct sk_buff *port_show_stats(const void *req_tlv_area, int req_tlv_space)
718{
719 u32 ref;
720 struct port *p_ptr;
721 struct sk_buff *buf;
722 struct tlv_desc *rep_tlv;
723 struct print_buf pb;
724 int str_len;
725
726 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_PORT_REF))
727 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
728
729 ref = *(u32 *)TLV_DATA(req_tlv_area);
730 ref = ntohl(ref);
731
732 p_ptr = tipc_port_lock(ref);
733 if (!p_ptr)
734 return cfg_reply_error_string("port not found");
735
736 buf = tipc_cfg_reply_alloc(TLV_SPACE(MAX_PORT_STATS));
737 if (!buf) {
738 tipc_port_unlock(p_ptr);
739 return NULL;
740 }
741 rep_tlv = (struct tlv_desc *)buf->data;
742
743 tipc_printbuf_init(&pb, TLV_DATA(rep_tlv), MAX_PORT_STATS);
744 port_print(p_ptr, &pb, 1);
745 /* NEED TO FILL IN ADDITIONAL PORT STATISTICS HERE */
746 tipc_port_unlock(p_ptr);
747 str_len = tipc_printbuf_validate(&pb);
748
749 skb_put(buf, TLV_SPACE(str_len));
750 TLV_SET(rep_tlv, TIPC_TLV_ULTRA_STRING, NULL, str_len);
751
752 return buf;
753}
754
755#endif
756
757void tipc_port_reinit(void) 713void tipc_port_reinit(void)
758{ 714{
759 struct port *p_ptr; 715 struct port *p_ptr;