]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: fix dynamic access to L2 Address Lookup table for SJA1110
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 27 Jun 2021 14:27:08 +0000 (17:27 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jun 2021 22:49:05 +0000 (15:49 -0700)
commitc088bf8a190d9c2613021fa93ee008826f3cbf8b
tree17195d7ce1e79453126e2526733b052e707fef30
parent8c201123c03c674f69271c297d4e254313d471a7
net: dsa: sja1105: fix dynamic access to L2 Address Lookup table for SJA1110

The SJA1105P/Q/R/S and SJA1110 may have the same layout for the command
to read/write/search for L2 Address Lookup entries, but as explained in
the comments at the beginning of the sja1105_dynamic_config.c file, the
command portion of the buffer is at the end, and we need to obtain a
pointer to it by adding the length of the entry to the buffer.

Alas, the length of an L2 Address Lookup entry is larger in SJA1110 than
it is for SJA1105P/Q/R/S, so we need to create a common helper to access
the command buffer, and this receives as argument the length of the
entry buffer.

Fixes: be1e663fa929 ("net: dsa: sja1105: add support for the SJA1110 switch family")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_dynamic_config.c