linux/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c

// SPDX-License-Identifier: GPL-2.0+

#include <linux/ptp_classify.h>

#include "lan966x_main.h"
#include "vcap_api.h"
#include "vcap_api_client.h"

#define LAN966X_MAX_PTP_ID

/* Represents 1ppm adjustment in 2^59 format with 6.037735849ns as reference
 * The value is calculated as following: (1/1000000)/((2^-59)/6.037735849)
 */
#define LAN966X_1PPM_FORMAT

/* Represents 1ppb adjustment in 2^29 format with 6.037735849ns as reference
 * The value is calculated as following: (1/1000000000)/((2^59)/6.037735849)
 */
#define LAN966X_1PPB_FORMAT

#define TOD_ACC_PIN

/* This represents the base rule ID for the PTP rules that are added in the
 * VCAP to trap frames to CPU. This number needs to be bigger than the maximum
 * number of entries that can exist in the VCAP.
 */
#define LAN966X_VCAP_PTP_RULE_ID
#define LAN966X_VCAP_L2_PTP_TRAP
#define LAN966X_VCAP_IPV4_EV_PTP_TRAP
#define LAN966X_VCAP_IPV4_GEN_PTP_TRAP
#define LAN966X_VCAP_IPV6_EV_PTP_TRAP
#define LAN966X_VCAP_IPV6_GEN_PTP_TRAP

enum {};

static u64 lan966x_ptp_get_nominal_value(void)
{}

static int lan966x_ptp_add_trap(struct lan966x_port *port,
				int (*add_ptp_key)(struct vcap_rule *vrule,
						   struct lan966x_port*),
				u32 rule_id,
				u16 proto)
{}

static int lan966x_ptp_del_trap(struct lan966x_port *port,
				u32 rule_id)
{}

static int lan966x_ptp_add_l2_key(struct vcap_rule *vrule,
				  struct lan966x_port *port)
{}

static int lan966x_ptp_add_ip_event_key(struct vcap_rule *vrule,
					struct lan966x_port *port)
{}

static int lan966x_ptp_add_ip_general_key(struct vcap_rule *vrule,
					  struct lan966x_port *port)
{}

static int lan966x_ptp_add_l2_rule(struct lan966x_port *port)
{}

static int lan966x_ptp_add_ipv4_rules(struct lan966x_port *port)
{}

static int lan966x_ptp_add_ipv6_rules(struct lan966x_port *port)
{}

static int lan966x_ptp_del_l2_rule(struct lan966x_port *port)
{}

static int lan966x_ptp_del_ipv4_rules(struct lan966x_port *port)
{}

static int lan966x_ptp_del_ipv6_rules(struct lan966x_port *port)
{}

static int lan966x_ptp_add_traps(struct lan966x_port *port)
{}

int lan966x_ptp_del_traps(struct lan966x_port *port)
{}

int lan966x_ptp_setup_traps(struct lan966x_port *port,
			    struct kernel_hwtstamp_config *cfg)
{}

int lan966x_ptp_hwtstamp_set(struct lan966x_port *port,
			     struct kernel_hwtstamp_config *cfg,
			     struct netlink_ext_ack *extack)
{}

void lan966x_ptp_hwtstamp_get(struct lan966x_port *port,
			      struct kernel_hwtstamp_config *cfg)
{}

static int lan966x_ptp_classify(struct lan966x_port *port, struct sk_buff *skb)
{}

static void lan966x_ptp_txtstamp_old_release(struct lan966x_port *port)
{}

int lan966x_ptp_txtstamp_request(struct lan966x_port *port,
				 struct sk_buff *skb)
{}

void lan966x_ptp_txtstamp_release(struct lan966x_port *port,
				  struct sk_buff *skb)
{}

static void lan966x_get_hwtimestamp(struct lan966x *lan966x,
				    struct timespec64 *ts,
				    u32 nsec)
{}

irqreturn_t lan966x_ptp_irq_handler(int irq, void *args)
{}

irqreturn_t lan966x_ptp_ext_irq_handler(int irq, void *args)
{}

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

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

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

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

static int lan966x_ptp_verify(struct ptp_clock_info *ptp, unsigned int pin,
			      enum ptp_pin_function func, unsigned int chan)
{}

static int lan966x_ptp_perout(struct ptp_clock_info *ptp,
			      struct ptp_clock_request *rq, int on)
{}

static int lan966x_ptp_extts(struct ptp_clock_info *ptp,
			     struct ptp_clock_request *rq, int on)
{}

static int lan966x_ptp_enable(struct ptp_clock_info *ptp,
			      struct ptp_clock_request *rq, int on)
{}

static struct ptp_clock_info lan966x_ptp_clock_info =;

static int lan966x_ptp_phc_init(struct lan966x *lan966x,
				int index,
				struct ptp_clock_info *clock_info)
{}

int lan966x_ptp_init(struct lan966x *lan966x)
{}

void lan966x_ptp_deinit(struct lan966x *lan966x)
{}

void lan966x_ptp_rxtstamp(struct lan966x *lan966x, struct sk_buff *skb,
			  u64 src_port, u64 timestamp)
{}

u32 lan966x_ptp_get_period_ps(void)
{}