[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230117205703.25960-6-jerry.ray@microchip.com>
Date: Tue, 17 Jan 2023 14:57:01 -0600
From: Jerry Ray <jerry.ray@...rochip.com>
To: Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
"Paolo Abeni" <pabeni@...hat.com>,
Russell King <linux@...linux.org.uk>, <jbe@...gutronix.de>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Jerry Ray <jerry.ray@...rochip.com>
Subject: [net-next: PATCH v7 5/7] dsa: lan9303: Port 0 is xMII port
In preparing to move the adjust_link logic into the phylink_mac_link_up
api, change the macro used to check for the cpu port. In
phylink_mac_link_up, the phydev pointer passed in for the CPU port is
NULL, so we can't keep using phy_is_pseudo_fixed_link(phydev).
Signed-off-by: Jerry Ray <jerry.ray@...rochip.com>
---
drivers/net/dsa/lan9303-core.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index a4decf42a002..a4cc76423d4b 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -15,6 +15,9 @@
#include "lan9303.h"
+/* For the LAN9303 and LAN9354, only port 0 is an XMII port. */
+#define IS_PORT_XMII(port) ((port) == 0)
+
#define LAN9303_NUM_PORTS 3
/* 13.2 System Control and Status Registers
@@ -1066,7 +1069,11 @@ static void lan9303_adjust_link(struct dsa_switch *ds, int port,
{
int ctl;
- if (!phy_is_pseudo_fixed_link(phydev))
+ /* On this device, we are only interested in doing something here if
+ * this is an xMII port. All other ports are 10/100 phys using MDIO
+ * to control there link settings.
+ */
+ if (!IS_PORT_XMII(port))
return;
ctl = lan9303_phy_read(ds, port, MII_BMCR);
--
2.17.1
Powered by blists - more mailing lists