Lines Matching defs:sk

29 static int nr_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
32 struct nr_sock *nr = nr_sk(sk);
36 nr_start_idletimer(sk);
63 return sock_queue_rcv_skb(sk, skbn);
71 static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
76 struct nr_sock *nr = nr_sk(sk);
78 nr_stop_t1timer(sk);
79 nr_start_idletimer(sk);
89 sk->sk_state = TCP_ESTABLISHED;
90 if (!sock_flag(sk, SOCK_DEAD))
91 sk->sk_state_change(sk);
96 nr_disconnect(sk, ECONNREFUSED);
101 nr_disconnect(sk, ECONNRESET);
115 static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
120 nr_disconnect(sk, ECONNRESET);
124 nr_write_internal(sk, NR_DISCACK);
127 nr_disconnect(sk, 0);
132 nr_disconnect(sk, ECONNRESET);
146 static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype)
148 struct nr_sock *nrom = nr_sk(sk);
159 nr_write_internal(sk, NR_CONNACK);
163 nr_write_internal(sk, NR_DISCACK);
164 nr_disconnect(sk, 0);
169 nr_disconnect(sk, ECONNRESET);
178 nr_start_t4timer(sk);
181 nr_stop_t4timer(sk);
183 if (!nr_validate_nr(sk, nr)) {
187 nr_frames_acked(sk, nr);
188 nr_send_nak_frame(sk);
191 nr_frames_acked(sk, nr);
193 nr_check_iframes_acked(sk, nr);
208 nr_start_t4timer(sk);
211 nr_stop_t4timer(sk);
213 if (nr_validate_nr(sk, nr)) {
215 nr_frames_acked(sk, nr);
216 nr_send_nak_frame(sk);
219 nr_frames_acked(sk, nr);
221 nr_check_iframes_acked(sk, nr);
235 if (nr_queue_rx_frame(sk, skbn, frametype & NR_MORE_FLAG) == 0) {
241 } else if (nr_in_rx_window(sk, ns)) {
255 nr_enquiry_response(sk);
259 nr_start_t2timer(sk);
266 nr_disconnect(sk, ECONNRESET);
275 /* Higher level upcall for a LAPB frame - called with sk locked */
276 int nr_process_rx_frame(struct sock *sk, struct sk_buff *skb)
278 struct nr_sock *nr = nr_sk(sk);
288 queued = nr_state1_machine(sk, skb, frametype);
291 queued = nr_state2_machine(sk, skb, frametype);
294 queued = nr_state3_machine(sk, skb, frametype);
298 nr_kick(sk);