Hi Andrew,
Sorry but the previous patches with a list of MDIO busses and refactored
PHY ops still seems too much complex to just toggle a bit.
We know which switch port has an external PHY attached to it, right?
So why not just something like this:
struct mv88e6xxx_chip {
...
u16 external_phys;
...
}
int mv88e6xxx_g2_smi_phy_read(struct mv88e6xxx_chip *chip, int phy,
int reg, u16 *val)
{
u16 cmd = GLOBAL2_SMI_PHY_CMD_OP_22_READ_DATA | (addr << 5) | reg;
int err;
if (chip->external_phys & BIT(phy))
cmd |= GLOBAL2_SMI_PHY_CMD_EXTERNAL;
...
}
Thanks!
Vivien