On 2017-11-06 01:19, Linus Walleij wrote:
This adds a driver core for the Realtek SMI chips and a subdriver
for the RTL8366RB. I just added this chip simply because it is
all I can test.
The code is a massaged variant of the code that has been sitting
out-of-tree in OpenWRT for years in the absence of a proper switch
subsystem. I have tried to credit the original authors wherever
possible.
The main changes I've done from the OpenWRT code:
- Added a callback to set the MAC address.
- Added an IRQ chip inside the RTL8366RB switch to demux and
handle the line state IRQs.
- Distributed the phy handling out to the PHY driver.
- Added some RTL8366RB code that was missing in the driver,
such as setting up "green ethernet" with a funny jam table
and forcing MAC5 (the CPU port) into 1 GBit.
Although it could be a good thing to bring this to mainline, I'm kind of
pessimistic about supporting such switches in DSA/switchdev. IMO
swconfig does a better job for now.
Unless switchdev could be expanded to support other functions beyond
VLAN, like port rate control, ACL, HW NAT (no switchdev L3 offload
doesn't fit this), etc.
Or at least provide some centralized API for others, like [1].
Or maybe I overlooked something and it can be done already?
Regards,
Roman
Links:
[1] https://marc.info/?l=linux-netdev&m=150972281109740