diff options
author | Vladimir Oltean <olteanv@gmail.com> | 2019-06-08 15:04:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-08 15:20:40 -0700 |
commit | a602afd200f557a5cc67dd5e7fa8ad5bfa5c98f8 (patch) | |
tree | 922c5361cc97f138f9f23729d828a77eb9a9face /drivers/net/dsa/sja1105/sja1105_ptp.c | |
parent | net: dsa: sja1105: Add a state machine for RX timestamping (diff) | |
download | linux-dev-a602afd200f557a5cc67dd5e7fa8ad5bfa5c98f8.tar.xz linux-dev-a602afd200f557a5cc67dd5e7fa8ad5bfa5c98f8.zip |
net: dsa: sja1105: Expose PTP timestamping ioctls to userspace
This enables the PTP support towards userspace applications such as
linuxptp.
The switches can timestamp only trapped multicast MAC frames, and
therefore only the profiles of 1588 over L2 are supported.
TX timestamping can be enabled per port, but RX timestamping is enabled
globally. As long as RX timestamping is enabled, the switch will emit
metadata follow-up frames that will be processed by the tagger. It may
be a problem that linuxptp does not restore the RX timestamping settings
when exiting.
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/sja1105/sja1105_ptp.c')
-rw-r--r-- | drivers/net/dsa/sja1105/sja1105_ptp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/dsa/sja1105/sja1105_ptp.c b/drivers/net/dsa/sja1105/sja1105_ptp.c index 01ecc8fb1b30..3041cf9d5856 100644 --- a/drivers/net/dsa/sja1105/sja1105_ptp.c +++ b/drivers/net/dsa/sja1105/sja1105_ptp.c @@ -70,8 +70,10 @@ int sja1105_get_ts_info(struct dsa_switch *ds, int port, info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE | SOF_TIMESTAMPING_RX_HARDWARE | SOF_TIMESTAMPING_RAW_HARDWARE; - info->tx_types = (1 << HWTSTAMP_TX_OFF); - info->rx_filters = (1 << HWTSTAMP_FILTER_NONE); + info->tx_types = (1 << HWTSTAMP_TX_OFF) | + (1 << HWTSTAMP_TX_ON); + info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) | + (1 << HWTSTAMP_FILTER_PTP_V2_L2_EVENT); info->phc_index = ptp_clock_index(priv->clock); return 0; } |