]> www.infradead.org Git - users/hch/configfs.git/commit
net: dsa: lantiq_gswip: Consistently use macros for the mac bridge table
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Tue, 11 Jun 2024 13:54:31 +0000 (15:54 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 14 Jun 2024 00:07:11 +0000 (17:07 -0700)
commite6c34597f89ac98c06176eed57f125252015a330
treea49af557335e2e67f8ccc36ef797868ca718610f
parentc927b6e47b5cc7324217bf5fe7e6ccd0633971a0
net: dsa: lantiq_gswip: Consistently use macros for the mac bridge table

Only bits [5:0] in mac_bridge.key[3] are reserved for the FID.
Also, for dynamic (learned) entries, bits [7:4] in mac_bridge.val[0]
represents the port.

Introduce new macros GSWIP_TABLE_MAC_BRIDGE_KEY3_FID and
GSWIP_TABLE_MAC_BRIDGE_VAL0_PORT macro and use it throughout the driver.
Also rename and update GSWIP_TABLE_MAC_BRIDGE_VAL1_STATIC to use the
BIT() macro. This makes the driver code easier to understand.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20240611135434.3180973-10-ms@dev.tdt.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/lantiq_gswip.c