FreeBSD/sys/dev/ixl/if_ixlv.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
ixlv_media_status(struct ifnet * ifp, struct ifmediareq * ifmr)
{
	struct ixl_vsi		*vsi = ifp->if_softc;
	struct ixlv_sc	*sc = vsi->back;
	INIT_DBG_IF(ifp, "begin");
	mtx_lock(&sc->mtx);
	ixlv_update_link_status(sc);
	ifmr->ifm_status = IFM_AVALID;
	ifmr->ifm_active = IFM_ETHER;
	if (!sc->link_up) {
		mtx_unlock(&sc->mtx);
		INIT_DBG_IF(ifp, "end: link not up");
		return;
	}
	ifmr->ifm_status |= IFM_ACTIVE;
	ifmr->ifm_active |= IFM_FDX;
	mtx_unlock(&sc->mtx);
	INIT_DBG_IF(ifp, "end");
	return;
}
static void ixlv_media_status ( struct ifnet * ifp , struct ifmediareq * ifmr ) { struct ixl_vsi * vsi = ifp -> if_softc ; struct ixlv_sc * sc = vsi -> back ; INIT_DBG_IF ( ifp , " " ) ; mtx_lock ( & sc -> mtx ) ; ixlv_update_link_status ( sc ) ; ifmr -> ifm_status = IFM_AVALID ; ifmr -> ifm_active = IFM_ETHER ; if ( ! sc -> link_up ) { mtx_unlock ( & sc -> mtx ) ; INIT_DBG_IF ( ifp , " " ) ; return ; } ifmr -> ifm_status |= IFM_ACTIVE ; ifmr -> ifm_active |= IFM_FDX ; mtx_unlock ( & sc -> mtx ) ; INIT_DBG_IF ( ifp , " " ) ; 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 .
/* Hardware is always full-duplex */