netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 00/18] r8169: separate r8168 driver and add experimental phylib support
@ 2017-12-21 20:38 Heiner Kallweit
  2017-12-21 20:50 ` [PATCH RFC 01/18] r8169: split driver to one for the non-PCIE cards (r8169) and one for the PCIE cards (r8168) Heiner Kallweit
                   ` (18 more replies)
  0 siblings, 19 replies; 32+ messages in thread
From: Heiner Kallweit @ 2017-12-21 20:38 UTC (permalink / raw)
  To: Andrew Lunn, Realtek linux nic maintainers, Chun-Hao Lin
  Cc: David Miller, netdev@vger.kernel.org

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

-- 
2.15.1

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2017-12-22 23:36 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-21 20:38 [PATCH RFC 00/18] r8169: separate r8168 driver and add experimental phylib support Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 01/18] r8169: split driver to one for the non-PCIE cards (r8169) and one for the PCIE cards (r8168) Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 02/18] r8168: remove code specific to MAC version 01 - 06 Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 03/18] r8168: remove magic register handling used on MAC version 05 and 06 only Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 04/18] r8168: remove TBI mode support needed for MAC version 01 only Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 05/18] r8168: remove unneeded callbacks from struct rtl8169_private Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 06/18] r8168: remove function rtl8169_rx_missed() being specific to MAC version 01 - 06 Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 07/18] r8168: replace 8169 with 8168 in all relevant symbols Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 08/18] r8168: add basic phylib support Heiner Kallweit
2017-12-22  9:44   ` Andrew Lunn
2017-12-21 20:50 ` [PATCH RFC 09/18] r8168: use genphy_soft_reset instead of open coding the soft reset Heiner Kallweit
2017-12-22  9:57   ` Andrew Lunn
2017-12-22 22:19     ` Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 10/18] r8168: switch to phy_ethtool_get/set_link_ksettings Heiner Kallweit
2017-12-22  9:57   ` Andrew Lunn
2017-12-21 20:50 ` [PATCH RFC 11/18] r8168: switch to phy_ethtool_nway_reset Heiner Kallweit
2017-12-22  9:58   ` Andrew Lunn
2017-12-21 20:50 ` [PATCH RFC 12/18] r8168: switch to phy_mii_ioctl Heiner Kallweit
2017-12-22 10:00   ` Andrew Lunn
2017-12-22 23:01     ` Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 13/18] r8168: replace speed_down with genphy_restart_aneg Heiner Kallweit
2017-12-22 10:14   ` Andrew Lunn
2017-12-22 23:36     ` Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 14/18] r8168: remove rtl8168_set_speed Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 15/18] r8168: remove rtl_phy_work and rtl8168_phy_timer Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 16/18] r8168: use phy_read/write in rtl_readphy/writephy helpers Heiner Kallweit
2017-12-21 20:50 ` [PATCH RFC 17/18] r8168: remove use of struct mii_if_info Heiner Kallweit
2017-12-22 10:21   ` Andrew Lunn
2017-12-21 20:50 ` [PATCH RFC 18/18] r8168: use link speed information as maintained by phylib Heiner Kallweit
2017-12-22 10:22   ` Andrew Lunn
2017-12-21 21:16 ` [PATCH RFC 00/18] r8169: separate r8168 driver and add experimental phylib support David Miller
2017-12-21 21:27   ` Heiner Kallweit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).