mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-23 00:21:14 +02:00
canbusload: Fix worst-case frame length estimation
The Tindell's method used previously is incorrect. It does not account for the fact that the stuffed bits are themselves also subject to bit stuffing. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
committed by
Marc Kleine-Budde
parent
2206f92de7
commit
d6b576c012
+1
-1
@@ -246,7 +246,7 @@ unsigned can_frame_length(struct canfd_frame *frame, enum cfl_mode mode, int mtu
|
||||
case CFL_NO_BITSTUFFING:
|
||||
return (eff ? 67 : 47) + frame->len * 8;
|
||||
case CFL_WORSTCASE:
|
||||
return ((eff ? 389 : 269) + frame->len * 48) / 5;
|
||||
return (eff ? 80 : 55) + frame->len * 10;
|
||||
case CFL_EXACT:
|
||||
return cfl_exact((struct can_frame*)frame);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user