🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27235

[PATCH net-next v2 4/4] r8169: enable Giga Lite on RTL8168H/EP/FP

#27235
From: Hee-Suk Kim
Date: Sat, 05 Dec 2026 04:00
95 lines
13599 bytes
Giga Lite is a Realtek proprietary mode which runs at 500 Mbps over two
pairs. Set RTL_PHY_F_GIGA_LITE and MAC_500FD on RTL8168H, RTL8168EP and
RTL8168FP, so that the PHY driver exposes it as 500baseT2/Full.

The vendor driver enables Giga Lite on RTL8168H and RTL8168FP, but not
on RTL8168M, which shares its chip version with RTL8168H in r8169. So
exclude RTL8168M by its XID. RTL8168EP is not handled by the vendor
driver, but Giga Lite was tested to work on it.

Signed-off-by: Hee-Suk Kim <hskim@dilluti0n.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 1da64c6e39e2..59a6c3a5a645 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -28,6 +28,7 @@
 #include <linux/bitfield.h>
 #include <linux/phylink.h>
 #include <linux/prefetch.h>
+#include <linux/realtek_phy.h>
 #include <linux/ipv6.h>
 #include <linux/unaligned.h>
 #include <linux/u64_stats_sync.h>
@@ -884,6 +885,7 @@ struct rtl8169_private {
 	struct mutex led_lock;	/* serialize LED ctrl RMW access */
 
 	unsigned supports_gmii:1;
+	unsigned supports_giga_lite:1;
 	unsigned aspm_manageable:1;
 	unsigned dash_enabled:1;
 	dma_addr_t counters_phys_addr;
@@ -2290,6 +2292,7 @@ static const struct rtl_coalesce_info rtl_coalesce_info_8169[] = {
 
 static const struct rtl_coalesce_info rtl_coalesce_info_8168_8136[] = {
 	{ SPEED_1000,	COALESCE_DELAY(5000) },
+	{ SPEED_500,	COALESCE_DELAY(5000) },
 	{ SPEED_100,	COALESCE_DELAY(2560) },
 	{ SPEED_10,	COALESCE_DELAY(40960) },
 	{ 0 },
@@ -2662,6 +2665,20 @@ static const struct rtl_chip_info *rtl8169_get_chip_version(u32 xid, bool gmii)
 	return p;
 }
 
+static bool rtl_supports_giga_lite(struct rtl8169_private *tp, u32 xid)
+{
+	switch (tp->mac_version) {
+	case RTL_GIGA_MAC_VER_46:
+		/* RTL8168M */
+		return (xid & 0x7cf) != 0x6c0;
+	case RTL_GIGA_MAC_VER_51:
+	case RTL_GIGA_MAC_VER_52:
+		return true;
+	default:
+		return false;
+	}
+}
+
 static const struct rtl_chip_info *rtl8169_get_extended_chip_version(u32 xid2)
 {
 	const struct rtl_chip_info *p = rtl_chip_infos_extended;
@@ -6291,6 +6308,9 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
 		return -EUNATCH;
 	}
 
+	if (tp->supports_giga_lite)
+		tp->phydev->dev_flags |= RTL_PHY_F_GIGA_LITE;
+
 	/* Keep EEE off but the version stays EEE-capable so that link-up
 	 * still clears the MAC TX-LPI bits.
 	 */
@@ -6664,6 +6684,9 @@ static int rtl_init_phylink(struct rtl8169_private *tp)
 			if (tp->supports_gmii)
 				tp->phylink_config.mac_capabilities |= MAC_1000FD;
 
+		if (tp->supports_giga_lite)
+			tp->phylink_config.mac_capabilities |= MAC_500FD;
+
 		if (tp->mac_version < RTL_GIGA_MAC_VER_61)
 			phy_mode = tp->supports_gmii ? PHY_INTERFACE_MODE_GMII :
 				   PHY_INTERFACE_MODE_MII;
@@ -6869,6 +6892,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 				     "unknown chip %sXID %x, contact r8169 maintainers (see MAINTAINERS file)\n",
 				     ext_xid_str, xid);
 	tp->mac_version = chip->mac_version;
+	tp->supports_giga_lite = rtl_supports_giga_lite(tp, xid);
 	tp->fw_name = chip->fw_name;
 	tp->speed = SPEED_UNKNOWN;
 

-- 
2.56.1
Technical Details
Message-ID: <20261205-giga-lite-v2-4-5b84410edb9f@dilluti0n.com>
Path: mbox-mo1.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-nl.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377820-linux-kernel-netdev=dewy.ru
References: <20261205-giga-lite-v2-0-5b84410edb9f@dilluti0n.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-nl.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377820-linux-kernel-netdev=dewy.ru
From: hskim@dilluti0n.com (Hee-Suk Kim)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v2 4/4] r8169: enable Giga Lite on RTL8168H/EP/FP
Date: Sat, 05 Dec 2026 13:00:39 +0900
Organization: Usenet Network
Message-ID: <20261205-giga-lite-v2-4-5b84410edb9f@dilluti0n.com>
References: <20261205-giga-lite-v2-0-5b84410edb9f@dilluti0n.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2949064"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:PRJAOn66aggnDaosO19eVBubHCI= sha256:nzhhCDeNuD8eHdOAUJ5al2LSFV3aUCRNNgXkAmdyHNE=
	sha1:uRSAaHFhlQHUtpkfovwOBHYvZdU= sha256:XEsRM1XrT6Gpg3dTOCrH6x1j6DER4Fbff9uSvSm5NUc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id C7254117D1F; Sat,  5 Dec 2026 07:01:33 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.098
X-Spam-Status: No, score=-3.098 tagged_above=-9999 required=6.31
	tests=[DKIM_INVALID=0.1, DKIM_SIGNED=0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=fail (2048-bit key)
	reason="fail (message has been altered)" header.d=dilluti0n.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id FP10ktu4GSHq;
	Sat,  5 Dec 2026 07:01:31 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377820-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=dilluti0n.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 6A44B117D22; Sat,  5 Dec 2026 07:01:22 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 564FC290E0; Sat,  5 Dec 2026 04:01:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796443273;
	b=5MLJAF/rAXG0DcluKDuK3slj3oCb9J0+7I6TotGg6hSvgizee9XQmIZDkiAdcGaUoDmB
	 Uhegdu0AAzaKaLooiM9DWt3XqMhcdNCmNs8OevsYsgHSHdN83BuWFfknEzuokh7ebb8/h
	 +1sAkmiZsgjPTjd2e2852RCPO2RAsCsi0XO9Co6iu7fwVyd40ExehA5VoEGMFp4m32dH4
	 zq8KlSOM1XHey4F0QAzNK+j9FtiBjNUNQRlWIyOmEWfZhJbBNIF3zbtgJUM082vFQQUHP
	 vZHeaHdScAzDQJwUfGjjBRAxaQbVXIizxQ9KBOL6DDZlzXtJKAxO0HWL/vHyGt2MXSQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796443273;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Received:
	 From:Date:Subject:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:Message-Id:References:
	 In-Reply-To:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:
	 X-Report-Abuse:Feedback-ID:X-smtpcorp-track;
	bh=dPGDBYotLe1rj8UWR7q7xd3vzP0auRPbSFL9xM2oA7I=;
	b=s1ri1jOPc3KzaQZ3sqcqZwlF0axWvhrrxY1u5jn7fiPE10oaeI3+QfCClWBmDxxPw1/i
	 T9zBojmvGohCOI4oNgUvFq9e2LntAYtZAPGpsd4oK9wudgpEh/gtBgEejFqQR6tmiEHS9
	 Wvgehvas8P6XC81HVpdiv/mbk8ZqO+MOgwx0c5oSwL/qQ5YLLbx9OV0eircDz3a6kDRTl
	 8LpR4DQ5TZASb+dAoySUfDRYh0iacufwUg46JXDqj0SAlPcgVNXROSH9upVFcprlJ16Ic
	 yyTK9ctqmjn4VNyUSK4u+ZKt4gzQnVhLiSV9JPQGvXbqWO+k+AAHhieBOAh0qyFasCQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=fail reason="signature verification failed" header.d=dilluti0n.com header.i=@dilluti0n.com header.a=rsa-sha256 header.s=s840244 header.b=QR+FgODI;
	dmarc=pass header.from=dilluti0n.com;
	spf=pass smtp.mailfrom=em840244.dilluti0n.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 119B7606A690;
	Sat,  5 Dec 2026 04:01:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=dilluti0n.com header.i=@dilluti0n.com header.a=rsa-sha256 header.s=s840244 header.b=QR+FgODI
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.71.231
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796443272;
	b=tA4c5oqlcACEjCORcbAM78et20pHyzoK57aNMPPTjsMYQdIL7MR8j7Hdl5FdEBQSvbtz
	 OxmPiU2B+SZ1O33KhPKbp+gybfF6Y4j88HD0K+R3WuTOcBdcyYR29P14i93Vvo3kKGm8N
	 3lYbyDV+mv4IPWgJJDRXMou32zvj+PYbdQbj76KzZpMqF2G/YmlmPASIovCn3MG85B8rD
	 ZVO1rEy/sFhsmwLdWb0Hn7vh3RobG7npPG1ogVG45a9TacMYqkzaidrZR9YIeZzqZEr/5
	 FURU7AUbWFnxVk+4umUtsSyBDCeRjvKB3dl703KhBA3PC30mLo9lIIv1bw0AXd/EW9w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796443272;
	h=DMARC-Filter:DKIM-Signature:Received:Received:From:Date:Subject:
	 MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:
	 References:In-Reply-To:To:Cc:X-Mailer:X-Developer-Signature:
	 X-Developer-Key:X-Report-Abuse:Feedback-ID:X-smtpcorp-track;
	bh=dPGDBYotLe1rj8UWR7q7xd3vzP0auRPbSFL9xM2oA7I=;
	b=lV4H23zN1SnfOZ54W9t3OsA+2076L81xWX06ntRBnqbp4Y9lrmiLRsiqvEX4Stw/gh3B
	 RS4G0K2MyTIQZ9I6P/ulTuEk5k3cWOpBcy9m9TQDwvdg5L6iA3V3Yp6lswFQ9Vina1xq3
	 87Gi6I+EzjhwSJoqzN57yJNc0YZ2S8w5zQYegeiYJoPt7A4VmtsOC2dyV1b6DAWhji4jC
	 V7gcauBmMDmXIIBs8xe+R7NUrPnuZiY4QlDfimr4x1PWlHy9/+xKH/k7g3BUGjqUTsk0h
	 sNXp8HTsCo5iB4+AED38BV2lehYx4HqUajWEx94YwaCqFw5GEbttAoIn1n3ouKU1Xeg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=dilluti0n.com;
	spf=pass smtp.mailfrom=em840244.dilluti0n.com;
	dkim=pass header.d=dilluti0n.com header.i=@dilluti0n.com header.a=rsa-sha256 header.s=s840244 header.b=QR+FgODI;
	arc=none smtp.remote-ip=170.10.71.231
X-Received: from a5i231.smtp2go.com (a5i231.smtp2go.com [170.10.71.231])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0776606A687
	for <netdev@vger.kernel.org>; Sat,  5 Dec 2026 04:01:11 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B0776606A687
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dilluti0n.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=em840244.dilluti0n.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dilluti0n.com;
 i=@dilluti0n.com; q=dns/txt; s=s840244; t=1796443264; h=from : subject
 : to : message-id : date : list-unsubscribe : list-unsubscribe-post;
 bh=dPGDBYotLe1rj8UWR7q7xd3vzP0auRPbSFL9xM2oA7I=;
 b=QR+FgODIucVMlSM1q9RH3I2DsB5NsbajaGSiOuBT7ks0MM7Cu2aztx9yNEVaD5Sj/7LHC
 YUepvnmgPwSq1bXIdYaUGAzUIaQwx5yJbVYmaBxq85ET2wwu3aykjMKVaazZ8NYJG5IXFMt
 hxPdjqdkXz5NG/VrnskTkROjMkFcuUhiajDRC/qU0V4b1DWgx2Oi2ECdIikgAcR1e2l5Shp
 7rXl7zbRdIbiL05i+xZXoliN7tlEJCuf39qnGe7Z5YzYjTrZxrdeyZkON2N3nMGRihOvDxG
 WmRIZnBRsDcz+YXFmKvHKgnI7Z9ms0f+tC9j265dSW9DDKx70qxwkopQNGVQ==
X-Received: from [10.40.244.132] (helo=dilluti0n.com)
	by smtpcorp.com with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256:X25519)
	(Exim 4.100.1)
	(envelope-from <hskim@dilluti0n.com>)
	id 1xZgxJ-AIkwcC8maps-5sxd;
	Sat, 05 Dec 2026 04:01:01 +0000
X-Received: from localhost (<unknown> [10.42.0.2])
	by dilluti0n.com (OpenSMTPD) with ESMTP id a89061f0;
	Sat, 5 Dec 2026 04:00:49 +0000 (UTC)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261205-giga-lite-v2-0-5b84410edb9f@dilluti0n.com>
X-Cc: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, 
 Russell King <linux@armlinux.org.uk>, 
 "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, 
 Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, 
 Willem de Bruijn <willemb@google.com>, Simon Horman <horms@kernel.org>, 
 Maxime Chevallier <maxime.chevallier@bootlin.com>, 
 Daniel Golle <daniel@makrotopia.org>, nic_swsd@realtek.com, 
 Andrew Lunn <andrew+netdev@lunn.ch>, linux-kernel@vger.kernel.org, 
 javen <javen_xu@realsil.com.cn>, 
 Björn Töpel <bjorn@kernel.org>, 
 Hee-Suk Kim <hskim@dilluti0n.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=3408; i=hskim@dilluti0n.com;
 h=from:subject:message-id; bh=zAusn3Gl3ZcAI+1SqkNj+Q1w281Ra+KnaixH446F0qE=;
 b=owGbwMvMwCncbZ4x63W37CbG02pJDNnCPQVBUUVPtab+/PBrXseHDZnfE+oaNYsucz7J+c3mJ
 pvxLWFjx0YWBmFOBksxRZab/rP/p6t7n5uaPcMJZg4rE8gQaZEGBiBgYeDLTcwrNdIx0jPVNtQz
 BDJ0jBi4OAVgqve/ZKwPEF4QdN9c7M+Cj594XrmqveESN+gLf1TYVzfLeKem8eysT19uq77vNIi
 07zLa9ujQphuMNTz939kZtd5+OjC/5HHeE0uHi855YRL3b2/9qRZ3ruPevs0pprePH3OI1TrCOs
 Xujj0TFwA=
X-Developer-Key: i=hskim@dilluti0n.com; a=openpgp;
 fpr=3D4686CAC75A49A69E49692099A8DC6DA49AB13C
X-Report-Abuse: Please forward a copy of this message, including all headers, to <abuse-report@smtp2go.com>
X-Feedback-ID: 840244m:840244atORciv:840244swCEjBTVAG
X-smtpcorp-track: 3CyvcveAzv7I.fOi4MwXy7h_F.zaNA0AuYoq1