linux/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h

/* SPDX-License-Identifier: GPL-2.0+ */
// Copyright (c) 2021 Hisilicon Limited.

#ifndef __HCLGE_PTP_H
#define __HCLGE_PTP_H

#include <linux/ptp_clock_kernel.h>
#include <linux/net_tstamp.h>
#include <linux/types.h>

struct hclge_dev;
struct ifreq;

#define HCLGE_PTP_REG_OFFSET

#define HCLGE_PTP_TX_TS_SEQID_REG
#define HCLGE_PTP_TX_TS_NSEC_REG
#define HCLGE_PTP_TX_TS_NSEC_MASK
#define HCLGE_PTP_TX_TS_SEC_L_REG
#define HCLGE_PTP_TX_TS_SEC_H_REG
#define HCLGE_PTP_TX_TS_SEC_H_MASK
#define HCLGE_PTP_TX_TS_CNT_REG

#define HCLGE_PTP_TIME_SEC_H_REG
#define HCLGE_PTP_TIME_SEC_H_MASK
#define HCLGE_PTP_TIME_SEC_L_REG
#define HCLGE_PTP_TIME_NSEC_REG
#define HCLGE_PTP_TIME_NSEC_MASK
#define HCLGE_PTP_TIME_NSEC_NEG
#define HCLGE_PTP_TIME_SYNC_REG
#define HCLGE_PTP_TIME_SYNC_EN
#define HCLGE_PTP_TIME_ADJ_REG
#define HCLGE_PTP_TIME_ADJ_EN
#define HCLGE_PTP_CYCLE_QUO_REG
#define HCLGE_PTP_CYCLE_QUO_MASK
#define HCLGE_PTP_CYCLE_DEN_REG
#define HCLGE_PTP_CYCLE_NUM_REG
#define HCLGE_PTP_CYCLE_CFG_REG
#define HCLGE_PTP_CYCLE_ADJ_EN
#define HCLGE_PTP_CUR_TIME_SEC_H_REG
#define HCLGE_PTP_CUR_TIME_SEC_L_REG
#define HCLGE_PTP_CUR_TIME_NSEC_REG

#define HCLGE_PTP_CYCLE_ADJ_MAX
#define HCLGE_PTP_SEC_H_OFFSET
#define HCLGE_PTP_SEC_L_MASK

#define HCLGE_PTP_FLAG_EN
#define HCLGE_PTP_FLAG_TX_EN
#define HCLGE_PTP_FLAG_RX_EN

struct hclge_ptp_cycle {};

struct hclge_ptp {};

struct hclge_ptp_int_cmd {};

enum hclge_ptp_udp_type {};

enum hclge_ptp_msg_type {};

enum hclge_ptp_msg0_type {};

#define HCLGE_PTP_MSG1_V2_DEFAULT

struct hclge_ptp_cfg_cmd {};

static inline struct hclge_dev *hclge_ptp_get_hdev(struct ptp_clock_info *info)
{}

bool hclge_ptp_set_tx_info(struct hnae3_handle *handle, struct sk_buff *skb);
void hclge_ptp_clean_tx_hwts(struct hclge_dev *hdev);
void hclge_ptp_get_rx_hwts(struct hnae3_handle *handle, struct sk_buff *skb,
			   u32 nsec, u32 sec);
int hclge_ptp_get_cfg(struct hclge_dev *hdev, struct ifreq *ifr);
int hclge_ptp_set_cfg(struct hclge_dev *hdev, struct ifreq *ifr);
int hclge_ptp_init(struct hclge_dev *hdev);
void hclge_ptp_uninit(struct hclge_dev *hdev);
int hclge_ptp_get_ts_info(struct hnae3_handle *handle,
			  struct kernel_ethtool_ts_info *info);
int hclge_ptp_cfg_qry(struct hclge_dev *hdev, u32 *cfg);
#endif