18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* Copyright 2020, NXP Semiconductors 38c2ecf20Sopenharmony_ci */ 48c2ecf20Sopenharmony_ci#ifndef _SJA1105_VL_H 58c2ecf20Sopenharmony_ci#define _SJA1105_VL_H 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include "sja1105.h" 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_NET_DSA_SJA1105_VL) 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ciint sja1105_vl_redirect(struct sja1105_private *priv, int port, 128c2ecf20Sopenharmony_ci struct netlink_ext_ack *extack, unsigned long cookie, 138c2ecf20Sopenharmony_ci struct sja1105_key *key, unsigned long destports, 148c2ecf20Sopenharmony_ci bool append); 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ciint sja1105_vl_delete(struct sja1105_private *priv, int port, 178c2ecf20Sopenharmony_ci struct sja1105_rule *rule, 188c2ecf20Sopenharmony_ci struct netlink_ext_ack *extack); 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ciint sja1105_vl_gate(struct sja1105_private *priv, int port, 218c2ecf20Sopenharmony_ci struct netlink_ext_ack *extack, unsigned long cookie, 228c2ecf20Sopenharmony_ci struct sja1105_key *key, u32 index, s32 prio, 238c2ecf20Sopenharmony_ci u64 base_time, u64 cycle_time, u64 cycle_time_ext, 248c2ecf20Sopenharmony_ci u32 num_entries, struct action_gate_entry *entries); 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ciint sja1105_vl_stats(struct sja1105_private *priv, int port, 278c2ecf20Sopenharmony_ci struct sja1105_rule *rule, struct flow_stats *stats, 288c2ecf20Sopenharmony_ci struct netlink_ext_ack *extack); 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#else 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_cistatic inline int sja1105_vl_redirect(struct sja1105_private *priv, int port, 338c2ecf20Sopenharmony_ci struct netlink_ext_ack *extack, 348c2ecf20Sopenharmony_ci unsigned long cookie, 358c2ecf20Sopenharmony_ci struct sja1105_key *key, 368c2ecf20Sopenharmony_ci unsigned long destports, 378c2ecf20Sopenharmony_ci bool append) 388c2ecf20Sopenharmony_ci{ 398c2ecf20Sopenharmony_ci NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in"); 408c2ecf20Sopenharmony_ci return -EOPNOTSUPP; 418c2ecf20Sopenharmony_ci} 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_cistatic inline int sja1105_vl_delete(struct sja1105_private *priv, 448c2ecf20Sopenharmony_ci int port, struct sja1105_rule *rule, 458c2ecf20Sopenharmony_ci struct netlink_ext_ack *extack) 468c2ecf20Sopenharmony_ci{ 478c2ecf20Sopenharmony_ci NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in"); 488c2ecf20Sopenharmony_ci return -EOPNOTSUPP; 498c2ecf20Sopenharmony_ci} 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_cistatic inline int sja1105_vl_gate(struct sja1105_private *priv, int port, 528c2ecf20Sopenharmony_ci struct netlink_ext_ack *extack, 538c2ecf20Sopenharmony_ci unsigned long cookie, 548c2ecf20Sopenharmony_ci struct sja1105_key *key, u32 index, s32 prio, 558c2ecf20Sopenharmony_ci u64 base_time, u64 cycle_time, 568c2ecf20Sopenharmony_ci u64 cycle_time_ext, u32 num_entries, 578c2ecf20Sopenharmony_ci struct action_gate_entry *entries) 588c2ecf20Sopenharmony_ci{ 598c2ecf20Sopenharmony_ci NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in"); 608c2ecf20Sopenharmony_ci return -EOPNOTSUPP; 618c2ecf20Sopenharmony_ci} 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_cistatic inline int sja1105_vl_stats(struct sja1105_private *priv, int port, 648c2ecf20Sopenharmony_ci struct sja1105_rule *rule, 658c2ecf20Sopenharmony_ci struct flow_stats *stats, 668c2ecf20Sopenharmony_ci struct netlink_ext_ack *extack) 678c2ecf20Sopenharmony_ci{ 688c2ecf20Sopenharmony_ci NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in"); 698c2ecf20Sopenharmony_ci return -EOPNOTSUPP; 708c2ecf20Sopenharmony_ci} 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci#endif /* IS_ENABLED(CONFIG_NET_DSA_SJA1105_VL) */ 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci#endif /* _SJA1105_VL_H */ 75