aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-02-14 14:33:38 -0500
committerDavid S. Miller <davem@davemloft.net>2018-02-14 14:33:38 -0500
commit64da58528bdbdba171cf6c6ffaf39c2ee75e3a10 (patch)
treed779fcb16a984e9c1070269050d885c2d73ce120 /include/net/dsa.h
parente0f9759f530bf789e984961dce79f525b151ecf3 (diff)
parenta2e47134e577713add97124afd812bc3f93627fb (diff)
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/net/dsa.h')
-rw-r--r--include/net/dsa.h20
1 files changed, 20 insertions, 0 deletions
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 @@
19#include <linux/workqueue.h> 19#include <linux/workqueue.h>
20#include <linux/of.h> 20#include <linux/of.h>
21#include <linux/ethtool.h> 21#include <linux/ethtool.h>
22#include <linux/net_tstamp.h>
22#include <net/devlink.h> 23#include <net/devlink.h>
23#include <net/switchdev.h> 24#include <net/switchdev.h>
24 25
@@ -101,6 +102,7 @@ struct dsa_platform_data {
101}; 102};
102 103
103struct packet_type; 104struct packet_type;
105struct dsa_switch;
104 106
105struct dsa_device_ops { 107struct dsa_device_ops {
106 struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev); 108 struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev);
@@ -368,6 +370,12 @@ struct dsa_switch_ops {
368 struct ethtool_wolinfo *w); 370 struct ethtool_wolinfo *w);
369 371
370 /* 372 /*
373 * ethtool timestamp info
374 */
375 int (*get_ts_info)(struct dsa_switch *ds, int port,
376 struct ethtool_ts_info *ts);
377
378 /*
371 * Suspend and resume 379 * Suspend and resume
372 */ 380 */
373 int (*suspend)(struct dsa_switch *ds); 381 int (*suspend)(struct dsa_switch *ds);
@@ -469,6 +477,18 @@ struct dsa_switch_ops {
469 int port, struct net_device *br); 477 int port, struct net_device *br);
470 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int sw_index, 478 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int sw_index,
471 int port, struct net_device *br); 479 int port, struct net_device *br);
480
481 /*
482 * PTP functionality
483 */
484 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
485 struct ifreq *ifr);
486 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
487 struct ifreq *ifr);
488 bool (*port_txtstamp)(struct dsa_switch *ds, int port,
489 struct sk_buff *clone, unsigned int type);
490 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
491 struct sk_buff *skb, unsigned int type);
472}; 492};
473 493
474struct dsa_switch_driver { 494struct dsa_switch_driver {