summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bgmac-platform.c
diff options
context:
space:
mode:
authorSam Edwards <cfsworks@gmail.com>2024-10-03 23:23:01 +0200
committerJakub Kicinski <kuba@kernel.org>2024-10-05 01:16:15 +0200
commit41378cfdc47fdbfbf4358b85546f7c2f5f671534 (patch)
tree3e7564b3c3f129ebee4425eeb68e66dd8944af59 /drivers/net/ethernet/broadcom/bgmac-platform.c
parentMerge branch 'net-prepare-pacing-offload-support' (diff)
downloadlinux-41378cfdc47fdbfbf4358b85546f7c2f5f671534.tar.xz
linux-41378cfdc47fdbfbf4358b85546f7c2f5f671534.zip
net: dsa: bcm_sf2: fix crossbar port bitwidth logic
The SF2 crossbar register is a packed bitfield, giving the index of the external port selected for each of the internal ports. On BCM4908 (the only currently-supported switch family with a crossbar), there are 2 internal ports and 3 external ports, so there are 2 bits per internal port. The driver currently conflates the "bits per port" and "number of ports" concepts, lumping both into the `num_crossbar_int_ports` field. Since it is currently only possible for either of these counts to have a value of 2, there is no behavioral error resulting from this situation for now. Make the code more readable (and support the future possibility of larger crossbars) by adding a `num_crossbar_ext_bits` field to represent the "bits per port" count and relying on this where appropriate instead. Signed-off-by: Sam Edwards <CFSworks@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20241003212301.1339647-1-CFSworks@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bgmac-platform.c')
0 files changed, 0 insertions, 0 deletions