FreeBSD/sys/dev/bxe/bxe.c
/*
 * Called by the OS to get the current media status (i.e. link, speed, etc.).
 */
Called by the OS to get the current media status .
Called by the OS to get the current media status .
static void
bxe_ifmedia_status(struct ifnet *ifp, struct ifmediareq *ifmr)
{
    struct bxe_softc *sc = if_getsoftc(ifp);
    if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) {
        ifmr->ifm_active |= IFM_NONE;
        return;
    }
    ifmr->ifm_status = IFM_AVALID;
    ifmr->ifm_active = IFM_ETHER;
    if (sc->link_vars.link_up) {
        ifmr->ifm_status |= IFM_ACTIVE;
    } else {
        ifmr->ifm_active |= IFM_NONE;
        return;
    }
    ifmr->ifm_active |= sc->media;
    if (sc->link_vars.duplex == DUPLEX_FULL) {
        ifmr->ifm_active |= IFM_FDX;
    } else {
        ifmr->ifm_active |= IFM_HDX;
    }
}
static void bxe_ifmedia_status ( struct ifnet * ifp , struct ifmediareq * ifmr ) { struct bxe_softc * sc = if_getsoftc ( ifp ) ; if ( ( if_getdrvflags ( ifp ) & IFF_DRV_RUNNING ) == 0 ) { ifmr -> ifm_active |= IFM_NONE ; return ; } ifmr -> ifm_status = IFM_AVALID ; ifmr -> ifm_active = IFM_ETHER ; if ( sc -> link_vars . link_up ) { ifmr -> ifm_status |= IFM_ACTIVE ; } else { ifmr -> ifm_active |= IFM_NONE ; return ; } ifmr -> ifm_active |= sc -> media ; if ( sc -> link_vars . duplex == DUPLEX_FULL ) { ifmr -> ifm_active |= IFM_FDX ; } else { ifmr -> ifm_active |= IFM_HDX ; } }
Called by the OS to get the current media status (i.e.
Called by the OS to get the current media status ( i . e .
/* Report link down if the driver isn't running. */ /* Setup the default interface info. */