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);
}
/**
* Frame length calculation modes.
*
- * CFL_WORSTCASE corresponds to Ken Tindells *worst* case calculation
- * for stuff-bits (see "Guaranteeing Message Latencies on Controller
- * Area Network" 1st ICC'94) the needed bits on the wire can be
- * calculated as:
+ * CFL_WORSTCASE corresponds to *worst* case calculation for
+ * stuff-bits - see (1)-(3) in [1]. The worst case number of bits on
+ * the wire can be calculated as:
*
- * (34 + 8n)/5 + 47 + 8n for SFF frames (11 bit CAN-ID) => (269 + 48n)/5
- * (54 + 8n)/5 + 67 + 8n for EFF frames (29 bit CAN-ID) => (389 + 48n)/5
+ * (34 + 8n - 1)/4 + 34 + 8n + 13 for SFF frames (11 bit CAN-ID) => 55 + 10n
+ * (54 + 8n - 1)/4 + 54 + 8n + 13 for EFF frames (29 bit CAN-ID) => 80 + 10n
*
* while 'n' is the data length code (number of payload bytes)
*
+ * [1] "Controller Area Network (CAN) schedulability analysis:
+ * Refuted, revisited and revised", Real-Time Syst (2007)
+ * 35:239-272.
+ *
*/
enum cfl_mode {
CFL_NO_BITSTUFFING, /* plain bit calculation without bitstuffing */
- CFL_WORSTCASE, /* with bitstuffing following Tindells estimation */
+ CFL_WORSTCASE, /* worst case estimation - see above */
CFL_EXACT, /* exact calculation of stuffed bits based on frame
* content and CRC */
};