162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* Copyright 2020 NXP 362306a36Sopenharmony_ci */ 462306a36Sopenharmony_ci#ifndef _SJA1105_VL_H 562306a36Sopenharmony_ci#define _SJA1105_VL_H 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#include "sja1105.h" 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#if IS_ENABLED(CONFIG_NET_DSA_SJA1105_VL) 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ciint sja1105_vl_redirect(struct sja1105_private *priv, int port, 1262306a36Sopenharmony_ci struct netlink_ext_ack *extack, unsigned long cookie, 1362306a36Sopenharmony_ci struct sja1105_key *key, unsigned long destports, 1462306a36Sopenharmony_ci bool append); 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ciint sja1105_vl_delete(struct sja1105_private *priv, int port, 1762306a36Sopenharmony_ci struct sja1105_rule *rule, 1862306a36Sopenharmony_ci struct netlink_ext_ack *extack); 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ciint sja1105_vl_gate(struct sja1105_private *priv, int port, 2162306a36Sopenharmony_ci struct netlink_ext_ack *extack, unsigned long cookie, 2262306a36Sopenharmony_ci struct sja1105_key *key, u32 index, s32 prio, 2362306a36Sopenharmony_ci u64 base_time, u64 cycle_time, u64 cycle_time_ext, 2462306a36Sopenharmony_ci u32 num_entries, struct action_gate_entry *entries); 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ciint sja1105_vl_stats(struct sja1105_private *priv, int port, 2762306a36Sopenharmony_ci struct sja1105_rule *rule, struct flow_stats *stats, 2862306a36Sopenharmony_ci struct netlink_ext_ack *extack); 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci#else 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_cistatic inline int sja1105_vl_redirect(struct sja1105_private *priv, int port, 3362306a36Sopenharmony_ci struct netlink_ext_ack *extack, 3462306a36Sopenharmony_ci unsigned long cookie, 3562306a36Sopenharmony_ci struct sja1105_key *key, 3662306a36Sopenharmony_ci unsigned long destports, 3762306a36Sopenharmony_ci bool append) 3862306a36Sopenharmony_ci{ 3962306a36Sopenharmony_ci NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in"); 4062306a36Sopenharmony_ci return -EOPNOTSUPP; 4162306a36Sopenharmony_ci} 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_cistatic inline int sja1105_vl_delete(struct sja1105_private *priv, 4462306a36Sopenharmony_ci int port, struct sja1105_rule *rule, 4562306a36Sopenharmony_ci struct netlink_ext_ack *extack) 4662306a36Sopenharmony_ci{ 4762306a36Sopenharmony_ci NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in"); 4862306a36Sopenharmony_ci return -EOPNOTSUPP; 4962306a36Sopenharmony_ci} 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_cistatic inline int sja1105_vl_gate(struct sja1105_private *priv, int port, 5262306a36Sopenharmony_ci struct netlink_ext_ack *extack, 5362306a36Sopenharmony_ci unsigned long cookie, 5462306a36Sopenharmony_ci struct sja1105_key *key, u32 index, s32 prio, 5562306a36Sopenharmony_ci u64 base_time, u64 cycle_time, 5662306a36Sopenharmony_ci u64 cycle_time_ext, u32 num_entries, 5762306a36Sopenharmony_ci struct action_gate_entry *entries) 5862306a36Sopenharmony_ci{ 5962306a36Sopenharmony_ci NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in"); 6062306a36Sopenharmony_ci return -EOPNOTSUPP; 6162306a36Sopenharmony_ci} 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_cistatic inline int sja1105_vl_stats(struct sja1105_private *priv, int port, 6462306a36Sopenharmony_ci struct sja1105_rule *rule, 6562306a36Sopenharmony_ci struct flow_stats *stats, 6662306a36Sopenharmony_ci struct netlink_ext_ack *extack) 6762306a36Sopenharmony_ci{ 6862306a36Sopenharmony_ci NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in"); 6962306a36Sopenharmony_ci return -EOPNOTSUPP; 7062306a36Sopenharmony_ci} 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_ci#endif /* IS_ENABLED(CONFIG_NET_DSA_SJA1105_VL) */ 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_ci#endif /* _SJA1105_VL_H */ 75