• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/net/ax25/

Lines Matching defs:ax25

19 #include <net/ax25.h>
34 * Handling of state 0 and connection release is in ax25.c.
36 static int ax25_ds_state1_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int pf, int type)
40 ax25->modulus = AX25_MODULUS;
41 ax25->window = ax25->ax25_dev->values[AX25_VALUES_WINDOW];
42 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE);
46 ax25->modulus = AX25_EMODULUS;
47 ax25->window = ax25->ax25_dev->values[AX25_VALUES_EWINDOW];
48 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE);
52 ax25_send_control(ax25, AX25_DM, pf, AX25_RESPONSE);
56 ax25_calculate_rtt(ax25);
57 ax25_stop_t1timer(ax25);
58 ax25_start_t3timer(ax25);
59 ax25_start_idletimer(ax25);
60 ax25->vs = 0;
61 ax25->va = 0;
62 ax25->vr = 0;
63 ax25->state = AX25_STATE_3;
64 ax25->n2count = 0;
65 if (ax25->sk != NULL) {
66 bh_lock_sock(ax25->sk);
67 ax25->sk->sk_state = TCP_ESTABLISHED;
72 if (!sock_flag(ax25->sk, SOCK_DEAD))
73 ax25->sk->sk_state_change(ax25->sk);
74 bh_unlock_sock(ax25->sk);
76 ax25_dama_on(ax25);
82 ax25_std_enquiry_response(ax25);
87 ax25_disconnect(ax25, ECONNREFUSED);
92 ax25_send_control(ax25, AX25_SABM, AX25_POLLON, AX25_COMMAND);
102 * Handling of state 0 and connection release is in ax25.c.
104 static int ax25_ds_state2_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int pf, int type)
109 ax25_send_control(ax25, AX25_DISC, AX25_POLLON, AX25_COMMAND);
110 ax25_dama_off(ax25);
114 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE);
115 ax25_dama_off(ax25);
116 ax25_disconnect(ax25, 0);
122 ax25_dama_off(ax25);
123 ax25_disconnect(ax25, 0);
132 ax25_send_control(ax25, AX25_DISC, AX25_POLLON, AX25_COMMAND);
133 ax25_dama_off(ax25);
147 * Handling of state 0 and connection release is in ax25.c.
149 static int ax25_ds_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int ns, int nr, int pf, int type)
157 ax25->modulus = AX25_MODULUS;
158 ax25->window = ax25->ax25_dev->values[AX25_VALUES_WINDOW];
160 ax25->modulus = AX25_EMODULUS;
161 ax25->window = ax25->ax25_dev->values[AX25_VALUES_EWINDOW];
163 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE);
164 ax25_stop_t1timer(ax25);
165 ax25_start_t3timer(ax25);
166 ax25_start_idletimer(ax25);
167 ax25->condition = 0x00;
168 ax25->vs = 0;
169 ax25->va = 0;
170 ax25->vr = 0;
171 ax25_requeue_frames(ax25);
172 ax25_dama_on(ax25);
176 ax25_send_control(ax25, AX25_UA, pf, AX25_RESPONSE);
177 ax25_dama_off(ax25);
178 ax25_disconnect(ax25, 0);
182 ax25_dama_off(ax25);
183 ax25_disconnect(ax25, ECONNRESET);
189 ax25->condition &= ~AX25_COND_PEER_RX_BUSY;
191 ax25->condition |= AX25_COND_PEER_RX_BUSY;
193 if (ax25_validate_nr(ax25, nr)) {
194 if (ax25_check_iframes_acked(ax25, nr))
195 ax25->n2count=0;
197 ax25_ds_enquiry_response(ax25);
199 ax25_ds_nr_error_recovery(ax25);
200 ax25->state = AX25_STATE_1;
205 ax25->condition &= ~AX25_COND_PEER_RX_BUSY;
207 if (ax25_validate_nr(ax25, nr)) {
208 if (ax25->va != nr)
209 ax25->n2count=0;
211 ax25_frames_acked(ax25, nr);
212 ax25_calculate_rtt(ax25);
213 ax25_stop_t1timer(ax25);
214 ax25_start_t3timer(ax25);
215 ax25_requeue_frames(ax25);
218 ax25_ds_enquiry_response(ax25);
220 ax25_ds_nr_error_recovery(ax25);
221 ax25->state = AX25_STATE_1;
226 if (!ax25_validate_nr(ax25, nr)) {
227 ax25_ds_nr_error_recovery(ax25);
228 ax25->state = AX25_STATE_1;
231 if (ax25->condition & AX25_COND_PEER_RX_BUSY) {
232 ax25_frames_acked(ax25, nr);
233 ax25->n2count = 0;
235 if (ax25_check_iframes_acked(ax25, nr))
236 ax25->n2count = 0;
238 if (ax25->condition & AX25_COND_OWN_RX_BUSY) {
239 if (pf) ax25_ds_enquiry_response(ax25);
242 if (ns == ax25->vr) {
243 ax25->vr = (ax25->vr + 1) % ax25->modulus;
244 queued = ax25_rx_iframe(ax25, skb);
245 if (ax25->condition & AX25_COND_OWN_RX_BUSY)
246 ax25->vr = ns; /* ax25->vr - 1 */
247 ax25->condition &= ~AX25_COND_REJECT;
249 ax25_ds_enquiry_response(ax25);
251 if (!(ax25->condition & AX25_COND_ACK_PENDING)) {
252 ax25->condition |= AX25_COND_ACK_PENDING;
253 ax25_start_t2timer(ax25);
257 if (ax25->condition & AX25_COND_REJECT) {
258 if (pf) ax25_ds_enquiry_response(ax25);
260 ax25->condition |= AX25_COND_REJECT;
261 ax25_ds_enquiry_response(ax25);
262 ax25->condition &= ~AX25_COND_ACK_PENDING;
269 ax25_ds_establish_data_link(ax25);
270 ax25->state = AX25_STATE_1;
283 int ax25_ds_frame_in(ax25_cb *ax25, struct sk_buff *skb, int type)
287 frametype = ax25_decode(ax25, skb, &ns, &nr, &pf);
289 switch (ax25->state) {
291 queued = ax25_ds_state1_machine(ax25, skb, frametype, pf, type);
294 queued = ax25_ds_state2_machine(ax25, skb, frametype, pf, type);
297 queued = ax25_ds_state3_machine(ax25, skb, frametype, ns, nr, pf, type);