Thread (20 messages) 20 messages, 3 authors, 2026-04-10

Re: [PATCH net-next 1/9] r8152: Add support for RTL8157 RX/TX descriptor format

From: Birger Koblitz <hidden>
Date: 2026-03-17 05:04:37
Also in: linux-usb, lkml

On 17/03/2026 1:51 am, Jakub Kicinski wrote:
On Sat, 14 Mar 2026 10:31:37 +0100 Birger Koblitz wrote:
quoted
The RTL8157 uses a different packet descriptor format compared to the
previous generation of chips. Add support for this format by adding a
descriptor format structure into the r8152 structure and corresponding
desc_ops functions which abstract the vlan-tag, tx/rx len and
tx/rx checksum algorithms.

Adapt the previous functions for the first chip generation to support
abstraction and add additional functions for the second generation.

Replace all calls to the descriptor functions with abstracted functions.
drivers/net/usb/r8152.c:9646:12: warning: unused function 'r8157_desc_init' [-Wunused-function]
  9646 | static int r8157_desc_init(struct r8152 *tp)
       |            ^~~~~~~~~~~~~~~
This function sets up the V2 packet descriptor of the RTL8157 (the 
RTL8159 uses the same). It sets up the function pointers for working 
with the new descriptor format, such as the new checksum algorithms 
r8157_rx_vlan_tag / r8157_rx_csum and getter/setter functions for the 
packet length. r8157_desc_init is only used in the final part of the 
patch series when the RTL8157 is initialized. If this function is moved 
into that final part, all the functions it itself references will also 
become unused and need to be moved into the final part of the patch 
series. Having only the new descriptor structure without the functions 
that work on it would make it very difficult for humans to understand 
what the differences in the descriptors are, and also the abstraction of 
the functions working with the V1 structure would not make sense. It 
would also mean that all functions used only by the RTL8157 will become 
part of this last part of the patch-series, making it huge and difficult 
to understand. Basically, the patch series would be reduced to small 
initial patches where new registers are defined and a large last part, 
where all the new functionality is added in one big patch.

I would prefer to have individual patches in the series adding support 
for the new functionality of the RTL8157 in parts that also allow 
developers to understand the differences, even if this functionality is 
used only in the last part of the series.

Birger
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help