]> git.hungrycats.org Git - linux/commit
net: mdio: realtek-rtl9300: Add ports to info structure
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Thu, 21 May 2026 17:59:12 +0000 (19:59 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 26 May 2026 09:56:14 +0000 (11:56 +0200)
commit215701873a7ed1214bba82c8fadcd2583d0246c3
treec94ac1ba675c83b0345ed60aada6ac3e02b10efc
parent315a02b39e8c4d1e8aebc8c3cc1e14e193f116ae
net: mdio: realtek-rtl9300: Add ports to info structure

The ethernet MDIO controller in the Realtek Otto series has a very special
command register style. Instead of working with bus/address it works on
ethernet port numbers. For this the controller is initialized via mapping
registers that tell which port is mapped to which bus/address. Every
request to the driver is then converted as follows

1. Kernel calls driver with bus/address
2. Driver converts bus/address to port and issues command
3. Hardware maps port back to bus/address

The number of ports is different for each device. Make this configurable
by adding a property to the info structure. Switch the existing usage of
MAX_PORTS to this new property where needed.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://patch.msgid.link/20260521175918.1494797-4-markus.stockhausen@gmx.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/mdio/mdio-realtek-rtl9300.c