linux/drivers/net/dsa/mv88e6xxx/hwtstamp.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Marvell 88E6xxx Switch hardware timestamping support
 *
 * Copyright (c) 2008 Marvell Semiconductor
 *
 * Copyright (c) 2017 National Instruments
 *      Erik Hons <[email protected]>
 *      Brandon Streiff <[email protected]>
 *      Dane Wagner <[email protected]>
 */

#include "chip.h"
#include "global2.h"
#include "hwtstamp.h"
#include "ptp.h"
#include <linux/ptp_classify.h>

#define SKB_PTP_TYPE(__skb)

static int mv88e6xxx_port_ptp_read(struct mv88e6xxx_chip *chip, int port,
				   int addr, u16 *data, int len)
{}

static int mv88e6xxx_port_ptp_write(struct mv88e6xxx_chip *chip, int port,
				    int addr, u16 data)
{}

static int mv88e6xxx_ptp_write(struct mv88e6xxx_chip *chip, int addr,
			       u16 data)
{}

static int mv88e6xxx_ptp_read(struct mv88e6xxx_chip *chip, int addr,
			      u16 *data)
{}

/* TX_TSTAMP_TIMEOUT: This limits the time spent polling for a TX
 * timestamp. When working properly, hardware will produce a timestamp
 * within 1ms. Software may enounter delays due to MDIO contention, so
 * the timeout is set accordingly.
 */
#define TX_TSTAMP_TIMEOUT

int mv88e6xxx_get_ts_info(struct dsa_switch *ds, int port,
			  struct kernel_ethtool_ts_info *info)
{}

static int mv88e6xxx_set_hwtstamp_config(struct mv88e6xxx_chip *chip, int port,
					 struct hwtstamp_config *config)
{}

int mv88e6xxx_port_hwtstamp_set(struct dsa_switch *ds, int port,
				struct ifreq *ifr)
{}

int mv88e6xxx_port_hwtstamp_get(struct dsa_switch *ds, int port,
				struct ifreq *ifr)
{}

/* Returns a pointer to the PTP header if the caller should time stamp,
 * or NULL if the caller should not.
 */
static struct ptp_header *mv88e6xxx_should_tstamp(struct mv88e6xxx_chip *chip,
						  int port, struct sk_buff *skb,
						  unsigned int type)
{}

static int mv88e6xxx_ts_valid(u16 status)
{}

static int seq_match(struct sk_buff *skb, u16 ts_seqid)
{}

static void mv88e6xxx_get_rxts(struct mv88e6xxx_chip *chip,
			       struct mv88e6xxx_port_hwtstamp *ps,
			       struct sk_buff *skb, u16 reg,
			       struct sk_buff_head *rxq)
{}

static void mv88e6xxx_rxtstamp_work(struct mv88e6xxx_chip *chip,
				    struct mv88e6xxx_port_hwtstamp *ps)
{}

static int is_pdelay_resp(const struct ptp_header *hdr)
{}

bool mv88e6xxx_port_rxtstamp(struct dsa_switch *ds, int port,
			     struct sk_buff *skb, unsigned int type)
{}

static int mv88e6xxx_txtstamp_work(struct mv88e6xxx_chip *chip,
				   struct mv88e6xxx_port_hwtstamp *ps)
{}

long mv88e6xxx_hwtstamp_work(struct ptp_clock_info *ptp)
{}

void mv88e6xxx_port_txtstamp(struct dsa_switch *ds, int port,
			     struct sk_buff *skb)
{}

int mv88e6165_global_disable(struct mv88e6xxx_chip *chip)
{}

int mv88e6165_global_enable(struct mv88e6xxx_chip *chip)
{}

int mv88e6352_hwtstamp_port_disable(struct mv88e6xxx_chip *chip, int port)
{}

int mv88e6352_hwtstamp_port_enable(struct mv88e6xxx_chip *chip, int port)
{}

static int mv88e6xxx_hwtstamp_port_setup(struct mv88e6xxx_chip *chip, int port)
{}

int mv88e6xxx_hwtstamp_setup(struct mv88e6xxx_chip *chip)
{}

void mv88e6xxx_hwtstamp_free(struct mv88e6xxx_chip *chip)
{}