Lines Matching refs:sk

32 static int x25_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)  in x25_queue_rx_frame()  argument
35 struct x25_sock *x25 = x25_sk(sk); in x25_queue_rx_frame()
40 skb_set_owner_r(skb, sk); in x25_queue_rx_frame()
74 skb_set_owner_r(skbn, sk); in x25_queue_rx_frame()
75 skb_queue_tail(&sk->sk_receive_queue, skbn); in x25_queue_rx_frame()
76 if (!sock_flag(sk, SOCK_DEAD)) in x25_queue_rx_frame()
77 sk->sk_data_ready(sk); in x25_queue_rx_frame()
87 static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametype) in x25_state1_machine() argument
91 struct x25_sock *x25 = x25_sk(sk); in x25_state1_machine()
96 x25_stop_timer(sk); in x25_state1_machine()
103 sk->sk_state = TCP_ESTABLISHED; in x25_state1_machine()
136 if (!sock_flag(sk, SOCK_DEAD)) in x25_state1_machine()
137 sk->sk_state_change(sk); in x25_state1_machine()
145 x25_write_internal(sk, X25_CLEAR_REQUEST); in x25_state1_machine()
146 x25_disconnect(sk, EISCONN, 0x01, 0x48); in x25_state1_machine()
153 x25_write_internal(sk, X25_CLEAR_CONFIRMATION); in x25_state1_machine()
154 x25_disconnect(sk, ECONNREFUSED, skb->data[3], skb->data[4]); in x25_state1_machine()
164 x25_write_internal(sk, X25_CLEAR_REQUEST); in x25_state1_machine()
166 x25_start_t23timer(sk); in x25_state1_machine()
175 static int x25_state2_machine(struct sock *sk, struct sk_buff *skb, int frametype) in x25_state2_machine() argument
183 x25_write_internal(sk, X25_CLEAR_CONFIRMATION); in x25_state2_machine()
184 x25_disconnect(sk, 0, skb->data[3], skb->data[4]); in x25_state2_machine()
188 x25_disconnect(sk, 0, 0, 0); in x25_state2_machine()
198 x25_write_internal(sk, X25_CLEAR_REQUEST); in x25_state2_machine()
199 x25_start_t23timer(sk); in x25_state2_machine()
208 static int x25_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype, int ns, int nr, … in x25_state3_machine() argument
212 struct x25_sock *x25 = x25_sk(sk); in x25_state3_machine()
219 x25_write_internal(sk, X25_RESET_CONFIRMATION); in x25_state3_machine()
220 x25_stop_timer(sk); in x25_state3_machine()
226 x25_requeue_frames(sk); in x25_state3_machine()
233 x25_write_internal(sk, X25_CLEAR_CONFIRMATION); in x25_state3_machine()
234 x25_disconnect(sk, 0, skb->data[3], skb->data[4]); in x25_state3_machine()
239 if (!x25_validate_nr(sk, nr)) { in x25_state3_machine()
240 x25_clear_queues(sk); in x25_state3_machine()
241 x25_write_internal(sk, X25_RESET_REQUEST); in x25_state3_machine()
242 x25_start_t22timer(sk); in x25_state3_machine()
250 x25_frames_acked(sk, nr); in x25_state3_machine()
261 if ((ns != x25->vr) || !x25_validate_nr(sk, nr)) { in x25_state3_machine()
262 x25_clear_queues(sk); in x25_state3_machine()
263 x25_write_internal(sk, X25_RESET_REQUEST); in x25_state3_machine()
264 x25_start_t22timer(sk); in x25_state3_machine()
273 x25_frames_acked(sk, nr); in x25_state3_machine()
275 if (x25_queue_rx_frame(sk, skb, m) == 0) { in x25_state3_machine()
280 x25_clear_queues(sk); in x25_state3_machine()
281 x25_write_internal(sk, X25_RESET_REQUEST); in x25_state3_machine()
282 x25_start_t22timer(sk); in x25_state3_machine()
291 if (atomic_read(&sk->sk_rmem_alloc) > in x25_state3_machine()
292 (sk->sk_rcvbuf >> 1)) in x25_state3_machine()
301 x25_stop_timer(sk); in x25_state3_machine()
302 x25_enquiry_response(sk); in x25_state3_machine()
305 x25_start_t2timer(sk); in x25_state3_machine()
314 if (sock_flag(sk, SOCK_URGINLINE)) in x25_state3_machine()
315 queued = !sock_queue_rcv_skb(sk, skb); in x25_state3_machine()
317 skb_set_owner_r(skb, sk); in x25_state3_machine()
321 sk_send_sigurg(sk); in x25_state3_machine()
322 x25_write_internal(sk, X25_INTERRUPT_CONFIRMATION); in x25_state3_machine()
333 x25_write_internal(sk, X25_CLEAR_REQUEST); in x25_state3_machine()
335 x25_start_t23timer(sk); in x25_state3_machine()
344 static int x25_state4_machine(struct sock *sk, struct sk_buff *skb, int frametype) in x25_state4_machine() argument
346 struct x25_sock *x25 = x25_sk(sk); in x25_state4_machine()
351 x25_write_internal(sk, X25_RESET_CONFIRMATION); in x25_state4_machine()
354 x25_stop_timer(sk); in x25_state4_machine()
361 x25_requeue_frames(sk); in x25_state4_machine()
368 x25_write_internal(sk, X25_CLEAR_CONFIRMATION); in x25_state4_machine()
369 x25_disconnect(sk, 0, skb->data[3], skb->data[4]); in x25_state4_machine()
379 x25_write_internal(sk, X25_CLEAR_REQUEST); in x25_state4_machine()
381 x25_start_t23timer(sk); in x25_state4_machine()
390 static int x25_state5_machine(struct sock *sk, struct sk_buff *skb, int frametype) in x25_state5_machine() argument
392 struct x25_sock *x25 = x25_sk(sk); in x25_state5_machine()
397 x25_write_internal(sk, X25_CLEAR_REQUEST); in x25_state5_machine()
399 x25_start_t23timer(sk); in x25_state5_machine()
403 x25_write_internal(sk, X25_CLEAR_CONFIRMATION); in x25_state5_machine()
404 x25_disconnect(sk, 0, skb->data[3], skb->data[4]); in x25_state5_machine()
415 int x25_process_rx_frame(struct sock *sk, struct sk_buff *skb) in x25_process_rx_frame() argument
417 struct x25_sock *x25 = x25_sk(sk); in x25_process_rx_frame()
423 frametype = x25_decode(sk, skb, &ns, &nr, &q, &d, &m); in x25_process_rx_frame()
427 queued = x25_state1_machine(sk, skb, frametype); in x25_process_rx_frame()
430 queued = x25_state2_machine(sk, skb, frametype); in x25_process_rx_frame()
433 queued = x25_state3_machine(sk, skb, frametype, ns, nr, q, d, m); in x25_process_rx_frame()
436 queued = x25_state4_machine(sk, skb, frametype); in x25_process_rx_frame()
439 queued = x25_state5_machine(sk, skb, frametype); in x25_process_rx_frame()
443 x25_kick(sk); in x25_process_rx_frame()
448 int x25_backlog_rcv(struct sock *sk, struct sk_buff *skb) in x25_backlog_rcv() argument
450 int queued = x25_process_rx_frame(sk, skb); in x25_backlog_rcv()