mirror of
https://github.com/torvalds/linux.git
synced 2026-05-21 21:37:25 +02:00
net: dsa: b53: prevent BRCM_HDR access on older devices
Older switches don't implement BRCM_HDR register so we should avoid reading or writing it. Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Link: https://patch.msgid.link/20250614080000.1884236-11-noltari@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
800728abd9
commit
e17813968b
|
|
@ -730,6 +730,11 @@ void b53_brcm_hdr_setup(struct dsa_switch *ds, int port)
|
|||
hdr_ctl |= GC_FRM_MGMT_PORT_M;
|
||||
b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, hdr_ctl);
|
||||
|
||||
/* B53_BRCM_HDR not present on devices with legacy tags */
|
||||
if (dev->tag_protocol == DSA_TAG_PROTO_BRCM_LEGACY ||
|
||||
dev->tag_protocol == DSA_TAG_PROTO_BRCM_LEGACY_FCS)
|
||||
return;
|
||||
|
||||
/* Enable Broadcom tags for IMP port */
|
||||
b53_read8(dev, B53_MGMT_PAGE, B53_BRCM_HDR, &hdr_ctl);
|
||||
if (tag_en)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user