FreeBSD/sys/dev/ixgbe/if_ixv.c
/*********************************************************************
 *
 *  Media Ioctl callback
 *
 *  This routine is called whenever the user queries the status of
 *  the interface using ifconfig.
 *
 **********************************************************************/
Media Ioctl callback
This routine is called whenever the user queries the status of
the interface using ifconfig.
Media Ioctl callback This routine is called whenever the user queries the status of the interface using ifconfig .
static void
ixv_media_status(struct ifnet * ifp, struct ifmediareq * ifmr)
{
	struct adapter *adapter = ifp->if_softc;
	INIT_DEBUGOUT("ixv_media_status: begin");
	IXGBE_CORE_LOCK(adapter);
	ixv_update_link_status(adapter);
	ifmr->ifm_status = IFM_AVALID;
	ifmr->ifm_active = IFM_ETHER;
	if (!adapter->link_active) {
		IXGBE_CORE_UNLOCK(adapter);
		return;
	}
	ifmr->ifm_status |= IFM_ACTIVE;
	switch (adapter->link_speed) {
		case IXGBE_LINK_SPEED_1GB_FULL:
			ifmr->ifm_active |= IFM_1000_T | IFM_FDX;
			break;
		case IXGBE_LINK_SPEED_10GB_FULL:
			ifmr->ifm_active |= IFM_FDX;
			break;
	}
	IXGBE_CORE_UNLOCK(adapter);
	return;
}
static void ixv_media_status ( struct ifnet * ifp , struct ifmediareq * ifmr ) { struct adapter * adapter = ifp -> if_softc ; INIT_DEBUGOUT ( " " ) ; IXGBE_CORE_LOCK ( adapter ) ; ixv_update_link_status ( adapter ) ; ifmr -> ifm_status = IFM_AVALID ; ifmr -> ifm_active = IFM_ETHER ; if ( ! adapter -> link_active ) { IXGBE_CORE_UNLOCK ( adapter ) ; return ; } ifmr -> ifm_status |= IFM_ACTIVE ; switch ( adapter -> link_speed ) { case IXGBE_LINK_SPEED_1GB_FULL : ifmr -> ifm_active |= IFM_1000_T | IFM_FDX ; break ; case IXGBE_LINK_SPEED_10GB_FULL : ifmr -> ifm_active |= IFM_FDX ; break ; } IXGBE_CORE_UNLOCK ( adapter ) ; return ; }
Media Ioctl callback
  This routine is called whenever the user queries the status of
  the interface using ifconfig.
Media Ioctl callback This routine is called whenever the user queries the status of the interface using ifconfig .