Lines Matching refs:nb
39 static void x25_transmit_restart_confirmation(struct x25_neigh *nb);
40 static void x25_transmit_restart_request(struct x25_neigh *nb);
45 static inline void x25_start_t20timer(struct x25_neigh *nb) in x25_start_t20timer() argument
47 mod_timer(&nb->t20timer, jiffies + nb->t20); in x25_start_t20timer()
52 struct x25_neigh *nb = (struct x25_neigh *)param; in x25_t20timer_expiry() local
54 x25_transmit_restart_request(nb); in x25_t20timer_expiry()
56 x25_start_t20timer(nb); in x25_t20timer_expiry()
59 static inline void x25_stop_t20timer(struct x25_neigh *nb) in x25_stop_t20timer() argument
61 del_timer(&nb->t20timer); in x25_stop_t20timer()
64 static inline int x25_t20timer_pending(struct x25_neigh *nb) in x25_t20timer_pending() argument
66 return timer_pending(&nb->t20timer); in x25_t20timer_pending()
72 void x25_link_control(struct sk_buff *skb, struct x25_neigh *nb, in x25_link_control() argument
80 confirm = !x25_t20timer_pending(nb); in x25_link_control()
81 x25_stop_t20timer(nb); in x25_link_control()
82 nb->state = X25_LINK_STATE_3; in x25_link_control()
84 x25_transmit_restart_confirmation(nb); in x25_link_control()
88 x25_stop_t20timer(nb); in x25_link_control()
89 nb->state = X25_LINK_STATE_3; in x25_link_control()
107 if (nb->state == X25_LINK_STATE_3) in x25_link_control()
108 while ((skbn = skb_dequeue(&nb->queue)) != NULL) in x25_link_control()
109 x25_send_frame(skbn, nb); in x25_link_control()
115 static void x25_transmit_restart_request(struct x25_neigh *nb) in x25_transmit_restart_request() argument
128 *dptr++ = nb->extended ? X25_GFI_EXTSEQ : X25_GFI_STDSEQ; in x25_transmit_restart_request()
136 x25_send_frame(skb, nb); in x25_transmit_restart_request()
142 static void x25_transmit_restart_confirmation(struct x25_neigh *nb) in x25_transmit_restart_confirmation() argument
155 *dptr++ = nb->extended ? X25_GFI_EXTSEQ : X25_GFI_STDSEQ; in x25_transmit_restart_confirmation()
161 x25_send_frame(skb, nb); in x25_transmit_restart_confirmation()
168 void x25_transmit_clear_request(struct x25_neigh *nb, unsigned int lci, in x25_transmit_clear_request() argument
182 *dptr++ = ((lci >> 8) & 0x0F) | (nb->extended ? in x25_transmit_clear_request()
192 x25_send_frame(skb, nb); in x25_transmit_clear_request()
195 void x25_transmit_link(struct sk_buff *skb, struct x25_neigh *nb) in x25_transmit_link() argument
197 switch (nb->state) { in x25_transmit_link()
199 skb_queue_tail(&nb->queue, skb); in x25_transmit_link()
200 nb->state = X25_LINK_STATE_1; in x25_transmit_link()
201 x25_establish_link(nb); in x25_transmit_link()
205 skb_queue_tail(&nb->queue, skb); in x25_transmit_link()
208 x25_send_frame(skb, nb); in x25_transmit_link()
216 void x25_link_established(struct x25_neigh *nb) in x25_link_established() argument
218 switch (nb->state) { in x25_link_established()
220 nb->state = X25_LINK_STATE_2; in x25_link_established()
223 x25_transmit_restart_request(nb); in x25_link_established()
224 nb->state = X25_LINK_STATE_2; in x25_link_established()
225 x25_start_t20timer(nb); in x25_link_established()
235 void x25_link_terminated(struct x25_neigh *nb) in x25_link_terminated() argument
237 nb->state = X25_LINK_STATE_0; in x25_link_terminated()
239 x25_kill_by_neigh(nb); in x25_link_terminated()
247 struct x25_neigh *nb = kmalloc(sizeof(*nb), GFP_ATOMIC); in x25_link_device_up() local
249 if (!nb) in x25_link_device_up()
252 skb_queue_head_init(&nb->queue); in x25_link_device_up()
253 setup_timer(&nb->t20timer, x25_t20timer_expiry, (unsigned long)nb); in x25_link_device_up()
256 nb->dev = dev; in x25_link_device_up()
257 nb->state = X25_LINK_STATE_0; in x25_link_device_up()
258 nb->extended = 0; in x25_link_device_up()
262 nb->global_facil_mask = X25_MASK_REVERSE | in x25_link_device_up()
266 nb->t20 = sysctl_x25_restart_request_timeout; in x25_link_device_up()
267 atomic_set(&nb->refcnt, 1); in x25_link_device_up()
270 list_add(&nb->node, &x25_neigh_list); in x25_link_device_up()
281 static void __x25_remove_neigh(struct x25_neigh *nb) in __x25_remove_neigh() argument
283 skb_queue_purge(&nb->queue); in __x25_remove_neigh()
284 x25_stop_t20timer(nb); in __x25_remove_neigh()
286 if (nb->node.next) { in __x25_remove_neigh()
287 list_del(&nb->node); in __x25_remove_neigh()
288 x25_neigh_put(nb); in __x25_remove_neigh()
297 struct x25_neigh *nb; in x25_link_device_down() local
303 nb = list_entry(entry, struct x25_neigh, node); in x25_link_device_down()
305 if (nb->dev == dev) { in x25_link_device_down()
306 __x25_remove_neigh(nb); in x25_link_device_down()
319 struct x25_neigh *nb, *use = NULL; in x25_get_neigh() local
324 nb = list_entry(entry, struct x25_neigh, node); in x25_get_neigh()
326 if (nb->dev == dev) { in x25_get_neigh()
327 use = nb; in x25_get_neigh()
344 struct x25_neigh *nb; in x25_subscr_ioctl() local
359 if ((nb = x25_get_neigh(dev)) == NULL) in x25_subscr_ioctl()
366 x25_subscr.extended = nb->extended; in x25_subscr_ioctl()
367 x25_subscr.global_facil_mask = nb->global_facil_mask; in x25_subscr_ioctl()
376 nb->extended = x25_subscr.extended; in x25_subscr_ioctl()
377 nb->global_facil_mask = x25_subscr.global_facil_mask; in x25_subscr_ioctl()
381 x25_neigh_put(nb); in x25_subscr_ioctl()
395 struct x25_neigh *nb; in x25_link_free() local
403 nb = list_entry(entry, struct x25_neigh, node); in x25_link_free()
404 dev = nb->dev; in x25_link_free()
405 __x25_remove_neigh(nb); in x25_link_free()