Skip to contentSkip to conversation

r8169: give RTL_GIGA_MAC_VER_EXTENDED a distinct value

PATCH Applied Karl Mehltretter 2 participants 2 messages Aug 8 – Aug 13

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 r8169: give RTL_GIGA_MAC_VER_EXTENDED a distinct value

RTL_GIGA_MAC_VER_EXTENDED implicitly follows RTL_GIGA_MAC_VER_LAST = RTL_GIGA_MAC_NONE - 1, so it has the same value as RTL_GIGA_MAC_NONE.

rtl_init_one() therefore sends unknown chips through extended detection. If TX_CONFIG_V2 reads as zero, they are misidentified as RTL9151AS instead of being rejected.

Give RTL_GIGA_MAC_VER_EXTENDED a distinct value. It is only a detection marker and is never stored in tp->mac_version.

Found by Clang's -Wduplicate-enum and verified with a QEMU stub.

Fixes 5e3c5a2b85da9 ("r8169: add support for extended chip version id and RTL9151AS")
Assisted-by Claude:claude-fable-5
---
 drivers/net/ethernet/realtek/r8169.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/realtek/r8169.h +1 -1
index 0b9c1d4eb48ba..fb772cc043105 100644
@@ -74,7 +74,7 @@ enum mac_version {
 	RTL_GIGA_MAC_VER_80,
 	RTL_GIGA_MAC_NONE,
 	RTL_GIGA_MAC_VER_LAST = RTL_GIGA_MAC_NONE - 1,
-	RTL_GIGA_MAC_VER_EXTENDED
+	RTL_GIGA_MAC_VER_EXTENDED = RTL_GIGA_MAC_NONE + 1
 };
 
 struct rtl8169_private;
Signature · 1 line
2.53.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Sat, 8 Aug 2026 12:19:41 +0200 you wrote:

RTL_GIGA_MAC_VER_EXTENDED implicitly follows RTL_GIGA_MAC_VER_LAST = RTL_GIGA_MAC_NONE - 1, so it has the same value as RTL_GIGA_MAC_NONE.

rtl_init_one() therefore sends unknown chips through extended detection. If TX_CONFIG_V2 reads as zero, they are misidentified as RTL9151AS instead of being rejected.

[...]

Here is the summary with links:
- [net] r8169: give RTL_GIGA_MAC_VER_EXTENDED a distinct value

    https://git.kernel.org/netdev/net-next/c/d77f3f016826

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html