net: dsa: mv88e6xxx: use mv88e6185_g1_vtu_getnext() for the 6250
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Mon, 25 Jan 2021 15:04:48 +0000 (16:04 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 27 Jan 2021 01:58:28 +0000 (17:58 -0800)
commit67c9ed1c8809d554082a30a1b38b460a6e8405c0
tree308ec9064b0030a47c6359bc1cbdaa60f770ef78
parent9b0b7837b9f1b29e89de8c5e321dc94601fda4b5
net: dsa: mv88e6xxx: use mv88e6185_g1_vtu_getnext() for the 6250

mv88e6250_g1_vtu_getnext is almost identical to
mv88e6185_g1_vtu_getnext, except for the 6250 only having 64 databases
instead of 256. We can reduce code duplication by simply masking off
the extra two garbage bits when assembling the fid from VTU op [3:0]
and [11:8].

Reviewed-by: Tobias Waldekranz <tobias@waldekranz.com>
Tested-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/mv88e6xxx/global1.h
drivers/net/dsa/mv88e6xxx/global1_vtu.c