Lines Matching refs:rose_neigh
40 static struct rose_neigh *rose_neigh_list;
45 struct rose_neigh *rose_loopback_neigh;
55 struct rose_neigh *rose_neigh; in rose_add_node() local
75 rose_neigh = rose_neigh_list; in rose_add_node()
76 while (rose_neigh != NULL) { in rose_add_node()
78 &rose_neigh->callsign) == 0 && in rose_add_node()
79 rose_neigh->dev == dev) in rose_add_node()
81 rose_neigh = rose_neigh->next; in rose_add_node()
84 if (rose_neigh == NULL) { in rose_add_node()
85 rose_neigh = kmalloc(sizeof(*rose_neigh), GFP_ATOMIC); in rose_add_node()
86 if (rose_neigh == NULL) { in rose_add_node()
91 rose_neigh->callsign = rose_route->neighbour; in rose_add_node()
92 rose_neigh->digipeat = NULL; in rose_add_node()
93 rose_neigh->ax25 = NULL; in rose_add_node()
94 rose_neigh->dev = dev; in rose_add_node()
95 rose_neigh->count = 0; in rose_add_node()
96 rose_neigh->use = 0; in rose_add_node()
97 rose_neigh->dce_mode = 0; in rose_add_node()
98 rose_neigh->loopback = 0; in rose_add_node()
99 rose_neigh->number = rose_neigh_no++; in rose_add_node()
100 rose_neigh->restarted = 0; in rose_add_node()
102 skb_queue_head_init(&rose_neigh->queue); in rose_add_node()
104 timer_setup(&rose_neigh->ftimer, NULL, 0); in rose_add_node()
105 timer_setup(&rose_neigh->t0timer, NULL, 0); in rose_add_node()
108 rose_neigh->digipeat = in rose_add_node()
110 if (rose_neigh->digipeat == NULL) { in rose_add_node()
111 kfree(rose_neigh); in rose_add_node()
116 rose_neigh->digipeat->ndigi = rose_route->ndigis; in rose_add_node()
117 rose_neigh->digipeat->lastrepeat = -1; in rose_add_node()
120 rose_neigh->digipeat->calls[i] = in rose_add_node()
122 rose_neigh->digipeat->repeated[i] = 0; in rose_add_node()
126 rose_neigh->next = rose_neigh_list; in rose_add_node()
127 rose_neigh_list = rose_neigh; in rose_add_node()
161 rose_node->neighbour[0] = rose_neigh; in rose_add_node()
180 rose_neigh->count++; in rose_add_node()
187 rose_node->neighbour[rose_node->count] = rose_neigh; in rose_add_node()
189 rose_neigh->count++; in rose_add_node()
226 static void rose_remove_neigh(struct rose_neigh *rose_neigh) in rose_remove_neigh() argument
228 struct rose_neigh *s; in rose_remove_neigh()
230 del_timer_sync(&rose_neigh->ftimer); in rose_remove_neigh()
231 del_timer_sync(&rose_neigh->t0timer); in rose_remove_neigh()
233 skb_queue_purge(&rose_neigh->queue); in rose_remove_neigh()
235 if ((s = rose_neigh_list) == rose_neigh) { in rose_remove_neigh()
236 rose_neigh_list = rose_neigh->next; in rose_remove_neigh()
237 if (rose_neigh->ax25) in rose_remove_neigh()
238 ax25_cb_put(rose_neigh->ax25); in rose_remove_neigh()
239 kfree(rose_neigh->digipeat); in rose_remove_neigh()
240 kfree(rose_neigh); in rose_remove_neigh()
245 if (s->next == rose_neigh) { in rose_remove_neigh()
246 s->next = rose_neigh->next; in rose_remove_neigh()
247 if (rose_neigh->ax25) in rose_remove_neigh()
248 ax25_cb_put(rose_neigh->ax25); in rose_remove_neigh()
249 kfree(rose_neigh->digipeat); in rose_remove_neigh()
250 kfree(rose_neigh); in rose_remove_neigh()
296 struct rose_neigh *rose_neigh; in rose_del_node() local
316 rose_neigh = rose_neigh_list; in rose_del_node()
317 while (rose_neigh != NULL) { in rose_del_node()
319 &rose_neigh->callsign) == 0 && in rose_del_node()
320 rose_neigh->dev == dev) in rose_del_node()
322 rose_neigh = rose_neigh->next; in rose_del_node()
325 if (rose_neigh == NULL) { in rose_del_node()
331 if (rose_node->neighbour[i] == rose_neigh) { in rose_del_node()
332 rose_neigh->count--; in rose_del_node()
334 if (rose_neigh->count == 0 && rose_neigh->use == 0) in rose_del_node()
335 rose_remove_neigh(rose_neigh); in rose_del_node()
372 struct rose_neigh *sn; in rose_add_loopback_neigh()
374 rose_loopback_neigh = kmalloc(sizeof(struct rose_neigh), GFP_KERNEL); in rose_add_loopback_neigh()
480 struct rose_neigh *s, *rose_neigh; in rose_rt_device_down() local
486 rose_neigh = rose_neigh_list; in rose_rt_device_down()
487 while (rose_neigh != NULL) { in rose_rt_device_down()
488 s = rose_neigh; in rose_rt_device_down()
489 rose_neigh = rose_neigh->next; in rose_rt_device_down()
556 struct rose_neigh *s, *rose_neigh; in rose_clear_routes() local
562 rose_neigh = rose_neigh_list; in rose_clear_routes()
572 while (rose_neigh != NULL) { in rose_clear_routes()
573 s = rose_neigh; in rose_clear_routes()
574 rose_neigh = rose_neigh->next; in rose_clear_routes()
665 struct rose_route *rose_route_free_lci(unsigned int lci, struct rose_neigh *neigh) in rose_route_free_lci()
680 struct rose_neigh *rose_get_neigh(rose_address *addr, unsigned char *cause, in rose_get_neigh()
683 struct rose_neigh *res = NULL; in rose_get_neigh()
768 static void rose_del_route_by_neigh(struct rose_neigh *rose_neigh) in rose_del_route_by_neigh() argument
772 rose_neigh->restarted = 0; in rose_del_route_by_neigh()
774 rose_stop_t0timer(rose_neigh); in rose_del_route_by_neigh()
775 rose_start_ftimer(rose_neigh); in rose_del_route_by_neigh()
777 skb_queue_purge(&rose_neigh->queue); in rose_del_route_by_neigh()
784 if ((rose_route->neigh1 == rose_neigh && rose_route->neigh2 == rose_neigh) || in rose_del_route_by_neigh()
785 (rose_route->neigh1 == rose_neigh && rose_route->neigh2 == NULL) || in rose_del_route_by_neigh()
786 (rose_route->neigh2 == rose_neigh && rose_route->neigh1 == NULL)) { in rose_del_route_by_neigh()
793 if (rose_route->neigh1 == rose_neigh) { in rose_del_route_by_neigh()
799 if (rose_route->neigh2 == rose_neigh) { in rose_del_route_by_neigh()
817 struct rose_neigh *rose_neigh; in rose_link_failed() local
820 rose_neigh = rose_neigh_list; in rose_link_failed()
821 while (rose_neigh != NULL) { in rose_link_failed()
822 if (rose_neigh->ax25 == ax25) in rose_link_failed()
824 rose_neigh = rose_neigh->next; in rose_link_failed()
827 if (rose_neigh != NULL) { in rose_link_failed()
828 rose_neigh->ax25 = NULL; in rose_link_failed()
831 rose_del_route_by_neigh(rose_neigh); in rose_link_failed()
832 rose_kill_by_neigh(rose_neigh); in rose_link_failed()
843 struct rose_neigh *rose_neigh; in rose_link_device_down() local
845 for (rose_neigh = rose_neigh_list; rose_neigh != NULL; rose_neigh = rose_neigh->next) { in rose_link_device_down()
846 if (rose_neigh->dev == dev) { in rose_link_device_down()
847 rose_del_route_by_neigh(rose_neigh); in rose_link_device_down()
848 rose_kill_by_neigh(rose_neigh); in rose_link_device_down()
859 struct rose_neigh *rose_neigh, *new_neigh; in rose_route_frame() local
890 rose_neigh = rose_neigh_list; in rose_route_frame()
891 while (rose_neigh != NULL) { in rose_route_frame()
892 if (ax25cmp(&ax25->dest_addr, &rose_neigh->callsign) == 0 && in rose_route_frame()
893 ax25->ax25_dev->dev == rose_neigh->dev) in rose_route_frame()
895 rose_neigh = rose_neigh->next; in rose_route_frame()
898 if (rose_neigh == NULL) { in rose_route_frame()
907 rose_stop_ftimer(rose_neigh); in rose_route_frame()
914 rose_link_rx_restart(skb, rose_neigh, frametype); in rose_route_frame()
921 if ((sk = rose_find_socket(lci, rose_neigh)) != NULL) { in rose_route_frame()
953 res = rose_rx_call_request(skb, dev, rose_neigh, lci); in rose_route_frame()
959 rose_transmit_clear_request(rose_neigh, lci, ROSE_NOT_OBTAINABLE, 0); in rose_route_frame()
969 rose_route->neigh1 == rose_neigh) { in rose_route_frame()
990 rose_route->neigh2 == rose_neigh) { in rose_route_frame()
1028 rose_transmit_clear_request(rose_neigh, lci, ROSE_INVALID_FACILITY, 76); in rose_route_frame()
1041 rose_transmit_clear_request(rose_neigh, lci, ROSE_NOT_OBTAINABLE, 120); in rose_route_frame()
1048 rose_transmit_clear_request(rose_neigh, lci, cause, diagnostic); in rose_route_frame()
1053 rose_transmit_clear_request(rose_neigh, lci, ROSE_NETWORK_CONGESTION, 71); in rose_route_frame()
1058 rose_transmit_clear_request(rose_neigh, lci, ROSE_NETWORK_CONGESTION, 120); in rose_route_frame()
1068 rose_route->neigh1 = rose_neigh; in rose_route_frame()
1156 struct rose_neigh *rose_neigh; in rose_neigh_start() local
1163 for (rose_neigh = rose_neigh_list; rose_neigh && i < *pos; in rose_neigh_start()
1164 rose_neigh = rose_neigh->next, ++i); in rose_neigh_start()
1166 return (i == *pos) ? rose_neigh : NULL; in rose_neigh_start()
1174 : ((struct rose_neigh *)v)->next; in rose_neigh_next()
1192 struct rose_neigh *rose_neigh = v; in rose_neigh_show() local
1196 rose_neigh->number, in rose_neigh_show()
1197 (rose_neigh->loopback) ? "RSLOOP-0" : ax2asc(buf, &rose_neigh->callsign), in rose_neigh_show()
1198 rose_neigh->dev ? rose_neigh->dev->name : "???", in rose_neigh_show()
1199 rose_neigh->count, in rose_neigh_show()
1200 rose_neigh->use, in rose_neigh_show()
1201 (rose_neigh->dce_mode) ? "DCE" : "DTE", in rose_neigh_show()
1202 (rose_neigh->restarted) ? "yes" : "no", in rose_neigh_show()
1203 ax25_display_timer(&rose_neigh->t0timer) / HZ, in rose_neigh_show()
1204 ax25_display_timer(&rose_neigh->ftimer) / HZ); in rose_neigh_show()
1206 if (rose_neigh->digipeat != NULL) { in rose_neigh_show()
1207 for (i = 0; i < rose_neigh->digipeat->ndigi; i++) in rose_neigh_show()
1208 seq_printf(seq, " %s", ax2asc(buf, &rose_neigh->digipeat->calls[i])); in rose_neigh_show()
1302 struct rose_neigh *s, *rose_neigh = rose_neigh_list; in rose_rt_free() local
1306 while (rose_neigh != NULL) { in rose_rt_free()
1307 s = rose_neigh; in rose_rt_free()
1308 rose_neigh = rose_neigh->next; in rose_rt_free()