Re: [PATCH net-next v3 03/11] net: phy: replace is_c45 with phy_accces_mode

From: Andrew Lunn
Date: Tue Jul 18 2023 - 13:41:14 EST


> static inline bool phy_has_c45_registers(struct phy_device *phydev)
> {
> - return phydev->is_c45;
> + return phydev->access_mode != PHY_ACCESS_C22;
> }

So this is making me wounder if we have a clean separation between
register spaces and access methods.

Should there be a phy_has_c22_registers() ?

A PHY can have both C22 registers and C45 registers. It is up to the
driver to decide which it wants to access when.

Should phydev->access_mode really be phydev->access_mode_c45_registers
to indicate how to access the C45 registers if phy_has_c45_registers()
is true?

Has there been a review of all uses of phydev->is_c45 to determine if
the user wants to know if C45 registers exist,
a.k.a. phy_has_c45_registers(), or if C45 bus transactions can be
performed, and then later in this series, additionally if C45 over C22
can be performed. These are different things.

I need to keep reading the patches...

Andrew