Lines Matching refs:sk
37 static int rose_state1_machine(struct sock *sk, struct sk_buff *skb, int frametype) in rose_state1_machine() argument
39 struct rose_sock *rose = rose_sk(sk); in rose_state1_machine()
43 rose_stop_timer(sk); in rose_state1_machine()
44 rose_start_idletimer(sk); in rose_state1_machine()
51 sk->sk_state = TCP_ESTABLISHED; in rose_state1_machine()
52 if (!sock_flag(sk, SOCK_DEAD)) in rose_state1_machine()
53 sk->sk_state_change(sk); in rose_state1_machine()
57 rose_write_internal(sk, ROSE_CLEAR_CONFIRMATION); in rose_state1_machine()
58 rose_disconnect(sk, ECONNREFUSED, skb->data[3], skb->data[4]); in rose_state1_machine()
74 static int rose_state2_machine(struct sock *sk, struct sk_buff *skb, int frametype) in rose_state2_machine() argument
76 struct rose_sock *rose = rose_sk(sk); in rose_state2_machine()
80 rose_write_internal(sk, ROSE_CLEAR_CONFIRMATION); in rose_state2_machine()
81 rose_disconnect(sk, 0, skb->data[3], skb->data[4]); in rose_state2_machine()
86 rose_disconnect(sk, 0, -1, -1); in rose_state2_machine()
102 static int rose_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype, int ns, int nr,… in rose_state3_machine() argument
104 struct rose_sock *rose = rose_sk(sk); in rose_state3_machine()
109 rose_stop_timer(sk); in rose_state3_machine()
110 rose_start_idletimer(sk); in rose_state3_machine()
111 rose_write_internal(sk, ROSE_RESET_CONFIRMATION); in rose_state3_machine()
117 rose_requeue_frames(sk); in rose_state3_machine()
121 rose_write_internal(sk, ROSE_CLEAR_CONFIRMATION); in rose_state3_machine()
122 rose_disconnect(sk, 0, skb->data[3], skb->data[4]); in rose_state3_machine()
128 if (!rose_validate_nr(sk, nr)) { in rose_state3_machine()
129 rose_write_internal(sk, ROSE_RESET_REQUEST); in rose_state3_machine()
136 rose_start_t2timer(sk); in rose_state3_machine()
137 rose_stop_idletimer(sk); in rose_state3_machine()
139 rose_frames_acked(sk, nr); in rose_state3_machine()
150 if (!rose_validate_nr(sk, nr)) { in rose_state3_machine()
151 rose_write_internal(sk, ROSE_RESET_REQUEST); in rose_state3_machine()
158 rose_start_t2timer(sk); in rose_state3_machine()
159 rose_stop_idletimer(sk); in rose_state3_machine()
162 rose_frames_acked(sk, nr); in rose_state3_machine()
164 rose_start_idletimer(sk); in rose_state3_machine()
165 if (sk_filter_trim_cap(sk, skb, ROSE_MIN_LEN) == 0 && in rose_state3_machine()
166 __sock_queue_rcv_skb(sk, skb) == 0) { in rose_state3_machine()
171 rose_write_internal(sk, ROSE_RESET_REQUEST); in rose_state3_machine()
178 rose_start_t2timer(sk); in rose_state3_machine()
179 rose_stop_idletimer(sk); in rose_state3_machine()
182 if (atomic_read(&sk->sk_rmem_alloc) > in rose_state3_machine()
183 (sk->sk_rcvbuf >> 1)) in rose_state3_machine()
192 rose_stop_timer(sk); in rose_state3_machine()
193 rose_enquiry_response(sk); in rose_state3_machine()
196 rose_start_hbtimer(sk); in rose_state3_machine()
213 static int rose_state4_machine(struct sock *sk, struct sk_buff *skb, int frametype) in rose_state4_machine() argument
215 struct rose_sock *rose = rose_sk(sk); in rose_state4_machine()
219 rose_write_internal(sk, ROSE_RESET_CONFIRMATION); in rose_state4_machine()
222 rose_stop_timer(sk); in rose_state4_machine()
223 rose_start_idletimer(sk); in rose_state4_machine()
230 rose_requeue_frames(sk); in rose_state4_machine()
234 rose_write_internal(sk, ROSE_CLEAR_CONFIRMATION); in rose_state4_machine()
235 rose_disconnect(sk, 0, skb->data[3], skb->data[4]); in rose_state4_machine()
251 static int rose_state5_machine(struct sock *sk, struct sk_buff *skb, int frametype) in rose_state5_machine() argument
254 rose_write_internal(sk, ROSE_CLEAR_CONFIRMATION); in rose_state5_machine()
255 rose_disconnect(sk, 0, skb->data[3], skb->data[4]); in rose_state5_machine()
256 rose_sk(sk)->neighbour->use--; in rose_state5_machine()
263 int rose_process_rx_frame(struct sock *sk, struct sk_buff *skb) in rose_process_rx_frame() argument
265 struct rose_sock *rose = rose_sk(sk); in rose_process_rx_frame()
275 queued = rose_state1_machine(sk, skb, frametype); in rose_process_rx_frame()
278 queued = rose_state2_machine(sk, skb, frametype); in rose_process_rx_frame()
281 queued = rose_state3_machine(sk, skb, frametype, ns, nr, q, d, m); in rose_process_rx_frame()
284 queued = rose_state4_machine(sk, skb, frametype); in rose_process_rx_frame()
287 queued = rose_state5_machine(sk, skb, frametype); in rose_process_rx_frame()
291 rose_kick(sk); in rose_process_rx_frame()