Lines Matching refs:ax25
34 static int ax25_rx_fragment(ax25_cb *ax25, struct sk_buff *skb) in ax25_rx_fragment() argument
38 if (ax25->fragno != 0) { in ax25_rx_fragment()
40 if ((ax25->fragno - 1) == (*skb->data & AX25_SEG_REM)) { in ax25_rx_fragment()
42 ax25->fragno = *skb->data & AX25_SEG_REM; in ax25_rx_fragment()
44 ax25->fraglen += skb->len; in ax25_rx_fragment()
45 skb_queue_tail(&ax25->frag_queue, skb); in ax25_rx_fragment()
48 if (ax25->fragno == 0) { in ax25_rx_fragment()
50 ax25->fraglen, in ax25_rx_fragment()
53 skb_queue_purge(&ax25->frag_queue); in ax25_rx_fragment()
59 skbn->dev = ax25->ax25_dev->dev; in ax25_rx_fragment()
64 while ((skbo = skb_dequeue(&ax25->frag_queue)) != NULL) { in ax25_rx_fragment()
71 ax25->fraglen = 0; in ax25_rx_fragment()
73 if (ax25_rx_iframe(ax25, skbn) == 0) in ax25_rx_fragment()
83 skb_queue_purge(&ax25->frag_queue); in ax25_rx_fragment()
84 ax25->fragno = *skb->data & AX25_SEG_REM; in ax25_rx_fragment()
86 ax25->fraglen = skb->len; in ax25_rx_fragment()
87 skb_queue_tail(&ax25->frag_queue, skb); in ax25_rx_fragment()
99 int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb) in ax25_rx_iframe() argument
107 ax25_start_idletimer(ax25); in ax25_rx_iframe()
125 skb->dev = ax25->ax25_dev->dev; in ax25_rx_iframe()
133 return ax25_rx_fragment(ax25, skb); in ax25_rx_iframe()
138 return (*func)(skb, ax25); in ax25_rx_iframe()
141 if (ax25->sk != NULL && ax25->ax25_dev->values[AX25_VALUES_CONMODE] == 2) { in ax25_rx_iframe()
142 if ((!ax25->pidincl && ax25->sk->sk_protocol == pid) || in ax25_rx_iframe()
143 ax25->pidincl) { in ax25_rx_iframe()
144 if (sock_queue_rcv_skb(ax25->sk, skb) == 0) in ax25_rx_iframe()
147 ax25->condition |= AX25_COND_OWN_RX_BUSY; in ax25_rx_iframe()
157 static int ax25_process_rx_frame(ax25_cb *ax25, struct sk_buff *skb, int type, int dama) in ax25_process_rx_frame() argument
161 if (ax25->state == AX25_STATE_0) in ax25_process_rx_frame()
164 switch (ax25->ax25_dev->values[AX25_VALUES_PROTOCOL]) { in ax25_process_rx_frame()
167 queued = ax25_std_frame_in(ax25, skb, type); in ax25_process_rx_frame()
172 if (dama || ax25->ax25_dev->dama.slave) in ax25_process_rx_frame()
173 queued = ax25_ds_frame_in(ax25, skb, type); in ax25_process_rx_frame()
175 queued = ax25_std_frame_in(ax25, skb, type); in ax25_process_rx_frame()
190 ax25_cb *ax25; in ax25_rcv() local
303 if ((ax25 = ax25_find_cb(&dest, &src, &reverse_dp, dev)) != NULL) { in ax25_rcv()
310 if (ax25_process_rx_frame(ax25, skb, type, dama) == 0) in ax25_rcv()
313 ax25_cb_put(ax25); in ax25_rcv()
353 ax25 = sk_to_ax25(make); in ax25_rcv()
365 if ((ax25 = ax25_create_cb()) == NULL) { in ax25_rcv()
370 ax25_fillin_cb(ax25, ax25_dev); in ax25_rcv()
373 ax25->source_addr = dest; in ax25_rcv()
374 ax25->dest_addr = src; in ax25_rcv()
379 if (dp.ndigi && !ax25->digipeat && in ax25_rcv()
380 (ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { in ax25_rcv()
382 ax25_destroy_socket(ax25); in ax25_rcv()
389 kfree(ax25->digipeat); in ax25_rcv()
390 ax25->digipeat = NULL; in ax25_rcv()
393 memcpy(ax25->digipeat, &reverse_dp, sizeof(ax25_digi)); in ax25_rcv()
397 ax25->modulus = AX25_EMODULUS; in ax25_rcv()
398 ax25->window = ax25_dev->values[AX25_VALUES_EWINDOW]; in ax25_rcv()
400 ax25->modulus = AX25_MODULUS; in ax25_rcv()
401 ax25->window = ax25_dev->values[AX25_VALUES_WINDOW]; in ax25_rcv()
404 ax25_send_control(ax25, AX25_UA, AX25_POLLON, AX25_RESPONSE); in ax25_rcv()
407 if (dama && ax25->ax25_dev->values[AX25_VALUES_PROTOCOL] == AX25_PROTO_DAMA_SLAVE) in ax25_rcv()
408 ax25_dama_on(ax25); in ax25_rcv()
411 ax25->state = AX25_STATE_3; in ax25_rcv()
413 ax25_cb_add(ax25); in ax25_rcv()
415 ax25_start_heartbeat(ax25); in ax25_rcv()
416 ax25_start_t3timer(ax25); in ax25_rcv()
417 ax25_start_idletimer(ax25); in ax25_rcv()