/* Performs the address cycle for clause 45 PHYs. Must be called with the MDIO_LOCK held.  */
static int mi1_wr_addr(struct adapter *adapter, int phy_addr, int mmd_addr, int reg_addr)
/* Performs the address cycle for clause 45 PHYs. Must be called with the MDIO_LOCK held.  */
static int mi1_wr_addr(struct adapter *adapter, int phy_addr, int mmd_addr, int reg_addr)
{
	u32 addr = V_REGADDR(mmd_addr) | V_PHYADDR(phy_addr);
	t3_set_reg_field(adapter, A_MI1_CFG, V_ST(M_ST), 0);
	t3_write_reg(adapter, A_MI1_ADDR, addr);
	t3_write_reg(adapter, A_MI1_DATA, reg_addr);
	t3_write_reg(adapter, A_MI1_OP, V_MDI_OP(0));
	return t3_wait_op_done(adapter, A_MI1_OP, F_BUSY, 0,
			       MDIO_ATTEMPTS, 10);
}