msg: Represent hw_timestamp "sw" field as tmv_t
Convert a software timestamp to the internal tmv_t representation at the earliest possible opportunity, to match the behaviour for hardware timestamps. Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>master
parent
29a99ad513
commit
7f59858d08
3
msg.h
3
msg.h
|
@ -27,6 +27,7 @@
|
||||||
#include "address.h"
|
#include "address.h"
|
||||||
#include "ddt.h"
|
#include "ddt.h"
|
||||||
#include "tlv.h"
|
#include "tlv.h"
|
||||||
|
#include "tmv.h"
|
||||||
|
|
||||||
#define PTP_VERSION 2
|
#define PTP_VERSION 2
|
||||||
|
|
||||||
|
@ -65,7 +66,7 @@ enum timestamp_type {
|
||||||
struct hw_timestamp {
|
struct hw_timestamp {
|
||||||
enum timestamp_type type;
|
enum timestamp_type type;
|
||||||
tmv_t ts;
|
tmv_t ts;
|
||||||
struct timespec sw;
|
tmv_t sw;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum controlField {
|
enum controlField {
|
||||||
|
|
4
port.c
4
port.c
|
@ -555,8 +555,8 @@ static void free_foreign_masters(struct port *p)
|
||||||
static int fup_sync_ok(struct ptp_message *fup, struct ptp_message *sync)
|
static int fup_sync_ok(struct ptp_message *fup, struct ptp_message *sync)
|
||||||
{
|
{
|
||||||
int64_t tfup, tsync;
|
int64_t tfup, tsync;
|
||||||
tfup = tmv_to_nanoseconds(timespec_to_tmv(fup->hwts.sw));
|
tfup = tmv_to_nanoseconds(fup->hwts.sw);
|
||||||
tsync = tmv_to_nanoseconds(timespec_to_tmv(sync->hwts.sw));
|
tsync = tmv_to_nanoseconds(sync->hwts.sw);
|
||||||
/*
|
/*
|
||||||
* NB - If the sk_check_fupsync option is not enabled, then
|
* NB - If the sk_check_fupsync option is not enabled, then
|
||||||
* both of these time stamps will be zero.
|
* both of these time stamps will be zero.
|
||||||
|
|
Loading…
Reference in New Issue