linux/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h

/* Broadcom NetXtreme-C/E network driver.
 *
 * Copyright (c) 2021 Broadcom Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation.
 */

#ifndef BNXT_PTP_H
#define BNXT_PTP_H

#include <linux/ptp_clock_kernel.h>
#include <linux/timecounter.h>

#define BNXT_PTP_GRC_WIN
#define BNXT_PTP_GRC_WIN_BASE

#define BNXT_MAX_PHC_DRIFT
#define BNXT_CYCLES_SHIFT
#define BNXT_DEVCLK_FREQ
#define BNXT_LO_TIMER_MASK
#define BNXT_HI_TIMER_MASK

#define BNXT_PTP_DFLT_TX_TMO
#define BNXT_PTP_QTS_TIMEOUT
#define BNXT_PTP_QTS_MAX_TMO_US
#define BNXT_PTP_QTS_TX_ENABLES

struct pps_pin {};

#define TSIO_PIN_VALID(pin)

#define EVENT_DATA2_PPS_EVENT_TYPE(data2)

#define EVENT_DATA2_PPS_PIN_NUM(data2)

#define BNXT_DATA2_UPPER_MSK

#define BNXT_DATA2_UPPER_SFT

#define BNXT_DATA1_LOWER_MSK

#define BNXT_DATA1_LOWER_SFT

#define EVENT_PPS_TS(data2, data1)

#define BNXT_PPS_PIN_DISABLE
#define BNXT_PPS_PIN_ENABLE
#define BNXT_PPS_PIN_NONE
#define BNXT_PPS_PIN_PPS_IN
#define BNXT_PPS_PIN_PPS_OUT
#define BNXT_PPS_PIN_SYNC_IN
#define BNXT_PPS_PIN_SYNC_OUT

#define BNXT_PPS_EVENT_INTERNAL
#define BNXT_PPS_EVENT_EXTERNAL

struct bnxt_pps {};

struct bnxt_ptp_stats {};

#define BNXT_MAX_TX_TS
#define NEXT_TXTS(idx)

struct bnxt_ptp_tx_req {};

struct bnxt_ptp_cfg {};

#if BITS_PER_LONG == 32
#define BNXT_READ_TIME64
#else
#define BNXT_READ_TIME64(ptp, dst, src)
#endif

#define BNXT_PTP_INC_TX_AVAIL(ptp)

int bnxt_ptp_parse(struct sk_buff *skb, u16 *seq_id, u16 *hdr_off);
void bnxt_ptp_update_current_time(struct bnxt *bp);
void bnxt_ptp_pps_event(struct bnxt *bp, u32 data1, u32 data2);
int bnxt_ptp_cfg_tstamp_filters(struct bnxt *bp);
void bnxt_ptp_reapply_pps(struct bnxt *bp);
int bnxt_hwtstamp_set(struct net_device *dev, struct ifreq *ifr);
int bnxt_hwtstamp_get(struct net_device *dev, struct ifreq *ifr);
int bnxt_ptp_get_txts_prod(struct bnxt_ptp_cfg *ptp, u16 *prod);
void bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb, u16 prod);
int bnxt_get_rx_ts_p5(struct bnxt *bp, u64 *ts, u32 pkt_ts);
void bnxt_tx_ts_cmp(struct bnxt *bp, struct bnxt_napi *bnapi,
		    struct tx_ts_cmp *tscmp);
void bnxt_ptp_rtc_timecounter_init(struct bnxt_ptp_cfg *ptp, u64 ns);
int bnxt_ptp_init_rtc(struct bnxt *bp, bool phc_cfg);
int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg);
void bnxt_ptp_clear(struct bnxt *bp);
#endif