Commit Graph

19 Commits (6382765bf6aea0aef6df2329954c85c0758f5097)

Author SHA1 Message Date
Kurt Van Dijck 6382765bf6 canbusload: count databitrate seperately
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
2021-06-24 14:44:50 +02:00
Kurt Van Dijck e319afb10f canbusload: count full payload for CANFD frames
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
2021-06-24 12:47:37 +02:00
Rosen Penev b153fe3f35
clang-tidy: sort includes alphabetically
Found with llvm-include-order

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 23:28:58 -07:00
Gary Bisson 46895a41c5 Fix comparison type mismatch warnings
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
2020-05-28 20:54:37 +02:00
Alexander Gerasiov 69865c8247 canbusload.c: Reformat help/usage output to be compatible with help2man.
Signed-off-by: Alexander Gerasiov <gq@debian.org>

Gbp-Pq: Name 0002-canbusload.c-Reformat-help-usage-output-to-be-compat.patch
2020-04-27 08:20:08 +03:00
Yegor Yefremov 14ccc06eba Fix spelling in various files
codespell parameters:

codespell -q 3 --skip="*.in,*.sh,*.m4,config,configure,autom4te.cache"

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-11-11 14:21:49 +01:00
Yegor Yefremov 7b7331976a Add SPDX identifiers
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-06-19 12:24:24 +02:00
Frank Theile f51c897d68
Consistent arguments to sizeof().
In calls to functions taking a pointer 'p' and a length 'l':
if a struct variable v is passed in for p, then also pass sizeof(v) for
l.
2018-04-03 11:56:28 +02:00
Oliver Hartkopp 110af11db1 canbusload: print bitstuffing mode when showing current time is enabled
When printing the current time on the first line the bitstuffing mode is
displayed depending on the command line settings.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2014-02-01 21:30:12 +01:00
Michal Sojka 2206f92de7 canbusload: Add exact CAN frame length calculation (including bitstuffing)
This adds an algorithm for calculating the exact number of bits a CAN
frame occupies on the bus and uses this algorithm in canbusload. It
also moves the other methods for CAN frame length calculation, already
present in canbusload, to the new file.

The added algorithm calculates the exact number of stuffed bit in a
CAN frame. Note that in order to calculate that correctly, we must
also know the frame's CRC. Hence, the algorithm also includes CRC
calculation routine.

The correctness of the algorithm was verified on an oscilloscope for
several different SFF and EFF frames.

Currently only CAN frames are supported. For CANFD frames, a different
algorithm is needed. CANFD uses different CRC polynomials and
calculates the CRC from the staffed bit-stream (CAN calculates CRC
from de-stuffed bit-stream).

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2014-01-30 16:23:25 +01:00
Uwe Kleine-König 4ddde7b966 trivial: fix typo concerning "bandwidth"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2014-01-23 21:25:15 +01:00
Oliver Hartkopp 836d3cc012 remove obsolete SVN ID tags
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2012-11-14 20:57:16 +01:00
Oliver Hartkopp 5077515927 adapt column width format for high busload values 2012-03-08 19:32:45 +01:00
Marc Kleine-Budde 722a09116d treewide: replace berlios contact email by linux-can@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-01-11 12:14:15 +01:00
Kurt Van Dijck a4c200efe6 canbusload: flush output at the end of each cycle
When canbusload is piped to another program, the output
is queued for several cycles. This patch will flush the output
explicitely.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
2012-01-10 17:41:07 +01:00
Oliver Hartkopp d7fe33eb4b Fixed calculation of needed bits on the physical wire according Ken Tindells
*worst* case calculation for stuff-bits.
(see "Guaranteeing Message Latencies on Controller Area Network" 1st ICC'94)
Due to the bitstuffing estimation the calculated busload may exceed 100%.
2010-09-24 17:56:53 +00:00
Oliver Hartkopp 5655d53acb Remove compiler warning :
warning: suggest explicit braces to avoid ambiguous ‘else’
2010-05-14 12:50:17 +00:00
Oliver Hartkopp adbe6f9bee Whitespace fixes. Indented the code following Linux styleguide to fix
the mess between tabs and spaces.
2008-06-03 08:46:57 +00:00
Oliver Hartkopp 789a021bb9 Added tiny tool to measure CAN busload. 2008-05-27 13:47:20 +00:00