Lines Matching refs:ax25

16 #include <net/ax25.h>
30 * Handling of state 0 and connection release is in ax25.c.
32 static int ax25_ds_state1_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int pf, int type)
36 ax25->modulus = AX25_MODULUS;
37 ax25->window = ax25->ax25_dev->values[AX25_VALUES_WINDOW];
38 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE);
42 ax25->modulus = AX25_EMODULUS;
43 ax25->window = ax25->ax25_dev->values[AX25_VALUES_EWINDOW];
44 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE);
48 ax25_send_control(ax25, AX25_DM, pf, AX25_RESPONSE);
52 ax25_calculate_rtt(ax25);
53 ax25_stop_t1timer(ax25);
54 ax25_start_t3timer(ax25);
55 ax25_start_idletimer(ax25);
56 ax25->vs = 0;
57 ax25->va = 0;
58 ax25->vr = 0;
59 ax25->state = AX25_STATE_3;
60 ax25->n2count = 0;
61 if (ax25->sk != NULL) {
62 bh_lock_sock(ax25->sk);
63 ax25->sk->sk_state = TCP_ESTABLISHED;
68 if (!sock_flag(ax25->sk, SOCK_DEAD))
69 ax25->sk->sk_state_change(ax25->sk);
70 bh_unlock_sock(ax25->sk);
72 ax25_dama_on(ax25);
78 ax25_std_enquiry_response(ax25);
83 ax25_disconnect(ax25, ECONNREFUSED);
88 ax25_send_control(ax25, AX25_SABM, AX25_POLLON, AX25_COMMAND);
98 * Handling of state 0 and connection release is in ax25.c.
100 static int ax25_ds_state2_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int pf, int type)
105 ax25_send_control(ax25, AX25_DISC, AX25_POLLON, AX25_COMMAND);
106 ax25_dama_off(ax25);
110 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE);
111 ax25_dama_off(ax25);
112 ax25_disconnect(ax25, 0);
118 ax25_dama_off(ax25);
119 ax25_disconnect(ax25, 0);
128 ax25_send_control(ax25, AX25_DISC, AX25_POLLON, AX25_COMMAND);
129 ax25_dama_off(ax25);
143 * Handling of state 0 and connection release is in ax25.c.
145 static int ax25_ds_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int ns, int nr, int pf, int type)
153 ax25->modulus = AX25_MODULUS;
154 ax25->window = ax25->ax25_dev->values[AX25_VALUES_WINDOW];
156 ax25->modulus = AX25_EMODULUS;
157 ax25->window = ax25->ax25_dev->values[AX25_VALUES_EWINDOW];
159 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE);
160 ax25_stop_t1timer(ax25);
161 ax25_start_t3timer(ax25);
162 ax25_start_idletimer(ax25);
163 ax25->condition = 0x00;
164 ax25->vs = 0;
165 ax25->va = 0;
166 ax25->vr = 0;
167 ax25_requeue_frames(ax25);
168 ax25_dama_on(ax25);
172 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE);
173 ax25_dama_off(ax25);
174 ax25_disconnect(ax25, 0);
178 ax25_dama_off(ax25);
179 ax25_disconnect(ax25, ECONNRESET);
185 ax25->condition &= ~AX25_COND_PEER_RX_BUSY;
187 ax25->condition |= AX25_COND_PEER_RX_BUSY;
189 if (ax25_validate_nr(ax25, nr)) {
190 if (ax25_check_iframes_acked(ax25, nr))
191 ax25->n2count=0;
193 ax25_ds_enquiry_response(ax25);
195 ax25_ds_nr_error_recovery(ax25);
196 ax25->state = AX25_STATE_1;
201 ax25->condition &= ~AX25_COND_PEER_RX_BUSY;
203 if (ax25_validate_nr(ax25, nr)) {
204 if (ax25->va != nr)
205 ax25->n2count=0;
207 ax25_frames_acked(ax25, nr);
208 ax25_calculate_rtt(ax25);
209 ax25_stop_t1timer(ax25);
210 ax25_start_t3timer(ax25);
211 ax25_requeue_frames(ax25);
214 ax25_ds_enquiry_response(ax25);
216 ax25_ds_nr_error_recovery(ax25);
217 ax25->state = AX25_STATE_1;
222 if (!ax25_validate_nr(ax25, nr)) {
223 ax25_ds_nr_error_recovery(ax25);
224 ax25->state = AX25_STATE_1;
227 if (ax25->condition & AX25_COND_PEER_RX_BUSY) {
228 ax25_frames_acked(ax25, nr);
229 ax25->n2count = 0;
231 if (ax25_check_iframes_acked(ax25, nr))
232 ax25->n2count = 0;
234 if (ax25->condition & AX25_COND_OWN_RX_BUSY) {
235 if (pf) ax25_ds_enquiry_response(ax25);
238 if (ns == ax25->vr) {
239 ax25->vr = (ax25->vr + 1) % ax25->modulus;
240 queued = ax25_rx_iframe(ax25, skb);
241 if (ax25->condition & AX25_COND_OWN_RX_BUSY)
242 ax25->vr = ns; /* ax25->vr - 1 */
243 ax25->condition &= ~AX25_COND_REJECT;
245 ax25_ds_enquiry_response(ax25);
247 if (!(ax25->condition & AX25_COND_ACK_PENDING)) {
248 ax25->condition |= AX25_COND_ACK_PENDING;
249 ax25_start_t2timer(ax25);
253 if (ax25->condition & AX25_COND_REJECT) {
254 if (pf) ax25_ds_enquiry_response(ax25);
256 ax25->condition |= AX25_COND_REJECT;
257 ax25_ds_enquiry_response(ax25);
258 ax25->condition &= ~AX25_COND_ACK_PENDING;
265 ax25_ds_establish_data_link(ax25);
266 ax25->state = AX25_STATE_1;
279 int ax25_ds_frame_in(ax25_cb *ax25, struct sk_buff *skb, int type)
283 frametype = ax25_decode(ax25, skb, &ns, &nr, &pf);
285 switch (ax25->state) {
287 queued = ax25_ds_state1_machine(ax25, skb, frametype, pf, type);
290 queued = ax25_ds_state2_machine(ax25, skb, frametype, pf, type);
293 queued = ax25_ds_state3_machine(ax25, skb, frametype, ns, nr, pf, type);