Lines Matching refs:sk
35 void rose_start_heartbeat(struct sock *sk) in rose_start_heartbeat() argument
37 del_timer(&sk->sk_timer); in rose_start_heartbeat()
39 sk->sk_timer.data = (unsigned long)sk; in rose_start_heartbeat()
40 sk->sk_timer.function = &rose_heartbeat_expiry; in rose_start_heartbeat()
41 sk->sk_timer.expires = jiffies + 5 * HZ; in rose_start_heartbeat()
43 add_timer(&sk->sk_timer); in rose_start_heartbeat()
46 void rose_start_t1timer(struct sock *sk) in rose_start_t1timer() argument
48 struct rose_sock *rose = rose_sk(sk); in rose_start_t1timer()
52 rose->timer.data = (unsigned long)sk; in rose_start_t1timer()
59 void rose_start_t2timer(struct sock *sk) in rose_start_t2timer() argument
61 struct rose_sock *rose = rose_sk(sk); in rose_start_t2timer()
65 rose->timer.data = (unsigned long)sk; in rose_start_t2timer()
72 void rose_start_t3timer(struct sock *sk) in rose_start_t3timer() argument
74 struct rose_sock *rose = rose_sk(sk); in rose_start_t3timer()
78 rose->timer.data = (unsigned long)sk; in rose_start_t3timer()
85 void rose_start_hbtimer(struct sock *sk) in rose_start_hbtimer() argument
87 struct rose_sock *rose = rose_sk(sk); in rose_start_hbtimer()
91 rose->timer.data = (unsigned long)sk; in rose_start_hbtimer()
98 void rose_start_idletimer(struct sock *sk) in rose_start_idletimer() argument
100 struct rose_sock *rose = rose_sk(sk); in rose_start_idletimer()
105 rose->idletimer.data = (unsigned long)sk; in rose_start_idletimer()
113 void rose_stop_heartbeat(struct sock *sk) in rose_stop_heartbeat() argument
115 del_timer(&sk->sk_timer); in rose_stop_heartbeat()
118 void rose_stop_timer(struct sock *sk) in rose_stop_timer() argument
120 del_timer(&rose_sk(sk)->timer); in rose_stop_timer()
123 void rose_stop_idletimer(struct sock *sk) in rose_stop_idletimer() argument
125 del_timer(&rose_sk(sk)->idletimer); in rose_stop_idletimer()
130 struct sock *sk = (struct sock *)param; in rose_heartbeat_expiry() local
131 struct rose_sock *rose = rose_sk(sk); in rose_heartbeat_expiry()
133 bh_lock_sock(sk); in rose_heartbeat_expiry()
138 if (sock_flag(sk, SOCK_DESTROY) || in rose_heartbeat_expiry()
139 (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) { in rose_heartbeat_expiry()
140 bh_unlock_sock(sk); in rose_heartbeat_expiry()
141 rose_destroy_socket(sk); in rose_heartbeat_expiry()
150 if (atomic_read(&sk->sk_rmem_alloc) < (sk->sk_rcvbuf / 2) && in rose_heartbeat_expiry()
155 rose_write_internal(sk, ROSE_RR); in rose_heartbeat_expiry()
156 rose_stop_timer(sk); /* HB */ in rose_heartbeat_expiry()
162 rose_start_heartbeat(sk); in rose_heartbeat_expiry()
163 bh_unlock_sock(sk); in rose_heartbeat_expiry()
168 struct sock *sk = (struct sock *)param; in rose_timer_expiry() local
169 struct rose_sock *rose = rose_sk(sk); in rose_timer_expiry()
171 bh_lock_sock(sk); in rose_timer_expiry()
175 rose_write_internal(sk, ROSE_CLEAR_REQUEST); in rose_timer_expiry()
177 rose_start_t3timer(sk); in rose_timer_expiry()
182 rose_disconnect(sk, ETIMEDOUT, -1, -1); in rose_timer_expiry()
188 rose_enquiry_response(sk); in rose_timer_expiry()
192 bh_unlock_sock(sk); in rose_timer_expiry()
197 struct sock *sk = (struct sock *)param; in rose_idletimer_expiry() local
199 bh_lock_sock(sk); in rose_idletimer_expiry()
200 rose_clear_queues(sk); in rose_idletimer_expiry()
202 rose_write_internal(sk, ROSE_CLEAR_REQUEST); in rose_idletimer_expiry()
203 rose_sk(sk)->state = ROSE_STATE_2; in rose_idletimer_expiry()
205 rose_start_t3timer(sk); in rose_idletimer_expiry()
207 sk->sk_state = TCP_CLOSE; in rose_idletimer_expiry()
208 sk->sk_err = 0; in rose_idletimer_expiry()
209 sk->sk_shutdown |= SEND_SHUTDOWN; in rose_idletimer_expiry()
211 if (!sock_flag(sk, SOCK_DEAD)) { in rose_idletimer_expiry()
212 sk->sk_state_change(sk); in rose_idletimer_expiry()
213 sock_set_flag(sk, SOCK_DEAD); in rose_idletimer_expiry()
215 bh_unlock_sock(sk); in rose_idletimer_expiry()