Skip to contentSkip to conversation

net: Add a layer for non-PHY MII time stamping drivers.

PATCH Superseded Richard Cochran 1 participant 1 message Oct 7, 2018

Subsystems (3)

v2 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 3/5 net: Add a layer for non-PHY MII time stamping drivers.

While PHY time stamping drivers can simply attach their interface directly to the PHY instance, stand alone drivers require support in order to manage their services. Non-PHY MII time stamping drivers have a control interface over another bus like I2C, SPI, UART, or via a memory mapped peripheral. The controller device will be associated with one or more time stamping channels, each of which sits snoops in on a MII bus.

This patch provides a glue layer that will enable time stamping channels to find their controlling device.

---
 drivers/net/phy/Makefile          |   2 +
 drivers/net/phy/mii_timestamper.c | 121 ++++++++++++++++++++++++++++++++++++++
 include/linux/mii_timestamper.h   |  63 ++++++++++++++++++++
 net/Kconfig                       |   7 ++-
 4 files changed, 190 insertions(+), 3 deletions(-)
 create mode 100644 drivers/net/phy/mii_timestamper.c
drivers/net/phy/Makefile +2 -0
index 5805c0b7d60e..584c7c6f40e7 100644
@@ -40,6 +40,8 @@ obj-$(CONFIG_MDIO_SUN4I)	+= mdio-sun4i.o
 obj-$(CONFIG_MDIO_THUNDER)	+= mdio-thunder.o
 obj-$(CONFIG_MDIO_XGENE)	+= mdio-xgene.o
 
+obj-$(CONFIG_NETWORK_PHY_TIMESTAMPING) += mii_timestamper.o
+
 obj-$(CONFIG_SFP)		+= sfp.o
 sfp-obj-$(CONFIG_SFP)		+= sfp-bus.o
 obj-y				+= $(sfp-obj-y) $(sfp-obj-m)
drivers/net/phy/mii_timestamper.c new file +121 -0

121 lines not on this page · raw message

include/linux/mii_timestamper.h +63 -0

79 lines not on this page · raw message

net/Kconfig +4 -3
index 228dfa382eec..49872c5f4165 100644
@@ -106,9 +106,10 @@ config NETWORK_PHY_TIMESTAMPING
 	bool "Timestamping in PHY devices"
 	select NET_PTP_CLASSIFY
 	help
-	  This allows timestamping of network packets by PHYs with
-	  hardware timestamping capabilities. This option adds some
-	  overhead in the transmit and receive paths.
+	  This allows timestamping of network packets by PHYs (or
+	  other MII bus snooping devices) with hardware timestamping
+	  capabilities. This option adds some overhead in the transmit
+	  and receive paths.
 
 	  If you are unsure how to answer this question, answer N.
 
Signature · 1 line
2.11.0