FreeBSD/sys/dev/cxgb/common/cxgb_t3_hw.c
/**
 *	t3_phy_reset - reset a PHY block
 *	@phy: the PHY to operate on
 *	@mmd: the device address of the PHY block to reset
 *	@wait: how long to wait for the reset to complete in 1ms increments
 *
 *	Resets a PHY block and optionally waits for the reset to complete.
 *	@mmd should be 0 for 10/100/1000 PHYs and the device address to reset
 *	for 10G PHYs.
 */
reset a PHY block
@phy: the PHY to operate on
@mmd: the device address of the PHY block to reset
@wait: how long to wait for the reset to complete in 1ms increments

Resets a PHY block and optionally waits for the reset to complete.
@mmd should be 0 for 10/100/1000 PHYs and the device address to reset
for 10G PHYs.
reset a PHY block @phy : the PHY to operate on @mmd : the device address of the PHY block to reset @wait : how long to wait for the reset to complete in 1ms increments Resets a PHY block and optionally waits for the reset to complete . @mmd should be 0 for 10 / 100 / 1000 PHYs and the device address to reset for 10G PHYs .
int t3_phy_reset(struct cphy *phy, int mmd, int wait)
{
	int err;
	unsigned int ctl;
	err = t3_mdio_change_bits(phy, mmd, MII_BMCR, BMCR_PDOWN, BMCR_RESET);
	if (err || !wait)
		return err;
	do {
		err = mdio_read(phy, mmd, MII_BMCR, &ctl);
		if (err)
			return err;
		ctl &= BMCR_RESET;
		if (ctl)
			msleep(1);
	} while (ctl && --wait);
	return ctl ? -1 : 0;
}
int t3_phy_reset ( struct cphy * phy , int mmd , int wait ) { int err ; unsigned int ctl ; err = t3_mdio_change_bits ( phy , mmd , MII_BMCR , BMCR_PDOWN , BMCR_RESET ) ; if ( err || ! wait ) return err ; do { err = mdio_read ( phy , mmd , MII_BMCR , & ctl ) ; if ( err ) return err ; ctl &= BMCR_RESET ; if ( ctl ) msleep ( 1 ) ; } while ( ctl && -- wait ) ; return ctl ? -1 : 0 ; }
t3_phy_reset - reset a PHY block
      @phy: the PHY to operate on
      @mmd: the device address of the PHY block to reset
      @wait: how long to wait for the reset to complete in 1ms increments
t3_phy_reset - reset a PHY block @phy : the PHY to operate on @mmd : the device address of the PHY block to reset @wait : how long to wait for the reset to complete in 1ms increments