FreeBSD/sys/dev/stge/if_stge.c
/*
 * sc_miibus_readreg:	[mii interface function]
 *
 *	Read a PHY register on the MII of the TC9021.
 */
[mii interface function]
Read a PHY register on the MII of the TC9021.
[ mii interface function ] Read a PHY register on the MII of the TC9021 .
static int
stge_miibus_readreg(device_t dev, int phy, int reg)
{
	struct stge_softc *sc;
	int error, val;
	sc = device_get_softc(dev);
	if (reg == STGE_PhyCtrl) {
		STGE_MII_LOCK(sc);
		error = CSR_READ_1(sc, STGE_PhyCtrl);
		STGE_MII_UNLOCK(sc);
		return (error);
	}
	STGE_MII_LOCK(sc);
	val = mii_bitbang_readreg(dev, &stge_mii_bitbang_ops, phy, reg);
	STGE_MII_UNLOCK(sc);
	return (val);
}
static int stge_miibus_readreg ( device_t dev , int phy , int reg ) { struct stge_softc * sc ; int error , val ; sc = device_get_softc ( dev ) ; if ( reg == STGE_PhyCtrl ) { STGE_MII_LOCK ( sc ) ; error = CSR_READ_1 ( sc , STGE_PhyCtrl ) ; STGE_MII_UNLOCK ( sc ) ; return ( error ) ; } STGE_MII_LOCK ( sc ) ; val = mii_bitbang_readreg ( dev , & stge_mii_bitbang_ops , phy , reg ) ; STGE_MII_UNLOCK ( sc ) ; return ( val ) ; }
sc_miibus_readreg:   [mii interface function]
      Read a PHY register on the MII of the TC9021.
sc_miibus_readreg : [ mii interface function ] Read a PHY register on the MII of the TC9021 .
/* XXX allow ip1000phy read STGE_PhyCtrl register. */