diff options
author | Vladimir Oltean | 2019-05-02 22:23:30 +0200 |
---|---|---|
committer | David S. Miller | 2019-05-03 16:49:17 +0200 |
commit | 8aa9ebccae87621d997707e4f25e53fddd7e30e4 (patch) | |
tree | 31fca4070adc3ba2cd7f17f84838f73d7fac95d8 /drivers/net/dsa/sja1105/sja1105_dynamic_config.h | |
parent | lib: Add support for generic packing operations (diff) | |
download | kernel-qcow2-linux-8aa9ebccae87621d997707e4f25e53fddd7e30e4.tar.gz kernel-qcow2-linux-8aa9ebccae87621d997707e4f25e53fddd7e30e4.tar.xz kernel-qcow2-linux-8aa9ebccae87621d997707e4f25e53fddd7e30e4.zip |
net: dsa: Introduce driver for NXP SJA1105 5-port L2 switch
At this moment the following is supported:
* Link state management through phylib
* Autonomous L2 forwarding managed through iproute2 bridge commands.
IP termination must be done currently through the master netdevice,
since the switch is unmanaged at this point and using
DSA_TAG_PROTO_NONE.
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Georg Waibel <georg.waibel@sensor-technik.de>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/sja1105/sja1105_dynamic_config.h')
-rw-r--r-- | drivers/net/dsa/sja1105/sja1105_dynamic_config.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/net/dsa/sja1105/sja1105_dynamic_config.h b/drivers/net/dsa/sja1105/sja1105_dynamic_config.h new file mode 100644 index 000000000000..77be59546a55 --- /dev/null +++ b/drivers/net/dsa/sja1105/sja1105_dynamic_config.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2019, Vladimir Oltean <olteanv@gmail.com> + */ +#ifndef _SJA1105_DYNAMIC_CONFIG_H +#define _SJA1105_DYNAMIC_CONFIG_H + +#include "sja1105.h" +#include <linux/packing.h> + +struct sja1105_dyn_cmd { + u64 valid; + u64 rdwrset; + u64 errors; + u64 valident; + u64 index; +}; + +struct sja1105_dynamic_table_ops { + /* This returns size_t just to keep same prototype as the + * static config ops, of which we are reusing some functions. + */ + size_t (*entry_packing)(void *buf, void *entry_ptr, enum packing_op op); + void (*cmd_packing)(void *buf, struct sja1105_dyn_cmd *cmd, + enum packing_op op); + size_t max_entry_count; + size_t packed_size; + u64 addr; + u8 access; +}; + +struct sja1105_mgmt_entry { + u64 tsreg; + u64 takets; + u64 macaddr; + u64 destports; + u64 enfport; + u64 index; +}; + +extern struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN]; +extern struct sja1105_dynamic_table_ops sja1105pqrs_dyn_ops[BLK_IDX_MAX_DYN]; + +#endif |