#include <linux/gpio/consumer.h>
#include <linux/ip.h>
#include <linux/net_tstamp.h>
#include <linux/mii.h>
#include <linux/phy.h>
#include <linux/ptp_classify.h>
#include <linux/ptp_clock_kernel.h>
#include <linux/udp.h>
#include <asm/unaligned.h>
#include "mscc.h"
#include "mscc_ptp.h"
static int phy_ts_base_write(struct phy_device *phydev, u32 regnum, u16 val)
{ … }
static int phy_ts_base_read(struct phy_device *phydev, u32 regnum)
{ … }
enum ts_blk_hw { … };
enum ts_blk { … };
static u32 vsc85xx_ts_read_csr(struct phy_device *phydev, enum ts_blk blk,
u16 addr)
{ … }
static void vsc85xx_ts_write_csr(struct phy_device *phydev, enum ts_blk blk,
u16 addr, u32 val)
{ … }
#define PTP_HEADER_TRNSP_MSG …
#define PTP_HEADER_DOMAIN_NUM …
#define PTP_HEADER_BYTE_8_31(x) …
#define MAC_ADDRESS_BYTE(x) …
static int vsc85xx_ts_fsb_init(struct phy_device *phydev)
{ … }
static const u32 vsc85xx_egr_latency[] = …;
static const u32 vsc85xx_egr_latency_macsec[] = …;
static const u32 vsc85xx_ingr_latency[] = …;
static const u32 vsc85xx_ingr_latency_macsec[] = …;
static void vsc85xx_ts_set_latencies(struct phy_device *phydev)
{ … }
static int vsc85xx_ts_disable_flows(struct phy_device *phydev, enum ts_blk blk)
{ … }
static int vsc85xx_ts_eth_cmp1_sig(struct phy_device *phydev)
{ … }
static struct vsc85xx_ptphdr *get_ptp_header_l4(struct sk_buff *skb,
struct iphdr *iphdr,
struct udphdr *udphdr)
{ … }
static struct vsc85xx_ptphdr *get_ptp_header_tx(struct sk_buff *skb)
{ … }
static struct vsc85xx_ptphdr *get_ptp_header_rx(struct sk_buff *skb,
enum hwtstamp_rx_filters rx_filter)
{ … }
static int get_sig(struct sk_buff *skb, u8 *sig)
{ … }
static void vsc85xx_dequeue_skb(struct vsc85xx_ptp *ptp)
{ … }
static void vsc85xx_get_tx_ts(struct vsc85xx_ptp *ptp)
{ … }
static int vsc85xx_ptp_cmp_init(struct phy_device *phydev, enum ts_blk blk)
{ … }
static int vsc85xx_eth_cmp1_init(struct phy_device *phydev, enum ts_blk blk)
{ … }
static int vsc85xx_ip_cmp1_init(struct phy_device *phydev, enum ts_blk blk)
{ … }
static int vsc85xx_adjfine(struct ptp_clock_info *info, long scaled_ppm)
{ … }
static int __vsc85xx_gettime(struct ptp_clock_info *info, struct timespec64 *ts)
{ … }
static int vsc85xx_gettime(struct ptp_clock_info *info, struct timespec64 *ts)
{ … }
static int __vsc85xx_settime(struct ptp_clock_info *info,
const struct timespec64 *ts)
{ … }
static int vsc85xx_settime(struct ptp_clock_info *info,
const struct timespec64 *ts)
{ … }
static int vsc85xx_adjtime(struct ptp_clock_info *info, s64 delta)
{ … }
static int vsc85xx_eth1_next_comp(struct phy_device *phydev, enum ts_blk blk,
u32 next_comp, u32 etype)
{ … }
static int vsc85xx_ip1_next_comp(struct phy_device *phydev, enum ts_blk blk,
u32 next_comp, u32 header)
{ … }
static int vsc85xx_ts_ptp_action_flow(struct phy_device *phydev, enum ts_blk blk, u8 flow, enum ptp_cmd cmd)
{ … }
static int vsc85xx_ptp_conf(struct phy_device *phydev, enum ts_blk blk,
bool one_step, bool enable)
{ … }
static int vsc85xx_eth1_conf(struct phy_device *phydev, enum ts_blk blk,
bool enable)
{ … }
static int vsc85xx_ip1_conf(struct phy_device *phydev, enum ts_blk blk,
bool enable)
{ … }
static int vsc85xx_ts_engine_init(struct phy_device *phydev, bool one_step)
{ … }
void vsc85xx_link_change_notify(struct phy_device *phydev)
{ … }
static void vsc85xx_ts_reset_fifo(struct phy_device *phydev)
{ … }
static int vsc85xx_hwtstamp(struct mii_timestamper *mii_ts,
struct kernel_hwtstamp_config *cfg,
struct netlink_ext_ack *extack)
{ … }
static int vsc85xx_ts_info(struct mii_timestamper *mii_ts,
struct kernel_ethtool_ts_info *info)
{ … }
static void vsc85xx_txtstamp(struct mii_timestamper *mii_ts,
struct sk_buff *skb, int type)
{ … }
static bool vsc85xx_rxtstamp(struct mii_timestamper *mii_ts,
struct sk_buff *skb, int type)
{ … }
static const struct ptp_clock_info vsc85xx_clk_caps = …;
static struct vsc8531_private *vsc8584_base_priv(struct phy_device *phydev)
{ … }
static bool vsc8584_is_1588_input_clk_configured(struct phy_device *phydev)
{ … }
static void vsc8584_set_input_clk_configured(struct phy_device *phydev)
{ … }
static int __vsc8584_init_ptp(struct phy_device *phydev)
{ … }
void vsc8584_config_ts_intr(struct phy_device *phydev)
{ … }
int vsc8584_ptp_init(struct phy_device *phydev)
{ … }
irqreturn_t vsc8584_handle_ts_interrupt(struct phy_device *phydev)
{ … }
int vsc8584_ptp_probe(struct phy_device *phydev)
{ … }
int vsc8584_ptp_probe_once(struct phy_device *phydev)
{ … }