xref: /linux/drivers/net/dsa/sja1105/sja1105_dynamic_config.h (revision d2912cb15bdda8ba4a5dd73396ad62641af2f520)
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 
7 #include "sja1105.h"
8 #include <linux/packing.h>
9 
10 struct sja1105_dyn_cmd {
11 	u64 valid;
12 	u64 rdwrset;
13 	u64 errors;
14 	u64 valident;
15 	u64 index;
16 };
17 
18 struct sja1105_dynamic_table_ops {
19 	/* This returns size_t just to keep same prototype as the
20 	 * static config ops, of which we are reusing some functions.
21 	 */
22 	size_t (*entry_packing)(void *buf, void *entry_ptr, enum packing_op op);
23 	void (*cmd_packing)(void *buf, struct sja1105_dyn_cmd *cmd,
24 			    enum packing_op op);
25 	size_t max_entry_count;
26 	size_t packed_size;
27 	u64 addr;
28 	u8 access;
29 };
30 
31 struct sja1105_mgmt_entry {
32 	u64 tsreg;
33 	u64 takets;
34 	u64 macaddr;
35 	u64 destports;
36 	u64 enfport;
37 	u64 index;
38 };
39 
40 extern struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN];
41 extern struct sja1105_dynamic_table_ops sja1105pqrs_dyn_ops[BLK_IDX_MAX_DYN];
42 
43 #endif
44