/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2025 Intel Corporation3*/4#ifndef __iwl_mld_ptp_h__5#define __iwl_mld_ptp_h__67#include <linux/ptp_clock_kernel.h>89/**10* struct ptp_data - PTP hardware clock data11*12* @ptp_clock: struct ptp_clock pointer returned by the ptp_clock_register()13* function.14* @ptp_clock_info: struct ptp_clock_info that describes a PTP hardware clock15* @lock: protects the time adjustments data16* @delta: delta between hardware clock and ptp clock in nanoseconds17* @scale_update_gp2: GP2 time when the scale was last updated18* @scale_update_adj_time_ns: adjusted time when the scale was last updated,19* in nanoseconds20* @scaled_freq: clock frequency offset, scaled to 6553600000021* @last_gp2: the last GP2 reading from the hardware, used for tracking GP222* wraparounds23* @wrap_counter: number of wraparounds since scale_update_adj_time_ns24* @dwork: worker scheduled every 1 hour to detect workarounds25*/26struct ptp_data {27struct ptp_clock *ptp_clock;28struct ptp_clock_info ptp_clock_info;2930spinlock_t lock;31s64 delta;32u32 scale_update_gp2;33u64 scale_update_adj_time_ns;34u64 scaled_freq;35u32 last_gp2;36u32 wrap_counter;37struct delayed_work dwork;38};3940void iwl_mld_ptp_init(struct iwl_mld *mld);41void iwl_mld_ptp_remove(struct iwl_mld *mld);42u64 iwl_mld_ptp_get_adj_time(struct iwl_mld *mld, u64 base_time_ns);4344#endif /* __iwl_mld_ptp_h__ */454647