diff options
author | Vladimir Oltean | 2019-06-08 14:04:35 +0200 |
---|---|---|
committer | David S. Miller | 2019-06-09 00:20:40 +0200 |
commit | 47ed985e97f513b7746270e8c5d1f3a3f959b2da (patch) | |
tree | c70af72c3b2ca53b3f97d1f124d159b5c79ae8a1 /drivers/net/dsa/sja1105/sja1105.h | |
parent | net: dsa: sja1105: Add support for the PTP clock (diff) | |
download | kernel-qcow2-linux-47ed985e97f513b7746270e8c5d1f3a3f959b2da.tar.gz kernel-qcow2-linux-47ed985e97f513b7746270e8c5d1f3a3f959b2da.tar.xz kernel-qcow2-linux-47ed985e97f513b7746270e8c5d1f3a3f959b2da.zip |
net: dsa: sja1105: Add logic for TX timestamping
On TX, timestamping is performed synchronously from the
port_deferred_xmit worker thread.
In management routes, the switch is requested to take egress timestamps
(again partial), which are reconstructed and appended to a clone of the
skb that was just sent. The cloning is done by DSA and we retrieve the
pointer from the structure that DSA keeps in skb->cb.
Then these clones are enqueued to the socket's error queue for
application-level processing.
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.h')
-rw-r--r-- | drivers/net/dsa/sja1105/sja1105.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/dsa/sja1105/sja1105.h b/drivers/net/dsa/sja1105/sja1105.h index 3c6296203c21..5a4f83a3417b 100644 --- a/drivers/net/dsa/sja1105/sja1105.h +++ b/drivers/net/dsa/sja1105/sja1105.h @@ -33,6 +33,7 @@ struct sja1105_regs { u64 ptpclk; u64 ptpclkrate; u64 ptptsclk; + u64 ptpegr_ts[SJA1105_NUM_PORTS]; u64 pad_mii_tx[SJA1105_NUM_PORTS]; u64 cgu_idiv[SJA1105_NUM_PORTS]; u64 rgmii_pad_mii_tx[SJA1105_NUM_PORTS]; @@ -56,6 +57,15 @@ struct sja1105_info { * switch core and device_id) */ u64 part_no; + /* E/T and P/Q/R/S have partial timestamps of different sizes. + * They must be reconstructed on both families anyway to get the full + * 64-bit values back. + */ + int ptp_ts_bits; + /* Also SPI commands are of different sizes to retrieve + * the egress timestamps. + */ + int ptpegr_ts_bytes; const struct sja1105_dynamic_table_ops *dyn_ops; const struct sja1105_table_ops *static_ops; const struct sja1105_regs *regs; |