[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3cfe5af5-31b6-492c-af55-cd0397b07eb1@lunn.ch>
Date:   Wed, 19 Jul 2023 01:54:19 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Michael Walle <mwalle@...nel.org>
Cc:     Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <linux@...linux.org.uk>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Yisen Zhuang <yisen.zhuang@...wei.com>,
        Salil Mehta <salil.mehta@...wei.com>,
        Florian Fainelli <florian.fainelli@...adcom.com>,
        Broadcom internal kernel review list 
        <bcm-kernel-feedback-list@...adcom.com>,
        Marek BehĂșn <kabel@...nel.org>,
        Xu Liang <lxu@...linear.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Simon Horman <simon.horman@...igine.com>
Subject: Re: [PATCH net-next v3 07/11] net: phy: introduce
 phy_mdiobus_read_mmd()
> +static int __phy_mdiobus_read_mmd(struct mii_bus *bus, int phy_addr,
> +				  enum phy_access_mode access_mode,
> +				  int devad, u32 regnum)
> +{
> +	switch (access_mode) {
> +	case PHY_ACCESS_C45:
> +		return __mdiobus_c45_read(bus, phy_addr, devad, regnum);
> +	case PHY_ACCESS_C22:
> +		/* ignore return value for legacy reasons */
> +		mmd_phy_indirect(bus, phy_addr, devad, regnum, false);
> +
> +		/* Read the content of the MMD's selected register */
> +		return __mdiobus_read(bus, phy_addr, MII_MMD_DATA);
> +	default:
> +		return -EOPNOTSUPP;
> +	}
So this is reading a C45 register space register, otherwise it would
not be called _mmd and have a devad. So access_mode should really be
transfer mode. Until now, only transfer mode C45 can be used to access
C45 register space. The point of this patchset is to add a new
C45_OVER_C22 transfer mode.
And C22 would should give -EINVAL, since you cannot use plain C22 bus
transactions to access C45 register space.
	Andrew 
Powered by blists - more mailing lists
 
