FreeBSD/sys/dev/ixl/ixl_pf_main.c
/*
** Note: this routine updates the OS on the link state
**	the real check of the hardware only happens with
**	a link interrupt.
*/
this routine updates the OS on the link state
the real check of the hardware only happens with
a link interrupt.
this routine updates the OS on the link state the real check of the hardware only happens with a link interrupt .
void
ixl_update_link_status(struct ixl_pf *pf)
{
	struct ixl_vsi		*vsi = &pf->vsi;
	struct i40e_hw		*hw = &pf->hw;
	struct ifnet		*ifp = vsi->ifp;
	device_t		dev = pf->dev;
	if (pf->link_up) {
		if (vsi->link_active == FALSE) {
			pf->fc = hw->fc.current_mode;
			if (bootverbose) {
				device_printf(dev, "Link is up %d Gbps %s,"
				    " Flow Control: %s\n",
				    ((pf->link_speed ==
				    I40E_LINK_SPEED_40GB)? 40:10),
				    "Full Duplex", ixl_fc_string[pf->fc]);
			}
			vsi->link_active = TRUE;
			if_link_state_change(ifp, LINK_STATE_UP);
		}
	} else { 
		if (vsi->link_active == TRUE) {
			if (bootverbose)
				device_printf(dev, "Link is Down\n");
			if_link_state_change(ifp, LINK_STATE_DOWN);
			vsi->link_active = FALSE;
		}
	}
	return;
}
void ixl_update_link_status ( struct ixl_pf * pf ) { struct ixl_vsi * vsi = & pf -> vsi ; struct i40e_hw * hw = & pf -> hw ; struct ifnet * ifp = vsi -> ifp ; device_t dev = pf -> dev ; if ( pf -> link_up ) { if ( vsi -> link_active == FALSE ) { pf -> fc = hw -> fc . current_mode ; if ( bootverbose ) { device_printf ( dev , " " " \n " , ( ( pf -> link_speed == I40E_LINK_SPEED_40GB ) ? 40 : 10 ) , " " , ixl_fc_string [ pf -> fc ] ) ; } vsi -> link_active = TRUE ; if_link_state_change ( ifp , LINK_STATE_UP ) ; } } else { if ( vsi -> link_active == TRUE ) { if ( bootverbose ) device_printf ( dev , " \n " ) ; if_link_state_change ( ifp , LINK_STATE_DOWN ) ; vsi -> link_active = FALSE ; } } return ; }
Note: this routine updates the OS on the link state
the real check of the hardware only happens with
a link interrupt.
Note : this routine updates the OS on the link state the real check of the hardware only happens with a link interrupt .
/* Link down */