#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/net_tstamp.h>
#include <linux/timekeeping.h>
#include <linux/ptp_classify.h>
#include <linux/clocksource.h>
#include "bnxt_hsi.h"
#include "bnxt.h"
#include "bnxt_hwrm.h"
#include "bnxt_ptp.h"
static int bnxt_ptp_cfg_settime(struct bnxt *bp, u64 time)
{ … }
int bnxt_ptp_parse(struct sk_buff *skb, u16 *seq_id, u16 *hdr_off)
{ … }
static int bnxt_ptp_settime(struct ptp_clock_info *ptp_info,
const struct timespec64 *ts)
{ … }
static int bnxt_refclk_read(struct bnxt *bp, struct ptp_system_timestamp *sts,
u64 *ns)
{ … }
static void bnxt_ptp_get_current_time(struct bnxt *bp)
{ … }
static int bnxt_hwrm_port_ts_query(struct bnxt *bp, u32 flags, u64 *ts,
u32 txts_tmo, int slot)
{ … }
static int bnxt_ptp_gettimex(struct ptp_clock_info *ptp_info,
struct timespec64 *ts,
struct ptp_system_timestamp *sts)
{ … }
void bnxt_ptp_update_current_time(struct bnxt *bp)
{ … }
static int bnxt_ptp_adjphc(struct bnxt_ptp_cfg *ptp, s64 delta)
{ … }
static int bnxt_ptp_adjtime(struct ptp_clock_info *ptp_info, s64 delta)
{ … }
static int bnxt_ptp_adjfine_rtc(struct bnxt *bp, long scaled_ppm)
{ … }
static int bnxt_ptp_adjfine(struct ptp_clock_info *ptp_info, long scaled_ppm)
{ … }
void bnxt_ptp_pps_event(struct bnxt *bp, u32 data1, u32 data2)
{ … }
static int bnxt_ptp_cfg_pin(struct bnxt *bp, u8 pin, u8 usage)
{ … }
static int bnxt_ptp_cfg_event(struct bnxt *bp, u8 event)
{ … }
int bnxt_ptp_cfg_tstamp_filters(struct bnxt *bp)
{ … }
void bnxt_ptp_reapply_pps(struct bnxt *bp)
{ … }
static int bnxt_get_target_cycles(struct bnxt_ptp_cfg *ptp, u64 target_ns,
u64 *cycles_delta)
{ … }
static int bnxt_ptp_perout_cfg(struct bnxt_ptp_cfg *ptp,
struct ptp_clock_request *rq)
{ … }
static int bnxt_ptp_enable(struct ptp_clock_info *ptp_info,
struct ptp_clock_request *rq, int on)
{ … }
static int bnxt_hwrm_ptp_cfg(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)
{ … }
static int bnxt_map_regs(struct bnxt *bp, u32 *reg_arr, int count, int reg_win)
{ … }
static int bnxt_map_ptp_regs(struct bnxt *bp)
{ … }
static void bnxt_unmap_ptp_regs(struct bnxt *bp)
{ … }
static u64 bnxt_cc_read(const struct cyclecounter *cc)
{ … }
static int bnxt_stamp_tx_skb(struct bnxt *bp, int slot)
{ … }
static long bnxt_ptp_ts_aux_work(struct ptp_clock_info *ptp_info)
{ … }
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)
{ … }
static const struct ptp_clock_info bnxt_ptp_caps = …;
static int bnxt_ptp_verify(struct ptp_clock_info *ptp_info, unsigned int pin,
enum ptp_pin_function func, unsigned int chan)
{ … }
static int bnxt_ptp_pps_init(struct bnxt *bp)
{ … }
static bool bnxt_pps_config_ok(struct bnxt *bp)
{ … }
static void bnxt_ptp_timecounter_init(struct bnxt *bp, bool init_tc)
{ … }
void bnxt_ptp_rtc_timecounter_init(struct bnxt_ptp_cfg *ptp, u64 ns)
{ … }
int bnxt_ptp_init_rtc(struct bnxt *bp, bool phc_cfg)
{ … }
static void bnxt_ptp_free(struct bnxt *bp)
{ … }
int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg)
{ … }
void bnxt_ptp_clear(struct bnxt *bp)
{ … }