/* History X.25 001 Jonathan Naylor Started coding. X.25 002 Jonathan Naylor New timer architecture. Centralised disconnection processing.  */
static void x25_heartbeat_expiry(unsigned long)
/* History X.25 001 Jonathan Naylor Started coding. X.25 002 Jonathan Naylor New timer architecture. Centralised disconnection processing.  */
static void x25_heartbeat_expiry(unsigned long)
{
	struct sock *sk = (struct sock *)param;
	bh_lock_sock(sk);
	if (sock_owned_by_user(sk))
		goto restart_heartbeat;
	switch (x25_sk(sk)->state) {
		case X25_STATE_0:
			if (sock_flag(sk, SOCK_DESTROY) ||
			    (sk->sk_state == TCP_LISTEN &&
			     sock_flag(sk, SOCK_DEAD))) {
				bh_unlock_sock(sk);
				x25_destroy_socket_from_timer(sk);
				return;
			}
			break;
		case X25_STATE_3:
			x25_check_rbuf(sk);
			break;
	}
restart_heartbeat:
	x25_start_heartbeat(sk);
	bh_unlock_sock(sk);
}