linux/drivers/net/dsa/sja1105/sja1105_tas.h

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2019, Vladimir Oltean <[email protected]>
 */
#ifndef _SJA1105_TAS_H
#define _SJA1105_TAS_H

#include <net/pkt_sched.h>

#define SJA1105_TAS_MAX_DELTA

struct sja1105_private;

#if IS_ENABLED(CONFIG_NET_DSA_SJA1105_TAS)

enum sja1105_tas_state {};

enum sja1105_ptp_op {};

struct sja1105_gate_entry {};

struct sja1105_gating_config {};

struct sja1105_tas_data {};

int sja1105_setup_tc_taprio(struct dsa_switch *ds, int port,
			    struct tc_taprio_qopt_offload *admin);

void sja1105_tas_setup(struct dsa_switch *ds);

void sja1105_tas_teardown(struct dsa_switch *ds);

void sja1105_tas_clockstep(struct dsa_switch *ds);

void sja1105_tas_adjfreq(struct dsa_switch *ds);

bool sja1105_gating_check_conflicts(struct sja1105_private *priv, int port,
				    struct netlink_ext_ack *extack);

int sja1105_init_scheduling(struct sja1105_private *priv);

#else

/* C doesn't allow empty structures, bah! */
struct sja1105_tas_data {
	u8 dummy;
};

static inline int sja1105_setup_tc_taprio(struct dsa_switch *ds, int port,
					  struct tc_taprio_qopt_offload *admin)
{
	return -EOPNOTSUPP;
}

static inline void sja1105_tas_setup(struct dsa_switch *ds) { }

static inline void sja1105_tas_teardown(struct dsa_switch *ds) { }

static inline void sja1105_tas_clockstep(struct dsa_switch *ds) { }

static inline void sja1105_tas_adjfreq(struct dsa_switch *ds) { }

static inline bool
sja1105_gating_check_conflicts(struct dsa_switch *ds, int port,
			       struct netlink_ext_ack *extack)
{
	return true;
}

static inline int sja1105_init_scheduling(struct sja1105_private *priv)
{
	return 0;
}

#endif /* IS_ENABLED(CONFIG_NET_DSA_SJA1105_TAS) */

#endif /* _SJA1105_TAS_H */