lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <b81d5166-aa61-5851-6e7a-6c78589122e3@gmail.com>
Date:   Sat, 2 Mar 2019 16:57:32 +0100
From:   Heiner Kallweit <hkallweit1@...il.com>
To:     Vivien Didelot <vivien.didelot@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        David Miller <davem@...emloft.net>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: [PATCH net-next] net: dsa: mv88e6xxx: support in-band signalling with
 external PHY for 1000BaseX/2500BaseX

Propagate the external PHY settings also in 1000BaseX and
2500BaseX mode.

Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
---
 drivers/net/dsa/mv88e6xxx/serdes.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/serdes.c b/drivers/net/dsa/mv88e6xxx/serdes.c
index 6a5de1b72..238f79872 100644
--- a/drivers/net/dsa/mv88e6xxx/serdes.c
+++ b/drivers/net/dsa/mv88e6xxx/serdes.c
@@ -509,6 +509,7 @@ int mv88e6390x_serdes_power(struct mv88e6xxx_chip *chip, int port, bool on)
 static void mv88e6390_serdes_irq_link_sgmii(struct mv88e6xxx_chip *chip,
 					    int port, int lane)
 {
+	u8 cmode = chip->ports[port].cmode;
 	struct dsa_switch *ds = chip->ds;
 	int duplex = DUPLEX_UNKNOWN;
 	int speed = SPEED_UNKNOWN;
@@ -525,7 +526,13 @@ static void mv88e6390_serdes_irq_link_sgmii(struct mv88e6xxx_chip *chip,
 	link = status & MV88E6390_SGMII_PHY_STATUS_LINK ?
 	       LINK_FORCED_UP : LINK_FORCED_DOWN;
 
-	if (status & MV88E6390_SGMII_PHY_STATUS_SPD_DPL_VALID) {
+	if (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASE_X) {
+		speed = SPEED_1000;
+		duplex = DUPLEX_FULL;
+	} else if (cmode == MV88E6XXX_PORT_STS_CMODE_2500BASEX) {
+		speed = SPEED_2500;
+		duplex = DUPLEX_FULL;
+	} else if (status & MV88E6390_SGMII_PHY_STATUS_SPD_DPL_VALID) {
 		duplex = status & MV88E6390_SGMII_PHY_STATUS_DUPLEX_FULL ?
 			 DUPLEX_FULL : DUPLEX_HALF;
 
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ