linux-stable/drivers/net/dsa
Vladimir Oltean 96c85f51f1 net: dsa: sja1105: some table entries are always present when read dynamically
The SJA1105 has a static configuration comprised of a number of tables
with entries. Some of these can be read and modified at runtime as well,
through the dynamic configuration interface.

As a careful reader can notice from the comments in this file, the
software interface for accessing a table entry through the dynamic
reconfiguration is a bit of a no man's land, and varies wildly across
switch generations and even from one kind of table to another.

I have tried my best to come up with a software representation of a
'common denominator' SPI command to access a table entry through the
dynamic configuration interface:

struct sja1105_dyn_cmd {
	bool search;
	u64 valid; /* must be set to 1 */
	u64 rdwrset; /* 0 to read, 1 to write */
	u64 errors;
	u64 valident; /* 0 if entry is invalid, 1 if valid */
	u64 index;
};

Relevant to this patch is the VALIDENT bit, which for READ commands is
populated by the switch and lets us know if we're looking at junk or at
a real table entry.

In SJA1105, the dynamic reconfiguration interface for management routes
has notably not implemented the VALIDENT bit, leading to a workaround to
ignore this field in sja1105_dynamic_config_read(), as it will be set to
zero, but the data is valid nonetheless.

In SJA1110, this pattern has sadly been abused to death, and while there
are many more tables which can be read back over the dynamic config
interface compared to SJA1105, their handling isn't in any way more
uniform. Generally speaking, if there is a single possible entry in a
given table, and loading that table in the static config is mandatory as
per the documentation, then the VALIDENT bit is deemed as redundant and
more than likely not implemented.

So it is time to make the workaround more official, and add a bit to the
flags implemented by dynamic config tables. It will be used by more
tables when SJA1110 support arrives.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-05-31 22:40:26 -07:00
..
b53 net: dsa: b53: spi: add missing MODULE_DEVICE_TABLE 2021-03-25 17:11:22 -07:00
hirschmann net: dsa: no longer clone skb in core driver 2021-04-27 14:10:15 -07:00
microchip net: dsa: microchip: enable phy errata workaround on 9567 2021-05-24 14:27:18 -07:00
mv88e6xxx net: dsa: no longer clone skb in core driver 2021-04-27 14:10:15 -07:00
ocelot net: dsa: felix: re-enable TAS guard band mode 2021-05-10 14:48:55 -07:00
qca net: dsa: set configure_vlan_while_not_filtering to true by default 2021-01-15 17:29:40 -08:00
sja1105 net: dsa: sja1105: some table entries are always present when read dynamically 2021-05-31 22:40:26 -07:00
xrs700x net: dsa: xrs700x: check if partner is same as port in hsr join 2021-03-09 16:03:37 -08:00
Kconfig dsa: simplify Kconfig symbols and dependencies 2021-03-22 12:15:37 -07:00
Makefile net: dsa: add Arrow SpeedChips XRS700x driver 2021-01-15 15:37:37 -08:00
bcm_sf2.c net: dsa: bcm_sf2: Fix bcm_sf2_reg_rgmii_cntrl() call for non-RGMII port 2021-05-21 14:18:34 -07:00
bcm_sf2.h net: dsa: bcm_sf2: setup BCM4908 internal crossbar 2021-03-12 17:06:37 -08:00
bcm_sf2_cfp.c net: dsa: propagate extack to .port_vlan_add 2021-02-14 17:38:11 -08:00
bcm_sf2_regs.h net: dsa: bcm_sf2: fix BCM4908 RGMII reg(s) 2021-03-18 14:44:05 -07:00
dsa_loop.c net: dsa: propagate extack to .port_vlan_filtering 2021-02-14 17:38:12 -08:00
dsa_loop.h
dsa_loop_bdinfo.c
lan9303-core.c net: dsa: remove the transactional logic from MDB entries 2021-01-11 16:00:57 -08:00
lan9303.h
lan9303_i2c.c
lan9303_mdio.c
lantiq_gswip.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-04-09 20:48:35 -07:00
lantiq_pce.h
mt7530.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-05-27 09:55:10 -07:00
mt7530.h net: dsa: mt7530: add interrupt support 2021-05-19 13:27:42 -07:00
mv88e6060.c
mv88e6060.h
qca8k.c net: dsa: qca8k: add missing check return value in qca8k_phylink_mac_config() 2021-05-30 14:22:31 -07:00
qca8k.h net: dsa: qca8k: add support for internal phy and internal mdio 2021-05-14 15:30:22 -07:00
realtek-smi-core.c net: dsa: rtl8366rb: Roof MTU for switch 2020-10-10 11:25:05 -07:00
realtek-smi-core.h net: dsa: propagate extack to .port_vlan_filtering 2021-02-14 17:38:12 -08:00
rtl8366.c net: dsa: propagate extack to .port_vlan_filtering 2021-02-14 17:38:12 -08:00
rtl8366rb.c net: dsa: rtl8366rb: standardize init jam tables 2021-01-27 20:21:20 -08:00
vitesse-vsc73xx-core.c net: dsa: vsc73xx: make the MTU configurable 2020-03-27 16:07:25 -07:00
vitesse-vsc73xx-platform.c net: dsa: vitesse-vsc73xx: Convert to plain comments to avoid kerneldoc warnings 2020-07-05 15:49:03 -07:00
vitesse-vsc73xx-spi.c net: dsa: vitesse-vsc73xx: Convert to plain comments to avoid kerneldoc warnings 2020-07-05 15:49:03 -07:00
vitesse-vsc73xx.h