On 12/2/2020 7:03 PM, Grant Edwards wrote:
> On 2020-12-02, Andrew Lunn <and...@lunn.ch> wrote:
> 
>>>> So it will access the MDIO bus of the PHY that is attached to the
>>>> MAC.
>>>
>>> If that's the case, wouldn't the ioctl() calls "just work" even when
>>> only the fixed-phy mdio bus and fake PHY are declared in the device
>>> tree?
>>
>> The fixed-link PHY is connected to the MAC. So the IOCTL calls will be
>> made to the fixed-link fake MDIO bus.
> 
> Ah! When you said "the PHY that is attached to the MAC" above, I
> thought you meant electrically attached to the MAC via the mdio bus.
> 
> Then how does Forian Fainelli's solution below work? Won't the first
> phy found be the fixed one, and then the ioctl() calls will use the
> fixed-link bus?

You would have to have a local hack that intercepts the macb_ioctl() and
instead of calling phylink_mii_ioctl() it would have to implement a
custom ioctl() that does what drivers/net/phy/phy.c::phy_mii_ioctl does
except the mdiobus should be pointed to the MACB MDIO bus instance and
not be derived from the phy_device instance (because that one points to
the fixed PHY).
-- 
Florian

Reply via email to