/* Set PHY placed in a loopback mode of operation.  */
int32_t ethernet_phy_set_loopback(struct ethernet_phy_descriptor *const descr, bool state)
/* Set PHY placed in a loopback mode of operation.  */
int32_t ethernet_phy_set_loopback(struct ethernet_phy_descriptor *const descr, bool state)
{
	ASSERT(descr);
	if (state) {
		return ethernet_phy_set_reg_bit(descr, MDIO_REG0_BMCR, MDIO_REG0_BIT_LOOPBACK);
	} else {
		return ethernet_phy_clear_reg_bit(descr, MDIO_REG0_BMCR, MDIO_REG0_BIT_LOOPBACK);
	}
}