Skip to content

Commit 8e69c96

Browse files
CHKDSK88Paolo Abeni
authored andcommitted
net: dsa: vsc73xx: fix possible subblocks range of CAPT block
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: 05bd97f ("net: dsa: Add Vitesse VSC73xx DSA router driver") Signed-off-by: Pawel Dembicki <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 546ea84 commit 8e69c96

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/net/dsa/vitesse-vsc73xx-core.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#define VSC73XX_BLOCK_ANALYZER 0x2 /* Only subblock 0 */
3737
#define VSC73XX_BLOCK_MII 0x3 /* Subblocks 0 and 1 */
3838
#define VSC73XX_BLOCK_MEMINIT 0x3 /* Only subblock 2 */
39-
#define VSC73XX_BLOCK_CAPTURE 0x4 /* Only subblock 2 */
39+
#define VSC73XX_BLOCK_CAPTURE 0x4 /* Subblocks 0-4, 6, 7 */
4040
#define VSC73XX_BLOCK_ARBITER 0x5 /* Only subblock 0 */
4141
#define VSC73XX_BLOCK_SYSTEM 0x7 /* Only subblock 0 */
4242

@@ -410,13 +410,19 @@ int vsc73xx_is_addr_valid(u8 block, u8 subblock)
410410
break;
411411

412412
case VSC73XX_BLOCK_MII:
413-
case VSC73XX_BLOCK_CAPTURE:
414413
case VSC73XX_BLOCK_ARBITER:
415414
switch (subblock) {
416415
case 0 ... 1:
417416
return 1;
418417
}
419418
break;
419+
case VSC73XX_BLOCK_CAPTURE:
420+
switch (subblock) {
421+
case 0 ... 4:
422+
case 6 ... 7:
423+
return 1;
424+
}
425+
break;
420426
}
421427

422428
return 0;

0 commit comments

Comments
 (0)