* [PATCH net] r8169: give RTL_GIGA_MAC_VER_EXTENDED a distinct value
@ 2026-08-08 10:19 Karl Mehltretter
0 siblings, 0 replies; only message in thread
From: Karl Mehltretter @ 2026-08-08 10:19 UTC (permalink / raw)
To: Heiner Kallweit, nic_swsd
Cc: Karl Mehltretter, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Javen Xu, netdev,
linux-kernel, stable
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")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-fable-5
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
drivers/net/ethernet/realtek/r8169.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/realtek/r8169.h b/drivers/net/ethernet/realtek/r8169.h
index 0b9c1d4eb48ba..fb772cc043105 100644
--- a/drivers/net/ethernet/realtek/r8169.h
+++ b/drivers/net/ethernet/realtek/r8169.h
@@ -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;
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-08 10:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-08 10:19 [PATCH net] r8169: give RTL_GIGA_MAC_VER_EXTENDED a distinct value Karl Mehltretter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox