linux/drivers/net/wireless/intel/iwlwifi/mvm/ptp.c

// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
 * Copyright (C) 2021 - 2023 Intel Corporation
 */

#include "mvm.h"
#include "iwl-debug.h"
#include <linux/timekeeping.h>
#include <linux/math64.h>

#define IWL_PTP_GP2_WRAP
#define IWL_PTP_WRAP_TIME

/* The scaled_ppm parameter is ppm (parts per million) with a 16-bit fractional
 * part, which means that a value of 1 in one of those fields actually means
 * 2^-16 ppm, and 2^16=65536 is 1 ppm.
 */
#define SCALE_FACTOR
#define IWL_PTP_WRAP_THRESHOLD_USEC

#define IWL_PTP_GET_CROSS_TS_NUM

static void iwl_mvm_ptp_update_new_read(struct iwl_mvm *mvm, u32 gp2)
{}

u64 iwl_mvm_ptp_get_adj_time(struct iwl_mvm *mvm, u64 base_time_ns)
{}

static int
iwl_mvm_get_crosstimestamp_fw(struct iwl_mvm *mvm, u32 *gp2, u64 *sys_time)
{}

static void iwl_mvm_phc_get_crosstimestamp_loop(struct iwl_mvm *mvm,
						ktime_t *sys_time, u32 *gp2)
{}

static int
iwl_mvm_phc_get_crosstimestamp(struct ptp_clock_info *ptp,
			       struct system_device_crosststamp *xtstamp)
{}

static void iwl_mvm_ptp_work(struct work_struct *wk)
{}

static int iwl_mvm_ptp_gettime(struct ptp_clock_info *ptp,
			       struct timespec64 *ts)
{}

static int iwl_mvm_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
{}

static int iwl_mvm_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
{}

/* iwl_mvm_ptp_init - initialize PTP for devices which support it.
 * @mvm: internal mvm structure, see &struct iwl_mvm.
 *
 * Performs the required steps for enabling PTP support.
 */
void iwl_mvm_ptp_init(struct iwl_mvm *mvm)
{}

/* iwl_mvm_ptp_remove - disable PTP device.
 * @mvm: internal mvm structure, see &struct iwl_mvm.
 *
 * Disable PTP support.
 */
void iwl_mvm_ptp_remove(struct iwl_mvm *mvm)
{}