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)
44 mod_timer(&nb->t20timer, jiffies + nb->t20);
49 struct x25_neigh *nb = from_timer(nb, t, t20timer);
51 x25_transmit_restart_request(nb);
53 x25_start_t20timer(nb);
56 static inline void x25_stop_t20timer(struct x25_neigh *nb)
58 del_timer(&nb->t20timer);
61 static inline int x25_t20timer_pending(struct x25_neigh *nb)
63 return timer_pending(&nb->t20timer);
69 void x25_link_control(struct sk_buff *skb, struct x25_neigh *nb,
77 confirm = !x25_t20timer_pending(nb);
78 x25_stop_t20timer(nb);
79 nb->state = X25_LINK_STATE_3;
81 x25_transmit_restart_confirmation(nb);
85 x25_stop_t20timer(nb);
86 nb->state = X25_LINK_STATE_3;
104 if (nb->state == X25_LINK_STATE_3)
105 while ((skbn = skb_dequeue(&nb->queue)) != NULL)
106 x25_send_frame(skbn, nb);
112 static void x25_transmit_restart_request(struct x25_neigh *nb)
125 *dptr++ = nb->extended ? X25_GFI_EXTSEQ : X25_GFI_STDSEQ;
133 x25_send_frame(skb, nb);
139 static void x25_transmit_restart_confirmation(struct x25_neigh *nb)
152 *dptr++ = nb->extended ? X25_GFI_EXTSEQ : X25_GFI_STDSEQ;
158 x25_send_frame(skb, nb);
165 void x25_transmit_clear_request(struct x25_neigh *nb, unsigned int lci,
179 *dptr++ = ((lci >> 8) & 0x0F) | (nb->extended ?
189 x25_send_frame(skb, nb);
192 void x25_transmit_link(struct sk_buff *skb, struct x25_neigh *nb)
194 switch (nb->state) {
196 skb_queue_tail(&nb->queue, skb);
197 nb->state = X25_LINK_STATE_1;
198 x25_establish_link(nb);
202 skb_queue_tail(&nb->queue, skb);
205 x25_send_frame(skb, nb);
213 void x25_link_established(struct x25_neigh *nb)
215 switch (nb->state) {
217 nb->state = X25_LINK_STATE_2;
220 x25_transmit_restart_request(nb);
221 nb->state = X25_LINK_STATE_2;
222 x25_start_t20timer(nb);
232 void x25_link_terminated(struct x25_neigh *nb)
234 nb->state = X25_LINK_STATE_0;
236 x25_kill_by_neigh(nb);
244 struct x25_neigh *nb = kmalloc(sizeof(*nb), GFP_ATOMIC);
246 if (!nb)
249 skb_queue_head_init(&nb->queue);
250 timer_setup(&nb->t20timer, x25_t20timer_expiry, 0);
253 nb->dev = dev;
254 nb->state = X25_LINK_STATE_0;
255 nb->extended = 0;
259 nb->global_facil_mask = X25_MASK_REVERSE |
263 nb->t20 = sysctl_x25_restart_request_timeout;
264 refcount_set(&nb->refcnt, 1);
267 list_add(&nb->node, &x25_neigh_list);
273 * @nb: - neigh to remove
278 static void __x25_remove_neigh(struct x25_neigh *nb)
280 skb_queue_purge(&nb->queue);
281 x25_stop_t20timer(nb);
283 if (nb->node.next) {
284 list_del(&nb->node);
285 x25_neigh_put(nb);
294 struct x25_neigh *nb;
300 nb = list_entry(entry, struct x25_neigh, node);
302 if (nb->dev == dev) {
303 __x25_remove_neigh(nb);
316 struct x25_neigh *nb, *use = NULL;
321 nb = list_entry(entry, struct x25_neigh, node);
323 if (nb->dev == dev) {
324 use = nb;
341 struct x25_neigh *nb;
356 if ((nb = x25_get_neigh(dev)) == NULL)
363 x25_subscr.extended = nb->extended;
364 x25_subscr.global_facil_mask = nb->global_facil_mask;
373 nb->extended = x25_subscr.extended;
374 nb->global_facil_mask = x25_subscr.global_facil_mask;
378 x25_neigh_put(nb);
392 struct x25_neigh *nb;
400 nb = list_entry(entry, struct x25_neigh, node);
401 dev = nb->dev;
402 __x25_remove_neigh(nb);