* [PATCH] amd-xgbe: print the right c45 id
@ 2020-07-07 17:33 Shyam Sundar S K
2020-07-07 18:04 ` Andrew Lunn
0 siblings, 1 reply; 2+ messages in thread
From: Shyam Sundar S K @ 2020-07-07 17:33 UTC (permalink / raw)
To: Tom Lendacky, David S . Miller, Jakub Kicinski, netdev; +Cc: Shyam Sundar S K
If an external PHY uses the CL45 protocol, then phydev->phy_id will be
zero. Update the debug message that prints the PHY ID to check the PHY
mode and print the PMAPMD MMD PHY ID value for a CL45 PHY.
Also, removing the TODO note, as the CL45 support has been updated to
do this.
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
---
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 46c3c1ca38d6..5b14fc758c2f 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -1024,9 +1024,9 @@ static int xgbe_phy_find_phy_device(struct xgbe_prv_data *pdata)
return -ENODEV;
}
netif_dbg(pdata, drv, pdata->netdev, "external PHY id is %#010x\n",
- phydev->phy_id);
-
- /*TODO: If c45, add request_module based on one of the MMD ids? */
+ (phy_data->phydev_mode == XGBE_MDIO_MODE_CL45)
+ ? phydev->c45_ids.device_ids[MDIO_MMD_PMAPMD]
+ : phydev->phy_id);
ret = phy_device_register(phydev);
if (ret) {
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] amd-xgbe: print the right c45 id
2020-07-07 17:33 [PATCH] amd-xgbe: print the right c45 id Shyam Sundar S K
@ 2020-07-07 18:04 ` Andrew Lunn
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2020-07-07 18:04 UTC (permalink / raw)
To: Shyam Sundar S K; +Cc: Tom Lendacky, David S . Miller, Jakub Kicinski, netdev
On Tue, Jul 07, 2020 at 05:33:47PM +0000, Shyam Sundar S K wrote:
> If an external PHY uses the CL45 protocol, then phydev->phy_id will be
> zero. Update the debug message that prints the PHY ID to check the PHY
> mode and print the PMAPMD MMD PHY ID value for a CL45 PHY.
>
> Also, removing the TODO note, as the CL45 support has been updated to
> do this.
>
> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
> ---
> drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> index 46c3c1ca38d6..5b14fc758c2f 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> @@ -1024,9 +1024,9 @@ static int xgbe_phy_find_phy_device(struct xgbe_prv_data *pdata)
> return -ENODEV;
> }
> netif_dbg(pdata, drv, pdata->netdev, "external PHY id is %#010x\n",
> - phydev->phy_id);
> -
> - /*TODO: If c45, add request_module based on one of the MMD ids? */
> + (phy_data->phydev_mode == XGBE_MDIO_MODE_CL45)
> + ? phydev->c45_ids.device_ids[MDIO_MMD_PMAPMD]
> + : phydev->phy_id);
IDs are pretty low level. And for C45 devices, each sub device can
have its own ID, make it even less useful.
You get more useful information from phy_attached_info().
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-07 18:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-07 17:33 [PATCH] amd-xgbe: print the right c45 id Shyam Sundar S K
2020-07-07 18:04 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).