Lines Matching refs:sk
38 void nr_init_timers(struct sock *sk) in nr_init_timers() argument
40 struct nr_sock *nr = nr_sk(sk); in nr_init_timers()
42 setup_timer(&nr->t1timer, nr_t1timer_expiry, (unsigned long)sk); in nr_init_timers()
43 setup_timer(&nr->t2timer, nr_t2timer_expiry, (unsigned long)sk); in nr_init_timers()
44 setup_timer(&nr->t4timer, nr_t4timer_expiry, (unsigned long)sk); in nr_init_timers()
45 setup_timer(&nr->idletimer, nr_idletimer_expiry, (unsigned long)sk); in nr_init_timers()
48 sk->sk_timer.data = (unsigned long)sk; in nr_init_timers()
49 sk->sk_timer.function = &nr_heartbeat_expiry; in nr_init_timers()
52 void nr_start_t1timer(struct sock *sk) in nr_start_t1timer() argument
54 struct nr_sock *nr = nr_sk(sk); in nr_start_t1timer()
59 void nr_start_t2timer(struct sock *sk) in nr_start_t2timer() argument
61 struct nr_sock *nr = nr_sk(sk); in nr_start_t2timer()
66 void nr_start_t4timer(struct sock *sk) in nr_start_t4timer() argument
68 struct nr_sock *nr = nr_sk(sk); in nr_start_t4timer()
73 void nr_start_idletimer(struct sock *sk) in nr_start_idletimer() argument
75 struct nr_sock *nr = nr_sk(sk); in nr_start_idletimer()
81 void nr_start_heartbeat(struct sock *sk) in nr_start_heartbeat() argument
83 mod_timer(&sk->sk_timer, jiffies + 5 * HZ); in nr_start_heartbeat()
86 void nr_stop_t1timer(struct sock *sk) in nr_stop_t1timer() argument
88 del_timer(&nr_sk(sk)->t1timer); in nr_stop_t1timer()
91 void nr_stop_t2timer(struct sock *sk) in nr_stop_t2timer() argument
93 del_timer(&nr_sk(sk)->t2timer); in nr_stop_t2timer()
96 void nr_stop_t4timer(struct sock *sk) in nr_stop_t4timer() argument
98 del_timer(&nr_sk(sk)->t4timer); in nr_stop_t4timer()
101 void nr_stop_idletimer(struct sock *sk) in nr_stop_idletimer() argument
103 del_timer(&nr_sk(sk)->idletimer); in nr_stop_idletimer()
106 void nr_stop_heartbeat(struct sock *sk) in nr_stop_heartbeat() argument
108 del_timer(&sk->sk_timer); in nr_stop_heartbeat()
111 int nr_t1timer_running(struct sock *sk) in nr_t1timer_running() argument
113 return timer_pending(&nr_sk(sk)->t1timer); in nr_t1timer_running()
118 struct sock *sk = (struct sock *)param; in nr_heartbeat_expiry() local
119 struct nr_sock *nr = nr_sk(sk); in nr_heartbeat_expiry()
121 bh_lock_sock(sk); in nr_heartbeat_expiry()
126 if (sock_flag(sk, SOCK_DESTROY) || in nr_heartbeat_expiry()
127 (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) { in nr_heartbeat_expiry()
128 sock_hold(sk); in nr_heartbeat_expiry()
129 bh_unlock_sock(sk); in nr_heartbeat_expiry()
130 nr_destroy_socket(sk); in nr_heartbeat_expiry()
131 sock_put(sk); in nr_heartbeat_expiry()
140 if (atomic_read(&sk->sk_rmem_alloc) < (sk->sk_rcvbuf / 2) && in nr_heartbeat_expiry()
145 nr_write_internal(sk, NR_INFOACK); in nr_heartbeat_expiry()
151 nr_start_heartbeat(sk); in nr_heartbeat_expiry()
152 bh_unlock_sock(sk); in nr_heartbeat_expiry()
157 struct sock *sk = (struct sock *)param; in nr_t2timer_expiry() local
158 struct nr_sock *nr = nr_sk(sk); in nr_t2timer_expiry()
160 bh_lock_sock(sk); in nr_t2timer_expiry()
163 nr_enquiry_response(sk); in nr_t2timer_expiry()
165 bh_unlock_sock(sk); in nr_t2timer_expiry()
170 struct sock *sk = (struct sock *)param; in nr_t4timer_expiry() local
172 bh_lock_sock(sk); in nr_t4timer_expiry()
173 nr_sk(sk)->condition &= ~NR_COND_PEER_RX_BUSY; in nr_t4timer_expiry()
174 bh_unlock_sock(sk); in nr_t4timer_expiry()
179 struct sock *sk = (struct sock *)param; in nr_idletimer_expiry() local
180 struct nr_sock *nr = nr_sk(sk); in nr_idletimer_expiry()
182 bh_lock_sock(sk); in nr_idletimer_expiry()
184 nr_clear_queues(sk); in nr_idletimer_expiry()
187 nr_write_internal(sk, NR_DISCREQ); in nr_idletimer_expiry()
190 nr_start_t1timer(sk); in nr_idletimer_expiry()
191 nr_stop_t2timer(sk); in nr_idletimer_expiry()
192 nr_stop_t4timer(sk); in nr_idletimer_expiry()
194 sk->sk_state = TCP_CLOSE; in nr_idletimer_expiry()
195 sk->sk_err = 0; in nr_idletimer_expiry()
196 sk->sk_shutdown |= SEND_SHUTDOWN; in nr_idletimer_expiry()
198 if (!sock_flag(sk, SOCK_DEAD)) { in nr_idletimer_expiry()
199 sk->sk_state_change(sk); in nr_idletimer_expiry()
200 sock_set_flag(sk, SOCK_DEAD); in nr_idletimer_expiry()
202 bh_unlock_sock(sk); in nr_idletimer_expiry()
207 struct sock *sk = (struct sock *)param; in nr_t1timer_expiry() local
208 struct nr_sock *nr = nr_sk(sk); in nr_t1timer_expiry()
210 bh_lock_sock(sk); in nr_t1timer_expiry()
214 nr_disconnect(sk, ETIMEDOUT); in nr_t1timer_expiry()
215 bh_unlock_sock(sk); in nr_t1timer_expiry()
219 nr_write_internal(sk, NR_CONNREQ); in nr_t1timer_expiry()
225 nr_disconnect(sk, ETIMEDOUT); in nr_t1timer_expiry()
226 bh_unlock_sock(sk); in nr_t1timer_expiry()
230 nr_write_internal(sk, NR_DISCREQ); in nr_t1timer_expiry()
236 nr_disconnect(sk, ETIMEDOUT); in nr_t1timer_expiry()
237 bh_unlock_sock(sk); in nr_t1timer_expiry()
241 nr_requeue_frames(sk); in nr_t1timer_expiry()
246 nr_start_t1timer(sk); in nr_t1timer_expiry()
247 bh_unlock_sock(sk); in nr_t1timer_expiry()