sja1105_vl.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright 2020 NXP
  3. */
  4. #ifndef _SJA1105_VL_H
  5. #define _SJA1105_VL_H
  6. #include "sja1105.h"
  7. #if IS_ENABLED(CONFIG_NET_DSA_SJA1105_VL)
  8. int sja1105_vl_redirect(struct sja1105_private *priv, int port,
  9. struct netlink_ext_ack *extack, unsigned long cookie,
  10. struct sja1105_key *key, unsigned long destports,
  11. bool append);
  12. int sja1105_vl_delete(struct sja1105_private *priv, int port,
  13. struct sja1105_rule *rule,
  14. struct netlink_ext_ack *extack);
  15. int sja1105_vl_gate(struct sja1105_private *priv, int port,
  16. struct netlink_ext_ack *extack, unsigned long cookie,
  17. struct sja1105_key *key, u32 index, s32 prio,
  18. u64 base_time, u64 cycle_time, u64 cycle_time_ext,
  19. u32 num_entries, struct action_gate_entry *entries);
  20. int sja1105_vl_stats(struct sja1105_private *priv, int port,
  21. struct sja1105_rule *rule, struct flow_stats *stats,
  22. struct netlink_ext_ack *extack);
  23. #else
  24. static inline int sja1105_vl_redirect(struct sja1105_private *priv, int port,
  25. struct netlink_ext_ack *extack,
  26. unsigned long cookie,
  27. struct sja1105_key *key,
  28. unsigned long destports,
  29. bool append)
  30. {
  31. NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
  32. return -EOPNOTSUPP;
  33. }
  34. static inline int sja1105_vl_delete(struct sja1105_private *priv,
  35. int port, struct sja1105_rule *rule,
  36. struct netlink_ext_ack *extack)
  37. {
  38. NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
  39. return -EOPNOTSUPP;
  40. }
  41. static inline int sja1105_vl_gate(struct sja1105_private *priv, int port,
  42. struct netlink_ext_ack *extack,
  43. unsigned long cookie,
  44. struct sja1105_key *key, u32 index, s32 prio,
  45. u64 base_time, u64 cycle_time,
  46. u64 cycle_time_ext, u32 num_entries,
  47. struct action_gate_entry *entries)
  48. {
  49. NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
  50. return -EOPNOTSUPP;
  51. }
  52. static inline int sja1105_vl_stats(struct sja1105_private *priv, int port,
  53. struct sja1105_rule *rule,
  54. struct flow_stats *stats,
  55. struct netlink_ext_ack *extack)
  56. {
  57. NL_SET_ERR_MSG_MOD(extack, "Virtual Links not compiled in");
  58. return -EOPNOTSUPP;
  59. }
  60. #endif /* IS_ENABLED(CONFIG_NET_DSA_SJA1105_VL) */
  61. #endif /* _SJA1105_VL_H */