Lines Matching refs:ax25
52 static int ax25_ds_state1_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int pf, int ty… in ax25_ds_state1_machine() argument
56 ax25->modulus = AX25_MODULUS; in ax25_ds_state1_machine()
57 ax25->window = ax25->ax25_dev->values[AX25_VALUES_WINDOW]; in ax25_ds_state1_machine()
58 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE); in ax25_ds_state1_machine()
62 ax25->modulus = AX25_EMODULUS; in ax25_ds_state1_machine()
63 ax25->window = ax25->ax25_dev->values[AX25_VALUES_EWINDOW]; in ax25_ds_state1_machine()
64 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE); in ax25_ds_state1_machine()
68 ax25_send_control(ax25, AX25_DM, pf, AX25_RESPONSE); in ax25_ds_state1_machine()
72 ax25_calculate_rtt(ax25); in ax25_ds_state1_machine()
73 ax25_stop_t1timer(ax25); in ax25_ds_state1_machine()
74 ax25_start_t3timer(ax25); in ax25_ds_state1_machine()
75 ax25_start_idletimer(ax25); in ax25_ds_state1_machine()
76 ax25->vs = 0; in ax25_ds_state1_machine()
77 ax25->va = 0; in ax25_ds_state1_machine()
78 ax25->vr = 0; in ax25_ds_state1_machine()
79 ax25->state = AX25_STATE_3; in ax25_ds_state1_machine()
80 ax25->n2count = 0; in ax25_ds_state1_machine()
81 if (ax25->sk != NULL) { in ax25_ds_state1_machine()
82 ax25->sk->state = TCP_ESTABLISHED; in ax25_ds_state1_machine()
84 if (!ax25->sk->dead) in ax25_ds_state1_machine()
85 ax25->sk->state_change(ax25->sk); in ax25_ds_state1_machine()
87 ax25_dama_on(ax25); in ax25_ds_state1_machine()
93 ax25_std_enquiry_response(ax25); in ax25_ds_state1_machine()
97 if (pf) ax25_disconnect(ax25, ECONNREFUSED); in ax25_ds_state1_machine()
101 if (pf) ax25_send_control(ax25, AX25_SABM, AX25_POLLON, AX25_COMMAND); in ax25_ds_state1_machine()
113 static int ax25_ds_state2_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int pf, int ty… in ax25_ds_state2_machine() argument
118 ax25_send_control(ax25, AX25_DISC, AX25_POLLON, AX25_COMMAND); in ax25_ds_state2_machine()
119 ax25_dama_off(ax25); in ax25_ds_state2_machine()
123 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE); in ax25_ds_state2_machine()
124 ax25_dama_off(ax25); in ax25_ds_state2_machine()
125 ax25_disconnect(ax25, 0); in ax25_ds_state2_machine()
131 ax25_dama_off(ax25); in ax25_ds_state2_machine()
132 ax25_disconnect(ax25, 0); in ax25_ds_state2_machine()
141 ax25_send_control(ax25, AX25_DISC, AX25_POLLON, AX25_COMMAND); in ax25_ds_state2_machine()
142 ax25_dama_off(ax25); in ax25_ds_state2_machine()
158 static int ax25_ds_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int ns, int nr… in ax25_ds_state3_machine() argument
166 ax25->modulus = AX25_MODULUS; in ax25_ds_state3_machine()
167 ax25->window = ax25->ax25_dev->values[AX25_VALUES_WINDOW]; in ax25_ds_state3_machine()
169 ax25->modulus = AX25_EMODULUS; in ax25_ds_state3_machine()
170 ax25->window = ax25->ax25_dev->values[AX25_VALUES_EWINDOW]; in ax25_ds_state3_machine()
172 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE); in ax25_ds_state3_machine()
173 ax25_stop_t1timer(ax25); in ax25_ds_state3_machine()
174 ax25_start_t3timer(ax25); in ax25_ds_state3_machine()
175 ax25_start_idletimer(ax25); in ax25_ds_state3_machine()
176 ax25->condition = 0x00; in ax25_ds_state3_machine()
177 ax25->vs = 0; in ax25_ds_state3_machine()
178 ax25->va = 0; in ax25_ds_state3_machine()
179 ax25->vr = 0; in ax25_ds_state3_machine()
180 ax25_requeue_frames(ax25); in ax25_ds_state3_machine()
181 ax25_dama_on(ax25); in ax25_ds_state3_machine()
185 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE); in ax25_ds_state3_machine()
186 ax25_dama_off(ax25); in ax25_ds_state3_machine()
187 ax25_disconnect(ax25, 0); in ax25_ds_state3_machine()
191 ax25_dama_off(ax25); in ax25_ds_state3_machine()
192 ax25_disconnect(ax25, ECONNRESET); in ax25_ds_state3_machine()
198 ax25->condition &= ~AX25_COND_PEER_RX_BUSY; in ax25_ds_state3_machine()
200 ax25->condition |= AX25_COND_PEER_RX_BUSY; in ax25_ds_state3_machine()
202 if (ax25_validate_nr(ax25, nr)) { in ax25_ds_state3_machine()
203 if (ax25_check_iframes_acked(ax25, nr)) in ax25_ds_state3_machine()
204 ax25->n2count=0; in ax25_ds_state3_machine()
206 ax25_ds_enquiry_response(ax25); in ax25_ds_state3_machine()
208 ax25_ds_nr_error_recovery(ax25); in ax25_ds_state3_machine()
209 ax25->state = AX25_STATE_1; in ax25_ds_state3_machine()
214 ax25->condition &= ~AX25_COND_PEER_RX_BUSY; in ax25_ds_state3_machine()
216 if (ax25_validate_nr(ax25, nr)) { in ax25_ds_state3_machine()
217 if (ax25->va != nr) in ax25_ds_state3_machine()
218 ax25->n2count=0; in ax25_ds_state3_machine()
220 ax25_frames_acked(ax25, nr); in ax25_ds_state3_machine()
221 ax25_calculate_rtt(ax25); in ax25_ds_state3_machine()
222 ax25_stop_t1timer(ax25); in ax25_ds_state3_machine()
223 ax25_start_t3timer(ax25); in ax25_ds_state3_machine()
224 ax25_requeue_frames(ax25); in ax25_ds_state3_machine()
227 ax25_ds_enquiry_response(ax25); in ax25_ds_state3_machine()
229 ax25_ds_nr_error_recovery(ax25); in ax25_ds_state3_machine()
230 ax25->state = AX25_STATE_1; in ax25_ds_state3_machine()
235 if (!ax25_validate_nr(ax25, nr)) { in ax25_ds_state3_machine()
236 ax25_ds_nr_error_recovery(ax25); in ax25_ds_state3_machine()
237 ax25->state = AX25_STATE_1; in ax25_ds_state3_machine()
240 if (ax25->condition & AX25_COND_PEER_RX_BUSY) { in ax25_ds_state3_machine()
241 ax25_frames_acked(ax25, nr); in ax25_ds_state3_machine()
242 ax25->n2count = 0; in ax25_ds_state3_machine()
244 if (ax25_check_iframes_acked(ax25, nr)) in ax25_ds_state3_machine()
245 ax25->n2count = 0; in ax25_ds_state3_machine()
247 if (ax25->condition & AX25_COND_OWN_RX_BUSY) { in ax25_ds_state3_machine()
248 if (pf) ax25_ds_enquiry_response(ax25); in ax25_ds_state3_machine()
251 if (ns == ax25->vr) { in ax25_ds_state3_machine()
252 ax25->vr = (ax25->vr + 1) % ax25->modulus; in ax25_ds_state3_machine()
253 queued = ax25_rx_iframe(ax25, skb); in ax25_ds_state3_machine()
254 if (ax25->condition & AX25_COND_OWN_RX_BUSY) in ax25_ds_state3_machine()
255 ax25->vr = ns; /* ax25->vr - 1 */ in ax25_ds_state3_machine()
256 ax25->condition &= ~AX25_COND_REJECT; in ax25_ds_state3_machine()
258 ax25_ds_enquiry_response(ax25); in ax25_ds_state3_machine()
260 if (!(ax25->condition & AX25_COND_ACK_PENDING)) { in ax25_ds_state3_machine()
261 ax25->condition |= AX25_COND_ACK_PENDING; in ax25_ds_state3_machine()
262 ax25_start_t2timer(ax25); in ax25_ds_state3_machine()
266 if (ax25->condition & AX25_COND_REJECT) { in ax25_ds_state3_machine()
267 if (pf) ax25_ds_enquiry_response(ax25); in ax25_ds_state3_machine()
269 ax25->condition |= AX25_COND_REJECT; in ax25_ds_state3_machine()
270 ax25_ds_enquiry_response(ax25); in ax25_ds_state3_machine()
271 ax25->condition &= ~AX25_COND_ACK_PENDING; in ax25_ds_state3_machine()
278 ax25_ds_establish_data_link(ax25); in ax25_ds_state3_machine()
279 ax25->state = AX25_STATE_1; in ax25_ds_state3_machine()
292 int ax25_ds_frame_in(ax25_cb *ax25, struct sk_buff *skb, int type) in ax25_ds_frame_in() argument
296 frametype = ax25_decode(ax25, skb, &ns, &nr, &pf); in ax25_ds_frame_in()
298 switch (ax25->state) { in ax25_ds_frame_in()
300 queued = ax25_ds_state1_machine(ax25, skb, frametype, pf, type); in ax25_ds_frame_in()
303 queued = ax25_ds_state2_machine(ax25, skb, frametype, pf, type); in ax25_ds_frame_in()
306 queued = ax25_ds_state3_machine(ax25, skb, frametype, ns, nr, pf, type); in ax25_ds_frame_in()