0001
0002
0003
0004 #ifndef _SJA1105_VL_H
0005 #define _SJA1105_VL_H
0006
0007 #include "sja1105.h"
0008
0009 #if IS_ENABLED(CONFIG_NET_DSA_SJA1105_VL)
0010
0011 int sja1105_vl_redirect(struct sja1105_private *priv, int port,
0012 struct netlink_ext_ack *extack, unsigned long cookie,
0013 struct sja1105_key *key, unsigned long destports,
0014 bool append);
0015
0016 int sja1105_vl_delete(struct sja1105_private *priv, int port,
0017 struct sja1105_rule *rule,
0018 struct netlink_ext_ack *extack);
0019
0020 int sja1105_vl_gate(struct sja1105_private *priv, int port,
0021 struct netlink_ext_ack *extack, unsigned long cookie,
0022 struct sja1105_key *key, u32 index, s32 prio,
0023 u64 base_time, u64 cycle_time, u64 cycle_time_ext,
0024 u32 num_entries, struct action_gate_entry *entries);
0025
0026 int sja1105_vl_stats(struct sja1105_private *priv, int port,
0027 struct sja1105_rule *rule, struct flow_stats *stats,
0028 struct netlink_ext_ack *extack);
0029
0030 #else
0031
0032 static inline int sja1105_vl_redirect(struct sja1105_private *priv, int port,
0033 struct netlink_ext_ack *extack,
0034 unsigned long cookie,
0035 struct sja1105_key *key,
0036 unsigned long destports,
0037 bool append)
0038 {
0039 NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
0040 return -EOPNOTSUPP;
0041 }
0042
0043 static inline int sja1105_vl_delete(struct sja1105_private *priv,
0044 int port, struct sja1105_rule *rule,
0045 struct netlink_ext_ack *extack)
0046 {
0047 NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
0048 return -EOPNOTSUPP;
0049 }
0050
0051 static inline int sja1105_vl_gate(struct sja1105_private *priv, int port,
0052 struct netlink_ext_ack *extack,
0053 unsigned long cookie,
0054 struct sja1105_key *key, u32 index, s32 prio,
0055 u64 base_time, u64 cycle_time,
0056 u64 cycle_time_ext, u32 num_entries,
0057 struct action_gate_entry *entries)
0058 {
0059 NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
0060 return -EOPNOTSUPP;
0061 }
0062
0063 static inline int sja1105_vl_stats(struct sja1105_private *priv, int port,
0064 struct sja1105_rule *rule,
0065 struct flow_stats *stats,
0066 struct netlink_ext_ack *extack)
0067 {
0068 NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
0069 return -EOPNOTSUPP;
0070 }
0071
0072 #endif
0073
0074 #endif