[RFC PATCH net-next 2/2] net: phy: add Realtek XSGMII interface mode
From: Jonas Jelonek
Date: Tue Nov 17 2026 - 03:50:05 EST
Introduce PHY_INTERFACE_MODE_XSGMII for Realtek's proprietary eight-port
MAC-PHY interface. Append the enum value before PHY_INTERFACE_MODE_MAX
and provide the xsgmii string mapping.
Report eight carried ports and per-port 10/100/1000 Mbps capabilities.
Handle XSGMII as a PHY-status interface in phylink, accepting in-band
status and limiting the maximum per-port speed to 1 Gbps.
Document that XSGMII's transport capacity is independent of the number
of enabled ports. A dedicated mode distinguishes it from USXGMII and
10G-QXGMII without inferring the wire protocol from the active port count.
Signed-off-by: Jonas Jelonek <jonas@xxxxxxxxxxxxxxx>
---
Documentation/networking/phy.rst | 7 +++++++
drivers/net/phy/phy-core.c | 2 ++
drivers/net/phy/phy_caps.c | 1 +
drivers/net/phy/phylink.c | 3 +++
include/linux/phy.h | 4 ++++
5 files changed, 17 insertions(+)
diff --git a/Documentation/networking/phy.rst b/Documentation/networking/phy.rst
index d53067ab1a61..675787c4ab52 100644
--- a/Documentation/networking/phy.rst
+++ b/Documentation/networking/phy.rst
@@ -327,6 +327,13 @@ Some of the interface modes are described below:
This is the Penta SGMII mode, it is similar to QSGMII but it combines 5
SGMII lines into a single link compared to 4 on QSGMII.
+``PHY_INTERFACE_MODE_XSGMII``
+ This is Realtek's proprietary eight-port MAC-PHY interface. A single
+ SerDes lane operating at 10.3125 Gbaud carries eight ports, each supporting
+ speeds of 10Mbps, 100Mbps and 1Gbps. The interface describes the transport
+ capacity, independently of how many ports are enabled. It is distinct
+ from USXGMII and 10G-QXGMII.
+
``PHY_INTERFACE_MODE_10G_QXGMII``
Represents the 10G-QXGMII PHY-MAC interface as defined by the Cisco USXGMII
Multiport Copper Interface document. It supports 4 ports over a 10.3125 GHz
diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c
index d7a4a977fc8a..2dd36fa18e2c 100644
--- a/drivers/net/phy/phy-core.c
+++ b/drivers/net/phy/phy-core.c
@@ -201,6 +201,8 @@ int phy_interface_num_ports(phy_interface_t interface)
return 4;
case PHY_INTERFACE_MODE_PSGMII:
return 5;
+ case PHY_INTERFACE_MODE_XSGMII:
+ return 8;
case PHY_INTERFACE_MODE_MAX:
WARN_ONCE(1, "PHY_INTERFACE_MODE_MAX isn't a valid interface mode");
return 0;
diff --git a/drivers/net/phy/phy_caps.c b/drivers/net/phy/phy_caps.c
index 558e4df4d63c..0de12c42c47b 100644
--- a/drivers/net/phy/phy_caps.c
+++ b/drivers/net/phy/phy_caps.c
@@ -313,6 +313,7 @@ unsigned long phy_caps_from_interface(phy_interface_t interface)
case PHY_INTERFACE_MODE_QUSGMII:
case PHY_INTERFACE_MODE_SGMII:
case PHY_INTERFACE_MODE_GMII:
+ case PHY_INTERFACE_MODE_XSGMII:
link_caps |= BIT(LINK_CAPA_1000HD) | BIT(LINK_CAPA_1000FD);
fallthrough;
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index e885da1c2831..0028b543c788 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -263,6 +263,7 @@ static int phylink_interface_max_speed(phy_interface_t interface)
case PHY_INTERFACE_MODE_PSGMII:
case PHY_INTERFACE_MODE_QSGMII:
case PHY_INTERFACE_MODE_QUSGMII:
+ case PHY_INTERFACE_MODE_XSGMII:
case PHY_INTERFACE_MODE_SGMII:
case PHY_INTERFACE_MODE_GMII:
return SPEED_1000;
@@ -812,6 +813,7 @@ static int phylink_parse_mode(struct phylink *pl,
case PHY_INTERFACE_MODE_PSGMII:
case PHY_INTERFACE_MODE_QSGMII:
case PHY_INTERFACE_MODE_QUSGMII:
+ case PHY_INTERFACE_MODE_XSGMII:
case PHY_INTERFACE_MODE_RGMII:
case PHY_INTERFACE_MODE_RGMII_ID:
case PHY_INTERFACE_MODE_RGMII_RXID:
@@ -1046,6 +1048,7 @@ static enum inband_type phylink_get_inband_type(phy_interface_t interface)
case PHY_INTERFACE_MODE_PSGMII:
case PHY_INTERFACE_MODE_QSGMII:
case PHY_INTERFACE_MODE_QUSGMII:
+ case PHY_INTERFACE_MODE_XSGMII:
case PHY_INTERFACE_MODE_USXGMII:
case PHY_INTERFACE_MODE_10G_QXGMII:
/* These protocols are designed for use with a PHY which
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 21afc2082b17..ffff2a6313d3 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -107,6 +107,7 @@ extern const int phy_basic_ports_array[3];
* @PHY_INTERFACE_MODE_LAUI: 50 Gigabit Attachment Unit Interface
* @PHY_INTERFACE_MODE_100GBASEP: 100GBase-P - with Clause 134 FEC
* @PHY_INTERFACE_MODE_MIILITE: MII-Lite - MII without RXER TXER CRS COL
+ * @PHY_INTERFACE_MODE_XSGMII: Realtek proprietary eight-port SGMII over 10G
* @PHY_INTERFACE_MODE_MAX: Book keeping
*
* Describes the interface between the MAC and PHY.
@@ -152,6 +153,7 @@ typedef enum {
PHY_INTERFACE_MODE_LAUI,
PHY_INTERFACE_MODE_100GBASEP,
PHY_INTERFACE_MODE_MIILITE,
+ PHY_INTERFACE_MODE_XSGMII,
PHY_INTERFACE_MODE_MAX,
} phy_interface_t;
@@ -286,6 +288,8 @@ static inline const char *phy_modes(phy_interface_t interface)
return "100gbase-p";
case PHY_INTERFACE_MODE_MIILITE:
return "mii-lite";
+ case PHY_INTERFACE_MODE_XSGMII:
+ return "xsgmii";
default:
return "unknown";
}
--
2.53.0