Lines Matching refs:sk

32 void rose_start_heartbeat(struct sock *sk)  in rose_start_heartbeat()  argument
34 sk_stop_timer(sk, &sk->sk_timer); in rose_start_heartbeat()
36 sk->sk_timer.function = rose_heartbeat_expiry; in rose_start_heartbeat()
37 sk->sk_timer.expires = jiffies + 5 * HZ; in rose_start_heartbeat()
39 sk_reset_timer(sk, &sk->sk_timer, sk->sk_timer.expires); in rose_start_heartbeat()
42 void rose_start_t1timer(struct sock *sk) in rose_start_t1timer() argument
44 struct rose_sock *rose = rose_sk(sk); in rose_start_t1timer()
46 sk_stop_timer(sk, &rose->timer); in rose_start_t1timer()
51 sk_reset_timer(sk, &rose->timer, rose->timer.expires); in rose_start_t1timer()
54 void rose_start_t2timer(struct sock *sk) in rose_start_t2timer() argument
56 struct rose_sock *rose = rose_sk(sk); in rose_start_t2timer()
58 sk_stop_timer(sk, &rose->timer); in rose_start_t2timer()
63 sk_reset_timer(sk, &rose->timer, rose->timer.expires); in rose_start_t2timer()
66 void rose_start_t3timer(struct sock *sk) in rose_start_t3timer() argument
68 struct rose_sock *rose = rose_sk(sk); in rose_start_t3timer()
70 sk_stop_timer(sk, &rose->timer); in rose_start_t3timer()
75 sk_reset_timer(sk, &rose->timer, rose->timer.expires); in rose_start_t3timer()
78 void rose_start_hbtimer(struct sock *sk) in rose_start_hbtimer() argument
80 struct rose_sock *rose = rose_sk(sk); in rose_start_hbtimer()
82 sk_stop_timer(sk, &rose->timer); in rose_start_hbtimer()
87 sk_reset_timer(sk, &rose->timer, rose->timer.expires); in rose_start_hbtimer()
90 void rose_start_idletimer(struct sock *sk) in rose_start_idletimer() argument
92 struct rose_sock *rose = rose_sk(sk); in rose_start_idletimer()
94 sk_stop_timer(sk, &rose->idletimer); in rose_start_idletimer()
100 sk_reset_timer(sk, &rose->idletimer, rose->idletimer.expires); in rose_start_idletimer()
104 void rose_stop_heartbeat(struct sock *sk) in rose_stop_heartbeat() argument
106 sk_stop_timer(sk, &sk->sk_timer); in rose_stop_heartbeat()
109 void rose_stop_timer(struct sock *sk) in rose_stop_timer() argument
111 sk_stop_timer(sk, &rose_sk(sk)->timer); in rose_stop_timer()
114 void rose_stop_idletimer(struct sock *sk) in rose_stop_idletimer() argument
116 sk_stop_timer(sk, &rose_sk(sk)->idletimer); in rose_stop_idletimer()
121 struct sock *sk = from_timer(sk, t, sk_timer); in rose_heartbeat_expiry() local
122 struct rose_sock *rose = rose_sk(sk); in rose_heartbeat_expiry()
124 bh_lock_sock(sk); in rose_heartbeat_expiry()
129 if (sock_flag(sk, SOCK_DESTROY) || in rose_heartbeat_expiry()
130 (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) { in rose_heartbeat_expiry()
131 bh_unlock_sock(sk); in rose_heartbeat_expiry()
132 rose_destroy_socket(sk); in rose_heartbeat_expiry()
133 sock_put(sk); in rose_heartbeat_expiry()
142 if (atomic_read(&sk->sk_rmem_alloc) < (sk->sk_rcvbuf / 2) && in rose_heartbeat_expiry()
147 rose_write_internal(sk, ROSE_RR); in rose_heartbeat_expiry()
148 rose_stop_timer(sk); /* HB */ in rose_heartbeat_expiry()
154 rose_start_heartbeat(sk); in rose_heartbeat_expiry()
155 bh_unlock_sock(sk); in rose_heartbeat_expiry()
156 sock_put(sk); in rose_heartbeat_expiry()
162 struct sock *sk = &rose->sock; in rose_timer_expiry() local
164 bh_lock_sock(sk); in rose_timer_expiry()
168 rose_write_internal(sk, ROSE_CLEAR_REQUEST); in rose_timer_expiry()
170 rose_start_t3timer(sk); in rose_timer_expiry()
175 rose_disconnect(sk, ETIMEDOUT, -1, -1); in rose_timer_expiry()
181 rose_enquiry_response(sk); in rose_timer_expiry()
185 bh_unlock_sock(sk); in rose_timer_expiry()
186 sock_put(sk); in rose_timer_expiry()
192 struct sock *sk = &rose->sock; in rose_idletimer_expiry() local
194 bh_lock_sock(sk); in rose_idletimer_expiry()
195 rose_clear_queues(sk); in rose_idletimer_expiry()
197 rose_write_internal(sk, ROSE_CLEAR_REQUEST); in rose_idletimer_expiry()
198 rose_sk(sk)->state = ROSE_STATE_2; in rose_idletimer_expiry()
200 rose_start_t3timer(sk); in rose_idletimer_expiry()
202 sk->sk_state = TCP_CLOSE; in rose_idletimer_expiry()
203 sk->sk_err = 0; in rose_idletimer_expiry()
204 sk->sk_shutdown |= SEND_SHUTDOWN; in rose_idletimer_expiry()
206 if (!sock_flag(sk, SOCK_DEAD)) { in rose_idletimer_expiry()
207 sk->sk_state_change(sk); in rose_idletimer_expiry()
208 sock_set_flag(sk, SOCK_DEAD); in rose_idletimer_expiry()
210 bh_unlock_sock(sk); in rose_idletimer_expiry()
211 sock_put(sk); in rose_idletimer_expiry()