Lines Matching refs:nb

36 static void x25_transmit_restart_confirmation(struct x25_neigh *nb);
37 static void x25_transmit_restart_request(struct x25_neigh *nb);
42 static inline void x25_start_t20timer(struct x25_neigh *nb) in x25_start_t20timer() argument
44 mod_timer(&nb->t20timer, jiffies + nb->t20); in x25_start_t20timer()
49 struct x25_neigh *nb = from_timer(nb, t, t20timer); in x25_t20timer_expiry() local
51 x25_transmit_restart_request(nb); in x25_t20timer_expiry()
53 x25_start_t20timer(nb); in x25_t20timer_expiry()
56 static inline void x25_stop_t20timer(struct x25_neigh *nb) in x25_stop_t20timer() argument
58 del_timer(&nb->t20timer); in x25_stop_t20timer()
64 void x25_link_control(struct sk_buff *skb, struct x25_neigh *nb, in x25_link_control() argument
71 switch (nb->state) { in x25_link_control()
76 nb->state = X25_LINK_STATE_3; in x25_link_control()
77 x25_transmit_restart_confirmation(nb); in x25_link_control()
80 x25_stop_t20timer(nb); in x25_link_control()
81 nb->state = X25_LINK_STATE_3; in x25_link_control()
85 x25_kill_by_neigh(nb); in x25_link_control()
87 x25_transmit_restart_confirmation(nb); in x25_link_control()
93 switch (nb->state) { in x25_link_control()
95 x25_stop_t20timer(nb); in x25_link_control()
96 nb->state = X25_LINK_STATE_3; in x25_link_control()
100 x25_kill_by_neigh(nb); in x25_link_control()
102 x25_transmit_restart_request(nb); in x25_link_control()
103 nb->state = X25_LINK_STATE_2; in x25_link_control()
104 x25_start_t20timer(nb); in x25_link_control()
124 if (nb->state == X25_LINK_STATE_3) in x25_link_control()
125 while ((skbn = skb_dequeue(&nb->queue)) != NULL) in x25_link_control()
126 x25_send_frame(skbn, nb); in x25_link_control()
132 static void x25_transmit_restart_request(struct x25_neigh *nb) in x25_transmit_restart_request() argument
145 *dptr++ = nb->extended ? X25_GFI_EXTSEQ : X25_GFI_STDSEQ; in x25_transmit_restart_request()
153 x25_send_frame(skb, nb); in x25_transmit_restart_request()
159 static void x25_transmit_restart_confirmation(struct x25_neigh *nb) in x25_transmit_restart_confirmation() argument
172 *dptr++ = nb->extended ? X25_GFI_EXTSEQ : X25_GFI_STDSEQ; in x25_transmit_restart_confirmation()
178 x25_send_frame(skb, nb); in x25_transmit_restart_confirmation()
185 void x25_transmit_clear_request(struct x25_neigh *nb, unsigned int lci, in x25_transmit_clear_request() argument
199 *dptr++ = ((lci >> 8) & 0x0F) | (nb->extended ? in x25_transmit_clear_request()
209 x25_send_frame(skb, nb); in x25_transmit_clear_request()
212 void x25_transmit_link(struct sk_buff *skb, struct x25_neigh *nb) in x25_transmit_link() argument
214 switch (nb->state) { in x25_transmit_link()
216 skb_queue_tail(&nb->queue, skb); in x25_transmit_link()
217 nb->state = X25_LINK_STATE_1; in x25_transmit_link()
218 x25_establish_link(nb); in x25_transmit_link()
222 skb_queue_tail(&nb->queue, skb); in x25_transmit_link()
225 x25_send_frame(skb, nb); in x25_transmit_link()
233 void x25_link_established(struct x25_neigh *nb) in x25_link_established() argument
235 switch (nb->state) { in x25_link_established()
238 x25_transmit_restart_request(nb); in x25_link_established()
239 nb->state = X25_LINK_STATE_2; in x25_link_established()
240 x25_start_t20timer(nb); in x25_link_established()
250 void x25_link_terminated(struct x25_neigh *nb) in x25_link_terminated() argument
252 nb->state = X25_LINK_STATE_0; in x25_link_terminated()
253 skb_queue_purge(&nb->queue); in x25_link_terminated()
254 x25_stop_t20timer(nb); in x25_link_terminated()
257 x25_kill_by_neigh(nb); in x25_link_terminated()
265 struct x25_neigh *nb = kmalloc(sizeof(*nb), GFP_ATOMIC); in x25_link_device_up() local
267 if (!nb) in x25_link_device_up()
270 skb_queue_head_init(&nb->queue); in x25_link_device_up()
271 timer_setup(&nb->t20timer, x25_t20timer_expiry, 0); in x25_link_device_up()
274 nb->dev = dev; in x25_link_device_up()
275 nb->state = X25_LINK_STATE_0; in x25_link_device_up()
276 nb->extended = 0; in x25_link_device_up()
280 nb->global_facil_mask = X25_MASK_REVERSE | in x25_link_device_up()
284 nb->t20 = sysctl_x25_restart_request_timeout; in x25_link_device_up()
285 refcount_set(&nb->refcnt, 1); in x25_link_device_up()
288 list_add(&nb->node, &x25_neigh_list); in x25_link_device_up()
299 static void __x25_remove_neigh(struct x25_neigh *nb) in __x25_remove_neigh() argument
301 if (nb->node.next) { in __x25_remove_neigh()
302 list_del(&nb->node); in __x25_remove_neigh()
303 x25_neigh_put(nb); in __x25_remove_neigh()
312 struct x25_neigh *nb; in x25_link_device_down() local
318 nb = list_entry(entry, struct x25_neigh, node); in x25_link_device_down()
320 if (nb->dev == dev) { in x25_link_device_down()
321 __x25_remove_neigh(nb); in x25_link_device_down()
334 struct x25_neigh *nb, *use = NULL; in x25_get_neigh() local
337 list_for_each_entry(nb, &x25_neigh_list, node) { in x25_get_neigh()
338 if (nb->dev == dev) { in x25_get_neigh()
339 use = nb; in x25_get_neigh()
356 struct x25_neigh *nb; in x25_subscr_ioctl() local
371 if ((nb = x25_get_neigh(dev)) == NULL) in x25_subscr_ioctl()
378 x25_subscr.extended = nb->extended; in x25_subscr_ioctl()
379 x25_subscr.global_facil_mask = nb->global_facil_mask; in x25_subscr_ioctl()
388 nb->extended = x25_subscr.extended; in x25_subscr_ioctl()
389 nb->global_facil_mask = x25_subscr.global_facil_mask; in x25_subscr_ioctl()
393 x25_neigh_put(nb); in x25_subscr_ioctl()
407 struct x25_neigh *nb; in x25_link_free() local
415 nb = list_entry(entry, struct x25_neigh, node); in x25_link_free()
416 dev = nb->dev; in x25_link_free()
417 __x25_remove_neigh(nb); in x25_link_free()