mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 17:35:20 +02:00
net: dsa: vsc73xx: fix possible subblocks range of CAPT block
[ Upstream commit8e69c96df7
] CAPT block (CPU Capture Buffer) have 7 sublocks: 0-3, 4, 6, 7. Function 'vsc73xx_is_addr_valid' allows to use only block 0 at this moment. This patch fix it. Fixes:05bd97fc55
("net: dsa: Add Vitesse VSC73xx DSA router driver") Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20240903203340.1518789-1-paweldembicki@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c6c535a444
commit
97d6274615
|
@ -34,7 +34,7 @@
|
|||
#define VSC73XX_BLOCK_ANALYZER 0x2 /* Only subblock 0 */
|
||||
#define VSC73XX_BLOCK_MII 0x3 /* Subblocks 0 and 1 */
|
||||
#define VSC73XX_BLOCK_MEMINIT 0x3 /* Only subblock 2 */
|
||||
#define VSC73XX_BLOCK_CAPTURE 0x4 /* Only subblock 2 */
|
||||
#define VSC73XX_BLOCK_CAPTURE 0x4 /* Subblocks 0-4, 6, 7 */
|
||||
#define VSC73XX_BLOCK_ARBITER 0x5 /* Only subblock 0 */
|
||||
#define VSC73XX_BLOCK_SYSTEM 0x7 /* Only subblock 0 */
|
||||
|
||||
|
@ -370,13 +370,19 @@ int vsc73xx_is_addr_valid(u8 block, u8 subblock)
|
|||
break;
|
||||
|
||||
case VSC73XX_BLOCK_MII:
|
||||
case VSC73XX_BLOCK_CAPTURE:
|
||||
case VSC73XX_BLOCK_ARBITER:
|
||||
switch (subblock) {
|
||||
case 0 ... 1:
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case VSC73XX_BLOCK_CAPTURE:
|
||||
switch (subblock) {
|
||||
case 0 ... 4:
|
||||
case 6 ... 7:
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user