diff options
author | David S. Miller <davem@davemloft.net> | 2018-02-14 20:33:38 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-14 20:33:38 +0100 |
commit | 64da58528bdbdba171cf6c6ffaf39c2ee75e3a10 (patch) | |
tree | d779fcb16a984e9c1070269050d885c2d73ce120 /include | |
parent | tcp: try to keep packet if SYN_RCV race is lost (diff) | |
parent | net: dsa: mv88e6xxx: add workaround for 6341 timestamping (diff) | |
download | linux-64da58528bdbdba171cf6c6ffaf39c2ee75e3a10.tar.xz linux-64da58528bdbdba171cf6c6ffaf39c2ee75e3a10.zip |
Merge branch 'PTP-support-for-DSA-and-mv88e6xxx-driver'
Andrew Lunn says:
====================
PTP support for DSA and mv88e6xxx driver.
This patchset adds support for using the PTP hardware in switches
supported by the mv88e6xxx driver. The code was produces in
collaboration with Brandon Streiff doing the initial implementation,
and then Richard Cochran and Andrew Lunn making further changes and
cleanups.
The code is sufficient to use ptp4l on a single DSA interface, either
as a master or a slave. Due to the use of an MDIO bus to access the
switch, reading hardware timestamps is slower than what ptp4l
expects. Thus it is necessary to use the option
--tx_timestamp_timeout=32. Heavy use of ethtool -S, or bridge fdb show
can also upset ptp4l. Patches to address this will follow.
Further work is requires to support bridges using Boundary Clock or
Transparent Clock mode.
Since the RFC, an overflow bug has been fixed. Brandon Streiff
has also Acked-by: the updates to his initial patchset.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ptp_classify.h | 4 | ||||
-rw-r--r-- | include/net/dsa.h | 20 |
2 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h index a079656b614c..059242030631 100644 --- a/include/linux/ptp_classify.h +++ b/include/linux/ptp_classify.h @@ -75,5 +75,9 @@ void __init ptp_classifier_init(void); static inline void ptp_classifier_init(void) { } +static inline unsigned int ptp_classify_raw(struct sk_buff *skb) +{ + return PTP_CLASS_NONE; +} #endif #endif /* _PTP_CLASSIFY_H_ */ diff --git a/include/net/dsa.h b/include/net/dsa.h index 6cb602dd970c..0ad17b63684d 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -19,6 +19,7 @@ #include <linux/workqueue.h> #include <linux/of.h> #include <linux/ethtool.h> +#include <linux/net_tstamp.h> #include <net/devlink.h> #include <net/switchdev.h> @@ -101,6 +102,7 @@ struct dsa_platform_data { }; struct packet_type; +struct dsa_switch; struct dsa_device_ops { struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev); @@ -368,6 +370,12 @@ struct dsa_switch_ops { struct ethtool_wolinfo *w); /* + * ethtool timestamp info + */ + int (*get_ts_info)(struct dsa_switch *ds, int port, + struct ethtool_ts_info *ts); + + /* * Suspend and resume */ int (*suspend)(struct dsa_switch *ds); @@ -469,6 +477,18 @@ struct dsa_switch_ops { int port, struct net_device *br); void (*crosschip_bridge_leave)(struct dsa_switch *ds, int sw_index, int port, struct net_device *br); + + /* + * PTP functionality + */ + int (*port_hwtstamp_get)(struct dsa_switch *ds, int port, + struct ifreq *ifr); + int (*port_hwtstamp_set)(struct dsa_switch *ds, int port, + struct ifreq *ifr); + bool (*port_txtstamp)(struct dsa_switch *ds, int port, + struct sk_buff *clone, unsigned int type); + bool (*port_rxtstamp)(struct dsa_switch *ds, int port, + struct sk_buff *skb, unsigned int type); }; struct dsa_switch_driver { |