sja1105_dynamic_config.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (c) 2019, Vladimir Oltean <olteanv@gmail.com>
  3. */
  4. #ifndef _SJA1105_DYNAMIC_CONFIG_H
  5. #define _SJA1105_DYNAMIC_CONFIG_H
  6. #include "sja1105.h"
  7. #include <linux/packing.h>
  8. /* Special index that can be used for sja1105_dynamic_config_read */
  9. #define SJA1105_SEARCH -1
  10. struct sja1105_dyn_cmd;
  11. struct sja1105_dynamic_table_ops {
  12. /* This returns size_t just to keep same prototype as the
  13. * static config ops, of which we are reusing some functions.
  14. */
  15. size_t (*entry_packing)(void *buf, void *entry_ptr, enum packing_op op);
  16. void (*cmd_packing)(void *buf, struct sja1105_dyn_cmd *cmd,
  17. enum packing_op op);
  18. size_t max_entry_count;
  19. size_t packed_size;
  20. u64 addr;
  21. u8 access;
  22. };
  23. struct sja1105_mgmt_entry {
  24. u64 tsreg;
  25. u64 takets;
  26. u64 macaddr;
  27. u64 destports;
  28. u64 enfport;
  29. u64 index;
  30. };
  31. extern const struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN];
  32. extern const struct sja1105_dynamic_table_ops sja1105pqrs_dyn_ops[BLK_IDX_MAX_DYN];
  33. extern const struct sja1105_dynamic_table_ops sja1110_dyn_ops[BLK_IDX_MAX_DYN];
  34. #endif