mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
ptp: Request cycles for TX timestamp
The free running cycle counter of physical clocks called cycles shall be used for hardware timestamps to enable synchronisation. Introduce new flag SKBTX_HW_TSTAMP_USE_CYCLES, which signals driver to provide a TX timestamp based on cycles if cycles are supported. Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
committed by
Paolo Abeni
parent
42704b26b0
commit
51eb7492af
11
net/socket.c
11
net/socket.c
@@ -683,9 +683,18 @@ void __sock_tx_timestamp(__u16 tsflags, __u8 *tx_flags)
|
||||
{
|
||||
u8 flags = *tx_flags;
|
||||
|
||||
if (tsflags & SOF_TIMESTAMPING_TX_HARDWARE)
|
||||
if (tsflags & SOF_TIMESTAMPING_TX_HARDWARE) {
|
||||
flags |= SKBTX_HW_TSTAMP;
|
||||
|
||||
/* PTP hardware clocks can provide a free running cycle counter
|
||||
* as a time base for virtual clocks. Tell driver to use the
|
||||
* free running cycle counter for timestamp if socket is bound
|
||||
* to virtual clock.
|
||||
*/
|
||||
if (tsflags & SOF_TIMESTAMPING_BIND_PHC)
|
||||
flags |= SKBTX_HW_TSTAMP_USE_CYCLES;
|
||||
}
|
||||
|
||||
if (tsflags & SOF_TIMESTAMPING_TX_SOFTWARE)
|
||||
flags |= SKBTX_SW_TSTAMP;
|
||||
|
||||
|
Reference in New Issue
Block a user