FreeBSD/sys/dev/ntb/ntb_hw/ntb_hw.c
/* Atom does not have link status interrupt, poll on that platform */
Atom does not have link status interrupt, poll on that platform
Atom does not have link status interrupt poll on that platform
static void
atom_link_hb(void *arg)
{
	struct ntb_softc *ntb = arg;
	sbintime_t timo, poll_ts;
	timo = NTB_HB_TIMEOUT * hz;
	poll_ts = ntb->last_ts + timo;
	if ((sbintime_t)ticks - poll_ts < 0 && link_is_up(ntb)) {
		timo = poll_ts - ticks;
		goto out;
	}
	if (ntb_poll_link(ntb))
		ntb_link_event(ntb);
	if (!link_is_up(ntb) && atom_link_is_err(ntb)) {
		callout_reset(&ntb->lr_timer, 0, recover_atom_link, ntb);
		return;
	}
out:
	callout_reset(&ntb->heartbeat_timer, timo, atom_link_hb, ntb);
}
static void atom_link_hb ( void * arg ) { struct ntb_softc * ntb = arg ; sbintime_t timo , poll_ts ; timo = NTB_HB_TIMEOUT * hz ; poll_ts = ntb -> last_ts + timo ; if ( ( sbintime_t ) ticks - poll_ts < 0 && link_is_up ( ntb ) ) { timo = poll_ts - ticks ; goto out ; } if ( ntb_poll_link ( ntb ) ) ntb_link_event ( ntb ) ; if ( ! link_is_up ( ntb ) && atom_link_is_err ( ntb ) ) { callout_reset ( & ntb -> lr_timer , 0 , recover_atom_link , ntb ) ; return ; } out : callout_reset ( & ntb -> heartbeat_timer , timo , atom_link_hb , ntb ) ; }
Atom does not have link status interrupt, poll on that platform
Atom does not have link status interrupt poll on that platform
/*
	 * Delay polling the link status if an interrupt was received, unless
	 * the cached link status says the link is down.
	 */ /* Link is down with error, proceed with recovery */