/* * Copyright (c) 2024 BayLibre SAS * * SPDX-License-Identifier: Apache-2.0 */ /** * @file ds.h * @brief Datasets types. * * References are to version 2019 of IEEE 1588, ("PTP") */ #ifndef ZEPHYR_INCLUDE_PTP_DS_H_ #define ZEPHYR_INCLUDE_PTP_DS_H_ #include #include "ddt.h" #include "state_machine.h" #ifdef __cplusplus extern "C" { #endif /** * @brief PTP Default Dataset. * @note 8.2.1 - defaultDS data set member specification */ struct ptp_default_ds { /* static */ /** Clock ID */ ptp_clk_id clk_id; /** Indicates number of ptp ports on the PTP Instance. */ uint16_t n_ports; /* dynamic */ /** Quality of a clock. */ struct ptp_clk_quality clk_quality; /** Parameter used in the execution BTCA. */ uint8_t priority1; /** Parameter used in the execution BTCA. */ uint8_t priority2; /** ID number of the instance in a domain. */ uint8_t domain; /** sdoId attribute. */ uint16_t sdo_id: 12; /** Flag indicating timeReceiver mode. */ bool time_receiver_only; /* optional */ /** Current value of the PTP Instance Time. */ struct net_ptp_time current_time; /** Enable flag. */ bool enable; /** Flag indication if external port configuration option is enabled. */ bool external_port_conf_en; /** Maximum value of steps removed of an Announce messages to be considered in BTCA. */ uint8_t max_steps_rm; /** PTP Instance type. */ uint8_t type; }; /** * @brief PTP Current Dataset. * @note 8.2.2 - currentDS data set member specification */ struct ptp_current_ds { /** Number of PTP Communication Paths traversed between PTP Instance and the GM. */ uint16_t steps_rm; /** Current value of time difference between a Transmitter and Receiver. * * @note it is computed as