1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2019, Vladimir Oltean <olteanv@gmail.com>
4 #ifndef _SJA1105_DYNAMIC_CONFIG_H
5 #define _SJA1105_DYNAMIC_CONFIG_H
8 #include <linux/packing.h>
10 /* Special index that can be used for sja1105_dynamic_config_read */
11 #define SJA1105_SEARCH -1
13 struct sja1105_dyn_cmd
;
15 struct sja1105_dynamic_table_ops
{
16 /* This returns size_t just to keep same prototype as the
17 * static config ops, of which we are reusing some functions.
19 size_t (*entry_packing
)(void *buf
, void *entry_ptr
, enum packing_op op
);
20 void (*cmd_packing
)(void *buf
, struct sja1105_dyn_cmd
*cmd
,
22 size_t max_entry_count
;
28 struct sja1105_mgmt_entry
{
37 extern const struct sja1105_dynamic_table_ops sja1105et_dyn_ops
[BLK_IDX_MAX_DYN
];
38 extern const struct sja1105_dynamic_table_ops sja1105pqrs_dyn_ops
[BLK_IDX_MAX_DYN
];
39 extern const struct sja1105_dynamic_table_ops sja1110_dyn_ops
[BLK_IDX_MAX_DYN
];