r8169: give RTL_GIGA_MAC_VER_EXTENDED a distinct value
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.
--- drivers/net/ethernet/realtek/r8169.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/realtek/r8169.h +1 -1
@@ -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
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_EXTENDEDimplicitly followsRTL_GIGA_MAC_VER_LAST=RTL_GIGA_MAC_NONE- 1, so it has the same value asRTL_GIGA_MAC_NONE.
rtl_init_one()therefore sends unknown chips through extended detection. IfTX_CONFIG_V2reads 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