FreeBSD/sys/dev/etherswitch/ukswitch/ukswitch.c
/*
 * Poll the status for all PHYs.
 */
Poll the status for all PHYs.
Poll the status for all PHYs .
static void
ukswitch_miipollstat(struct ukswitch_softc *sc)
{
	int i, port;
	struct mii_data *mii;
	struct mii_softc *miisc;
	UKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED);
	for (i = 0; i < MII_NPHY; i++) {
		if (((1 << i) & sc->phymask) == 0)
			continue;
		port = ukswitch_portforphy(sc, i);
		if ((*sc->miibus[port]) == NULL)
			continue;
		mii = device_get_softc(*sc->miibus[port]);
		LIST_FOREACH(miisc, &mii->mii_phys, mii_list) {
			if (IFM_INST(mii->mii_media.ifm_cur->ifm_media) !=
			    miisc->mii_inst)
				continue;
			ukphy_status(miisc);
			mii_phy_update(miisc, MII_POLLSTAT);
		}
	}
}
static void ukswitch_miipollstat ( struct ukswitch_softc * sc ) { int i , port ; struct mii_data * mii ; struct mii_softc * miisc ; UKSWITCH_LOCK_ASSERT ( sc , MA_NOTOWNED ) ; for ( i = 0 ; i < MII_NPHY ; i ++ ) { if ( ( ( 1 << i ) & sc -> phymask ) == 0 ) continue ; port = ukswitch_portforphy ( sc , i ) ; if ( ( * sc -> miibus [ port ] ) == NULL ) continue ; mii = device_get_softc ( * sc -> miibus [ port ] ) ; LIST_FOREACH ( miisc , & mii -> mii_phys , mii_list ) { if ( IFM_INST ( mii -> mii_media . ifm_cur -> ifm_media ) != miisc -> mii_inst ) continue ; ukphy_status ( miisc ) ; mii_phy_update ( miisc , MII_POLLSTAT ) ; } } }
Poll the status for all PHYs.
Poll the status for all PHYs .