FreeBSD/sys/dev/ixl/if_ixlv.c
/*
**  Init entry point for the stack
*/
Init entry point for the stack
Init entry point for the stack
void
ixlv_init(void *arg)
{
	struct ixl_vsi *vsi = (struct ixl_vsi *)arg;
	struct ixlv_sc *sc = vsi->back;
	int retries = 0;
	mtx_lock(&sc->mtx);
	if (sc->init_in_progress) {
		mtx_unlock(&sc->mtx);
		return;
	} else
		sc->init_in_progress = true;
	ixlv_init_locked(sc);
	mtx_unlock(&sc->mtx);
	while (!(vsi->ifp->if_drv_flags & IFF_DRV_RUNNING)
	    && ++retries < IXLV_AQ_MAX_ERR) {
		i40e_msec_pause(25);
	}
	if (retries >= IXLV_AQ_MAX_ERR) {
		if_printf(vsi->ifp,
		    "Init failed to complete in allotted time!\n");
	}
	mtx_lock(&sc->mtx);
	sc->init_in_progress = false;
	mtx_unlock(&sc->mtx);
}
void ixlv_init ( void * arg ) { struct ixl_vsi * vsi = ( struct ixl_vsi * ) arg ; struct ixlv_sc * sc = vsi -> back ; int retries = 0 ; mtx_lock ( & sc -> mtx ) ; if ( sc -> init_in_progress ) { mtx_unlock ( & sc -> mtx ) ; return ; } else sc -> init_in_progress = true ; ixlv_init_locked ( sc ) ; mtx_unlock ( & sc -> mtx ) ; while ( ! ( vsi -> ifp -> if_drv_flags & IFF_DRV_RUNNING ) && ++ retries < IXLV_AQ_MAX_ERR ) { i40e_msec_pause ( 25 ) ; } if ( retries >= IXLV_AQ_MAX_ERR ) { if_printf ( vsi -> ifp , " \n " ) ; } mtx_lock ( & sc -> mtx ) ; sc -> init_in_progress = false ; mtx_unlock ( & sc -> mtx ) ; }
Init entry point for the stack
Init entry point for the stack
/* Prevent init from running again while waiting for AQ calls
	 * made in init_locked() to complete. */ /* Wait for init_locked to finish */