RFC r8169: separate r8168 driver and add experimental phylib support
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest18 patches 13 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | r8169: split driver to one for the non-PCIE cards (r8169) and one for the PCIE cards (r8168)drivers/ drivers/ drivers/ +1 more | +8749 | 0 replies | |
| 2/18 | r8168: remove code specific to MAC version 01 - 06drivers/ | +5 | 0 replies | |
| 3/18 | r8168: remove magic register handling used on MAC version 05 and 06 onlydrivers/ | +0 | 0 replies | |
| 4/18 | r8168: remove TBI mode support needed for MAC version 01 onlydrivers/ | +6 | 0 replies | |
| 5/18 | r8168: remove unneeded callbacks from struct rtl8169_privatedrivers/ | +16 | 0 replies | |
| 6/18 | r8168: remove function rtl8169_rx_missed() being specific to MAC version 01 - 06drivers/ | +0 | 0 replies | |
| 7/18 | r8168: replace 8169 with 8168 in all relevant symbolsdrivers/ | +533 | 0 replies | |
| 8/18 | r8168: add basic phylib supportdrivers/ drivers/ | +120 | 1 reply | |
| 9/18 | r8168: use genphy_soft_reset instead of open coding the soft resetdrivers/ | +1 | 2 replies | |
| 10/18 | r8168: switch to phy_ethtool_get/set_link_ksettingsdrivers/ | +3 | 1 reply | |
| 11/18 | r8168: switch to phy_ethtool_nway_resetdrivers/ drivers/ | +1 | 1 reply | |
| 12/18 | r8168: switch to phy_mii_ioctldrivers/ | +3 | 2 replies | |
| 13/18 | r8168: replace speed_down with genphy_restart_anegdrivers/ | +1 | 2 replies | |
| 14/18 | r8168: remove rtl8168_set_speeddrivers/ | +0 | 0 replies | |
| 15/18 | r8168: remove rtl_phy_work and rtl8168_phy_timerdrivers/ | +0 | 0 replies | |
| 16/18 | r8168: use phy_read/write in rtl_readphy/writephy helpersdrivers/ | +2 | 0 replies | |
| 17/18 | r8168: remove use of struct mii_if_infodrivers/ | +7 | 1 reply | |
| 18/18 | r8168: use link speed information as maintained by phylibdrivers/ | +5 | 1 reply |
Reviews trailers per patch
3 of 18 patches have a Reviewed-by or Acked-by.
| Patch | Andrew Lunn |
|---|---|
| 1/18 | |
| 2/18 | |
| 3/18 | |
| 4/18 | |
| 5/18 | |
| 6/18 | |
| 7/18 | |
| 8/18 | |
| 9/18 | |
| 10/18 | R-b |
| 11/18 | R-b |
| 12/18 | |
| 13/18 | |
| 14/18 | |
| 15/18 | |
| 16/18 | |
| 17/18 | |
| 18/18 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH RFC 00/18] r8169: separate r8168 driver and add experimental phylib support
This experimental series separates drivers for PCI / PCIE NIC's and adds initial phylib support to the separated r8168 driver.
There are significant differences between the older PCI-based chips (MAC version <= 6) and the newer PCIE-based chips, e.g. the older chips partially support a not MII-compatible TBI fibre mode. Adding phylib support is much easier focusing on the newer chips only. I think separating the drivers is justified and would be interested to hear the opinion of others.
The series works fine on my Zotac Mini-PC with a RTL8168evl (MAC version 34), see also system log (grepped for r8168).
r8168 Gigabit Ethernet driver 2.3LK-NAPI loaded
r8168 0000:03:00.0: enabling device (0000 -> 0003)
libphy: r8168: probed
RTL8211E Gigabit Ethernet r8168-03:00.0:00: attached PHY driver [RTL8211E Gigabit Ethernet] (mii_bus:phy_addr=r8168-03:00.0:00, irq=IGNORE) r8168 0000:03:00.0 eth0: RTL8168evl/8111evl at 0x0000000069abeaff, 00:01:2e:65:37:46, XID 0c900800 IRQ 50
r8168 0000:03:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
r8168 Gigabit Ethernet driver 2.3LK-NAPI loaded
r8168 0000:04:00.0: enabling device (0000 -> 0003)
libphy: r8168: probed
RTL8211E Gigabit Ethernet r8168-04:00.0:00: attached PHY driver [RTL8211E Gigabit Ethernet] (mii_bus:phy_addr=r8168-04:00.0:00, irq=IGNORE) r8168 0000:04:00.0 eth1: RTL8168evl/8111evl at 0x00000000841e72a7, 00:01:2e:65:37:47, XID 0c900800 IRQ 51
r8168 0000:04:00.0 eth1: jumbo features [frames: 9200 bytes, tx checksumming: ko]
r8168 0000:04:00.0 enp4s0: renamed from eth1
r8168 0000:03:00.0 enp3s0: renamed from eth0
r8168 0000:04:00.0 enp4s0: Link is Down
r8168 0000:04:00.0 enp4s0: Link is Up - 1Gbps/Full - flow control rx/tx
What's still missing:
- Remove all support for chips with MAC version > 06 from r8169 driver. This would drastically reduce its size.
- The driver loads firmware for the PHY, therefore we may need firmware loading support also for the Realtek driver under drivers/net/phy. Best should be to factor out firmware loading support into a separate driver under drivers/firmware.
I have a working experimental version, but it's still WIP.
- Support all NIC-internal PHY's by the Realtek driver under drivers/net/phy and move all PHY init code there.
To do this we'd need a list with the PHY id per chip / MAC version. Just by chance the PHY in RTL8168evl identifies as RTL8211E and has certain support already (w/o firmware).
Heiner Kallweit (18):
r8169: split driver to one for the non-PCIE cards (r8169) and one for the PCIE cards (r8168)
r8168: remove code specific to MAC version 01 - 06
r8168: remove magic register handling used on MAC version 05 and 06 only
r8168: remove TBI mode support needed for MAC version 01 only
r8168: remove unneeded callbacks from struct rtl8169_private
r8168: remove function rtl8169_rx_missed() being specific to MAC version 01 - 06
r8168: replace 8169 with 8168 in all relevant symbols
r8168: add basic phylib support
r8168: use genphy_soft_reset instead of open coding the soft reset
r8168: switch to phy_ethtool_get/set_link_ksettings
r8168: switch to phy_ethtool_nway_reset
r8168: switch to phy_mii_ioctl
r8168: replace speed_down with genphy_restart_aneg
r8168: remove rtl8168_set_speed
r8168: remove rtl_phy_work and rtl8168_phy_timer
r8168: use phy_read/write in rtl_readphy/writephy helpers
r8168: remove use of struct mii_if_info
r8168: use link speed information as maintained by phylib
drivers/net/ethernet/realtek/Kconfig | 20 +- drivers/net/ethernet/realtek/Makefile | 1 + drivers/net/ethernet/realtek/r8168.c | 8053 +++++++++++++++++++++++++++++++++ drivers/net/ethernet/realtek/r8169.c | 112 +- 4 files changed, 8077 insertions(+), 109 deletions(-) create mode 100644 drivers/net/ethernet/realtek/r8168.c
Signature · 1 line
2.15.1