1dfacc5a2SVladimir Oltean /* SPDX-License-Identifier: GPL-2.0 */
2*3c9cfb52SVladimir Oltean /* Copyright 2020 NXP
3dfacc5a2SVladimir Oltean */
4dfacc5a2SVladimir Oltean #ifndef _SJA1105_VL_H
5dfacc5a2SVladimir Oltean #define _SJA1105_VL_H
6dfacc5a2SVladimir Oltean
7eae9d3c0SVladimir Oltean #include "sja1105.h"
8eae9d3c0SVladimir Oltean
9dfacc5a2SVladimir Oltean #if IS_ENABLED(CONFIG_NET_DSA_SJA1105_VL)
10dfacc5a2SVladimir Oltean
11dfacc5a2SVladimir Oltean int sja1105_vl_redirect(struct sja1105_private *priv, int port,
12dfacc5a2SVladimir Oltean struct netlink_ext_ack *extack, unsigned long cookie,
13dfacc5a2SVladimir Oltean struct sja1105_key *key, unsigned long destports,
14dfacc5a2SVladimir Oltean bool append);
15dfacc5a2SVladimir Oltean
16dfacc5a2SVladimir Oltean int sja1105_vl_delete(struct sja1105_private *priv, int port,
17dfacc5a2SVladimir Oltean struct sja1105_rule *rule,
18dfacc5a2SVladimir Oltean struct netlink_ext_ack *extack);
19dfacc5a2SVladimir Oltean
20834f8933SVladimir Oltean int sja1105_vl_gate(struct sja1105_private *priv, int port,
21834f8933SVladimir Oltean struct netlink_ext_ack *extack, unsigned long cookie,
22834f8933SVladimir Oltean struct sja1105_key *key, u32 index, s32 prio,
23834f8933SVladimir Oltean u64 base_time, u64 cycle_time, u64 cycle_time_ext,
24834f8933SVladimir Oltean u32 num_entries, struct action_gate_entry *entries);
25834f8933SVladimir Oltean
26834f8933SVladimir Oltean int sja1105_vl_stats(struct sja1105_private *priv, int port,
27834f8933SVladimir Oltean struct sja1105_rule *rule, struct flow_stats *stats,
28834f8933SVladimir Oltean struct netlink_ext_ack *extack);
29834f8933SVladimir Oltean
30dfacc5a2SVladimir Oltean #else
31dfacc5a2SVladimir Oltean
sja1105_vl_redirect(struct sja1105_private * priv,int port,struct netlink_ext_ack * extack,unsigned long cookie,struct sja1105_key * key,unsigned long destports,bool append)32dfacc5a2SVladimir Oltean static inline int sja1105_vl_redirect(struct sja1105_private *priv, int port,
33dfacc5a2SVladimir Oltean struct netlink_ext_ack *extack,
34dfacc5a2SVladimir Oltean unsigned long cookie,
35dfacc5a2SVladimir Oltean struct sja1105_key *key,
36dfacc5a2SVladimir Oltean unsigned long destports,
37dfacc5a2SVladimir Oltean bool append)
38dfacc5a2SVladimir Oltean {
39dfacc5a2SVladimir Oltean NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
40dfacc5a2SVladimir Oltean return -EOPNOTSUPP;
41dfacc5a2SVladimir Oltean }
42dfacc5a2SVladimir Oltean
sja1105_vl_delete(struct sja1105_private * priv,int port,struct sja1105_rule * rule,struct netlink_ext_ack * extack)43dfacc5a2SVladimir Oltean static inline int sja1105_vl_delete(struct sja1105_private *priv,
44dfacc5a2SVladimir Oltean int port, struct sja1105_rule *rule,
45dfacc5a2SVladimir Oltean struct netlink_ext_ack *extack)
46dfacc5a2SVladimir Oltean {
47dfacc5a2SVladimir Oltean NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
48dfacc5a2SVladimir Oltean return -EOPNOTSUPP;
49dfacc5a2SVladimir Oltean }
50dfacc5a2SVladimir Oltean
sja1105_vl_gate(struct sja1105_private * priv,int port,struct netlink_ext_ack * extack,unsigned long cookie,struct sja1105_key * key,u32 index,s32 prio,u64 base_time,u64 cycle_time,u64 cycle_time_ext,u32 num_entries,struct action_gate_entry * entries)51834f8933SVladimir Oltean static inline int sja1105_vl_gate(struct sja1105_private *priv, int port,
52834f8933SVladimir Oltean struct netlink_ext_ack *extack,
53834f8933SVladimir Oltean unsigned long cookie,
54834f8933SVladimir Oltean struct sja1105_key *key, u32 index, s32 prio,
55834f8933SVladimir Oltean u64 base_time, u64 cycle_time,
56834f8933SVladimir Oltean u64 cycle_time_ext, u32 num_entries,
57834f8933SVladimir Oltean struct action_gate_entry *entries)
58834f8933SVladimir Oltean {
59834f8933SVladimir Oltean NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
60834f8933SVladimir Oltean return -EOPNOTSUPP;
61834f8933SVladimir Oltean }
62834f8933SVladimir Oltean
sja1105_vl_stats(struct sja1105_private * priv,int port,struct sja1105_rule * rule,struct flow_stats * stats,struct netlink_ext_ack * extack)63834f8933SVladimir Oltean static inline int sja1105_vl_stats(struct sja1105_private *priv, int port,
64834f8933SVladimir Oltean struct sja1105_rule *rule,
65834f8933SVladimir Oltean struct flow_stats *stats,
66834f8933SVladimir Oltean struct netlink_ext_ack *extack)
67834f8933SVladimir Oltean {
68834f8933SVladimir Oltean NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
69834f8933SVladimir Oltean return -EOPNOTSUPP;
70834f8933SVladimir Oltean }
71834f8933SVladimir Oltean
72dfacc5a2SVladimir Oltean #endif /* IS_ENABLED(CONFIG_NET_DSA_SJA1105_VL) */
73dfacc5a2SVladimir Oltean
74dfacc5a2SVladimir Oltean #endif /* _SJA1105_VL_H */
75