drivers/net/usb/r8152.c | 1029 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 827 insertions(+), 202 deletions(-)
Add support for the RTL8157, which is a 5GBit USB-Ethernet adapter
chip in the RTL815x family of chips.
The RTL8157 uses a different frame descriptor format, and different
SRAM/ADV access methods, plus offers 5GBit/s Ethernet, so support for these
features is added in addition to chip initialization and configuration.
The module was tested with an OEM RTL8157 USB adapter:
[25758.328238] usb 4-1: new SuperSpeed Plus Gen 2x1 USB device number 2 using xhci_hcd
[25758.345565] usb 4-1: New USB device found, idVendor=0bda, idProduct=8157, bcdDevice=30.00
[25758.345585] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=7
[25758.345593] usb 4-1: Product: USB 10/100/1G/2.5G/5G LAN
[25758.345599] usb 4-1: Manufacturer: Realtek
[25758.345605] usb 4-1: SerialNumber: 000300E04C68xxxx
[25758.534241] r8152-cfgselector 4-1: reset SuperSpeed Plus Gen 2x1 USB device number 2 using xhci_hcd
[25758.603511] r8152 4-1:1.0: skip request firmware
[25758.653351] r8152 4-1:1.0 eth0: v1.12.13
[25758.689271] r8152 4-1:1.0 enx00e04c68xxxx: renamed from eth0
[25763.271682] r8152 4-1:1.0 enx00e04c68xxxx: carrier on
The RTL8157 adapter was tested against an AQC107 PCIe-card supporting
10GBit/s and an RTL8126 5Gbit PCIe-card supporting 5GBit/s for
performance, link speed and EEE negotiation. Using USB3.2 Gen 1 with
the RTL8157 USB adapter and running iperf3 against the AQC107 PCIe
card resulted in 3.47 Gbits/sec, whereas using USB3.2 Gen2 resulted
in 4.70 Gbits/sec, speeds against the RTL8126-card were the same.
As the code integrates the RTL8157-specific code with existing RTL8156 code
in order to improve code maintainability (instead of adding RTL8157-specific
functions duplicaing most of the RTL8156 code), regression tests were done
with an Edimax EU-4307 V1.0 USB-Ethernet adapter with RTL8156.
The code is based on the out-of-tree r8152 driver published by Realtek under
the GPL.
This patch is on top of linux-next as the code re-uses the 2.5 Gbit EEE
recently added in r8152.c.
Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
---
Changes in v6:
- Rebased to net-next
- Fixed typos: ocp_10bt -> ocp_10gbt
- Link to v5: https://lore.kernel.org/r/20260331-rtl8157_next-v5-0-deb3095f8380@birger-koblitz.de
Changes in v5:
- Filter advertising in rtl8152_set_speed() to prevent incorrect speeds
- Prevent double USB transfers in rtl8152_get_link_ksettings()
- Make sure OCP_EEE_ADV2 and OCP_EEE_LPABLE2 are read if a device
supports 5GBit but not 2.5Gbit
- Fix rtl8157_runtime_enable() to follow the behavior of
rtl8156_runtime_enable()
- Prevent call to r8153_u2p3en in rtl8156_up() for RTL8157
- Fix rtl8157_unload() to disable interrupt mitigation
- Link to v4: https://lore.kernel.org/r/20260324-rtl8157_next-v4-0-034312b12de5@birger-koblitz.de
Changes in v4:
- Fix return type of ocp_adv_read()
- In r8152_tx_csum() use tx_desc
- Use TCPHO_MAX_2 for RTL8157 in rtl8152_features_check()
- Include RTL_VER_12 in RTL8156B chip versions in rtl8156_init()
- Remove inline keyword from rx_agg_align and tx_agg_align
- Link to v3: https://lore.kernel.org/r/20260320-rtl8157_next-v3-0-1aefeca7fda7@birger-koblitz.de
Changes in v3:
- Apply reverse Christmas tree order for declarations
- Use poll_timeout_us for register polling
- In rtl8156_enable(), fix version comparison: tp->version >= RTL_VER_16
- Correct error handling of r8153_phy_status in r8157_hw_phy_cfg()
- Fix use of ocp_word_clr_bits for PLA_MCU_SPDWN_EN register
- Link to v2: https://lore.kernel.org/r/20260317-rtl8157_next-v2-0-10ea1fa488d1@birger-koblitz.de
Changes in v2:
- Fixed missing initialization of ret value in wait_cmd_ready()
- Combine all parts with RTL8157-specific code to avoid undefined functions
- Link to v1: https://lore.kernel.org/r/20260314-rtl8157_next-v1-0-9ba77b428afd@birger-koblitz.de
---
Birger Koblitz (2):
r8152: Add support for 5Gbit Link Speeds and EEE
r8152: Add support for the RTL8157 hardware
drivers/net/usb/r8152.c | 1029 +++++++++++++++++++++++++++++++++++++----------
1 file changed, 827 insertions(+), 202 deletions(-)
---
base-commit: cee10a01e286e88e0949979e91231270ca9fdb8e
change-id: 20260314-rtl8157_next-ae18683eb4fa
Best regards,
--
Birger Koblitz <mail@birger-koblitz.de>
On Thu, 02 Apr 2026 10:28:12 +0200 Birger Koblitz wrote: > Add support for the RTL8157, which is a 5GBit USB-Ethernet adapter > chip in the RTL815x family of chips. no longer applies, please rebase & repost -- pw-bot: cr
On 04/04/2026 01:06, Jakub Kicinski wrote: > On Thu, 02 Apr 2026 10:28:12 +0200 Birger Koblitz wrote: >> Add support for the RTL8157, which is a 5GBit USB-Ethernet adapter >> chip in the RTL815x family of chips. > > no longer applies, please rebase & repost It looks like you are letting me play out the story of the hare and the hedgehog. If there is no interest in this patch series or you would like it to look different, please let me know instead of playing games. Birger
On Sat, Apr 04, 2026 at 05:54:43AM +0200, Birger Koblitz wrote: > On 04/04/2026 01:06, Jakub Kicinski wrote: > > On Thu, 02 Apr 2026 10:28:12 +0200 Birger Koblitz wrote: > > > Add support for the RTL8157, which is a 5GBit USB-Ethernet adapter > > > chip in the RTL815x family of chips. > > > > no longer applies, please rebase & repost > It looks like you are letting me play out the story of the hare and the > hedgehog. If there is no interest in this patch series or you would like > it to look different, please let me know instead of playing games. "Does not apply" is not a game, you just need to rebase and resubmit as others are also doing work on the same driver at the same time, so there can be some conflicts that it is up to the submitter to resolve. This is normal kernel development, has always been this way. thanks, greg k-h
On 04/04/2026 08:27, Greg KH wrote: > On Sat, Apr 04, 2026 at 05:54:43AM +0200, Birger Koblitz wrote: >> On 04/04/2026 01:06, Jakub Kicinski wrote: >>> On Thu, 02 Apr 2026 10:28:12 +0200 Birger Koblitz wrote: >>>> Add support for the RTL8157, which is a 5GBit USB-Ethernet adapter >>>> chip in the RTL815x family of chips. >>> >>> no longer applies, please rebase & repost >> It looks like you are letting me play out the story of the hare and the >> hedgehog. If there is no interest in this patch series or you would like >> it to look different, please let me know instead of playing games. > > "Does not apply" is not a game, you just need to rebase and resubmit as > others are also doing work on the same driver at the same time, so there > can be some conflicts that it is up to the submitter to resolve. > > This is normal kernel development, has always been this way. > Thanks for the feedback, Greg! the underlying issue is that parts of the patch I submitted are now also submitted by others, and that gets fast-tracked. This has now happened twice, and I am being told every time to re-submit, without efforts to coordinate this, or hints that this pattern may stop. This has somewhat made me loose trust in the process. I'll nevertheless rebase and resend, and see what happens next. Birger
> Thanks for the feedback, Greg!
> the underlying issue is that parts of the patch I submitted are now also
> submitted by others, and that gets fast-tracked. This has now happened twice,
> and I am being told every time to re-submit, without efforts to coordinate
> this, or hints that this pattern may stop. This has somewhat made me loose
> trust in the process.
It is somewhat on you to coordinate with others working on the same
driver.
As is often said, Maintainers are overloaded, and push whatever they
can onto developers. It should not need a Maintainer to get developers
to coordinate, they should be able to do that on there own. Since you
are subscribed to the netdev list, you can see the patches flying by,
you know who else is working on this driver. Please go talk to them.
Andrew
© 2016 - 2026 Red Hat, Inc.