Commit Graph

1245 Commits (81dd2ff51122f9acac5fbc5b4932e3ec82f651e8)

Author SHA1 Message Date
Oliver Hartkopp 4d8b247258 asc2log: make use of sscanf consumed characters feature
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2025-01-24 14:48:32 +01:00
Oliver Hartkopp 0e9c53f6d3 asc2log: add CAN XL support for CAN XL message events
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2025-01-24 14:33:59 +01:00
Oliver Hartkopp 99c5c14790 can.h: canxl: support Remote Request Substitution bit access
The Remote Request Substitution bit is a dominant bit ("0") in the CAN XL
frame. As some CAN XL controllers support to access this bit a new
CANXL_RRS value has been defined for the canxl_frame.flags element.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2025-01-24 14:22:21 +01:00
Oliver Hartkopp df8e08fa70 asc2log: prepare helper functions for CAN XL frame handling
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2025-01-24 14:22:21 +01:00
Oliver Hartkopp cb5ab07f34 asc2log: handle and skip TxRq messages
TxRq messages are internal measurement messages that document the time of
a transmission request (to the CAN driver) to be checked against the real
transmission time, when the CAN message has been sent.

There is no such feature in the SocketCAN log format, so we detect this
tag but skip TxRq messages in the ASC log files.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2025-01-24 14:22:21 +01:00
Oliver Hartkopp 0e692bf42e asc2log: unify multi-line comments
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2025-01-24 14:21:59 +01:00
Marc Kleine-Budde 0984817438
Merge pull request #571 from marckleinebudde/cangen-canbusload
cangen, canbusload: new features
2025-01-22 15:54:06 +01:00
Zhu Yi b3da2f62b9 canbusload: support busload visualization
Add '-v' option for visualize busload, the output shows a moving
histogram of the past 90 seconds.

canbusload 2024-09-23 17:19:33 (exact bitstuffing)
 can0@500k   487   55558   31048       0  99% |XXXXXXXXXXXXXXXXXXX.|
100%|..........................................................................................
 95%|..............................................................................XXXXXXXXXXXX
 90%|.............................................................................XXXXXXXXXXXXX
 85%|.............................................................................XXXXXXXXXXXXX
 80%|.............................................................................XXXXXXXXXXXXX
 75%|.............................................................................XXXXXXXXXXXXX
 70%|.............................................................................XXXXXXXXXXXXX
 65%|.............................................................................XXXXXXXXXXXXX
 60%|............................................................................XXXXXXXXXXXXXX
 55%|............................................................................XXXXXXXXXXXXXX
 50%|............................................................................XXXXXXXXXXXXXX
 45%|............................................................................XXXXXXXXXXXXXX
 40%|............................................................................XXXXXXXXXXXXXX
 35%|.........................................XXX................................XXXXXXXXXXXXXX
 30%|.........................................XXXX...............................XXXXXXXXXXXXXX
 25%|........................................XXXXXX.............................XXXXXXXXXXXXXXX
 20%|XXXXXXXX...............................XXXXXXXXXXXXXXXXX....XXXXXXXXXXX...XXXXXXXXXXXXXXXX
 15%|XXXXXXXXX.............................XXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 10%|XXXXXXXXX.XXXXXXXXXXXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  5%|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Signed-off-by: Zhu Yi <yi.zhu5@cn.bosch.com>
Signed-off-by: Hubert Streidl <hubert.streidl@de.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Link: https://lore.kernel.org/r/20250120162332.19157-3-mark.jonas@de.bosch.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2025-01-20 18:07:16 +01:00
Zhu Yi b85418d75c canbusload: support busload statistic
Add '-s' option for display busload statistic, the output contains
minimal, maximum and exponentially-damped moving sums of one second
average (borrowed from Linux load average algorithm) since start or
reset (press 'r' while running).

canbusload 2024-09-23 17:15:18 (exact bitstuffing)
 can0@500k   942  107535   60168       0  18% min:  0%, max: 21%, load: 16%   6%   2% |XXX.................|

Signed-off-by: Zhu Yi <yi.zhu5@cn.bosch.com>
Signed-off-by: Hubert Streidl <hubert.streidl@de.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Link: https://lore.kernel.org/r/20250120162332.19157-2-mark.jonas@de.bosch.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2025-01-20 18:01:10 +01:00
Zhu Yi 6eb97b57c5 cangen: support socket priority
Add '-P' option for allow user to set the socket priority. This can be
useful in conjuction with queuing discipline.

Signed-off-by: Zhu Yi <yi.zhu5@cn.bosch.com>
Signed-off-by: Hubert Streidl <hubert.streidl@de.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Link: https://lore.kernel.org/r/20250120162332.19157-1-mark.jonas@de.bosch.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2025-01-20 18:01:10 +01:00
Marc Kleine-Budde fc1f6979c0
Merge pull request #568 from marckleinebudde/j1939
can-j1939-install-kernel-module: convert to Unix line endings and remove trailing whitespace
2024-12-11 15:02:35 +01:00
Marc Kleine-Budde 24e0c520b6 can-j1939-install-kernel-module: convert to Unix line endings and remove trailing whitespace 2024-12-11 15:01:58 +01:00
Marc Kleine-Budde 06561ac3dc
Merge pull request #566 from marckleinebudde/canfdtest
canfdtest: compare_frame: add 0x prefix to indicate hex value
2024-12-11 11:03:12 +01:00
Marc Kleine-Budde 7093a73185 canfdtest: compare_frame: add 0x prefix to indicate hex value 2024-12-11 10:24:33 +01:00
Marc Kleine-Budde 72f236e3ac
Merge pull request #565 from yegorich/fix-code-analysis-workflow
CI: fix codeql-analysis
2024-12-09 11:17:38 +01:00
Yegor Yefremov 3bbc8075eb CI: fix codeql-analysis
v1 is deprecated. Thus, use the latest version v3 instead.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2024-12-09 11:05:40 +01:00
Oliver Hartkopp 6526683a10
Merge pull request #556 from hartkopp/master
Fix and rework canbusload
2024-08-09 15:02:26 +02:00
Oliver Hartkopp dced0a6ec7 canbusload: fix and improve the bitrate output
With the introduction of CAN FD the bitrate has not been printed
correcty. Fix the CAN FD bitrate output and try to shrink the
bitrates by using kilo or Mega suffixes: 500000 -> 500k

Fixes: 6382765bf6 ("canbusload: count databitrate seperately")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-08 17:36:49 +02:00
Marc Kleine-Budde 6c36d44c83
Merge pull request #555 from marckleinebudde/readme-update-link
README: update link to kernel documentation
2024-08-08 14:14:10 +02:00
Marc Kleine-Budde 7260844b73 README: update link to kernel documentation
The can.txt is obsolete, move to rendered html instead.
2024-08-08 14:06:59 +02:00
Oliver Hartkopp be1fc77311 gitignore: add j1939-timedate-cli and j1939-timedate-srv
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-08 11:03:15 +02:00
Oliver Hartkopp fc2473424e canbusload: show RX/TX direction in bargraph
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-08 10:04:55 +02:00
Oliver Hartkopp 724e6f7c11 canbusload: use recvmsg() instead of recvfrom()
To access msg_flags for RX/TX direction detection.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-07 21:29:49 +02:00
Oliver Hartkopp 7665e1e236 canbusload: add auto detection of CAN interfaces
Rework to use a single CAN socket for the received CAN traffic.
This allows to shutdown and restart various CAN interfaces without
terminating the application.
Additionally an auto detection has been implemented with the 'any' CAN
interface. E.g. with any@500000,2000000 CAN interfaces that have not
been defined before are assigned with the given 'any' bitrates when a
CAN frame from this CAN interface has been received.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-07 19:57:08 +02:00
Oliver Hartkopp b592ec5b1f canbusload: fix string length check for CAN FD
The CAN interface description can now have two bitrates.
Extend the length check to handle the CAN FD data bitrate correctly.

Fixes: 6382765bf6 ("canbusload: count databitrate seperately")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-07 13:02:05 +02:00
Oliver Hartkopp 30b6b04053 isotpdump: add color support for functional addressing traffic
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-06 16:26:14 +02:00
chris 367e0df4aa isotpdump: option to capture functional addressing traffic
add option '-b' to capture functional broadcast data eg: -b 98DAFFF1 or -b 18DAFFF1
2024-08-06 16:12:18 +02:00
Oleksij Rempel 8a156fee19
Merge pull request #552 from pseiderer/ps-devel-fix-uclibc-compile-002
j1939acd: remove legacy '-p' option (prefix to use when logging)
2024-07-24 09:36:00 +02:00
Peter Seiderer a63bf468c2 j1939sr: remove legacy program_invocation_name/program_invocation_short_name code
- remove legacy program_invocation_name/program_invocation_short_name code

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
2024-07-22 16:18:21 +02:00
Peter Seiderer d337863d91 j1939acd: remove legacy '-p' option (prefix to use when logging)
- remove legacy '-p' option (prefix to use when logging), fixes uclibc
  compile

Fixes:

  j1939acd.c: In function 'main':
  j1939acd.c:489:38: error: passing argument 1 of 'asprintf' from incompatible pointer type [-Wincompatible-pointer-types]
    489 |                         if (asprintf(&program_invocation_name, "%s.%s",
        |                                      ^~~~~~~~~~~~~~~~~~~~~~~~
        |                                      |
        |                                      const char **

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
2024-07-22 16:14:48 +02:00
Marc Kleine-Budde 95fe6522c6
Merge pull request #548 from marckleinebudde/workflow-debian-experimental
github-actions: add debian:experimental
2024-06-20 09:05:12 +02:00
Marc Kleine-Budde fe514eedf8 github-actions: add debian:experimental 2024-06-20 08:41:48 +02:00
Marc Kleine-Budde 4eb72fd39a
Merge pull request #547 from vuquangtrong/master
asc2log::get_date check for AM in en_US time format
2024-06-12 08:58:32 +02:00
vuquangtrong 51b1f67851
asc2log::get_date check for AM in en_US time format 2024-06-12 13:48:53 +07:00
Marc Kleine-Budde 847486083a
Merge pull request #546 from marckleinebudde/activate-Wsign-compare
cmake: add -Wsign-compare
2024-06-07 13:22:32 +02:00
Marc Kleine-Budde f6db81da68 cmake: add -Wsign-compare 2024-06-07 09:58:13 +02:00
Oliver Hartkopp 15dbb474c7 j1939_timedate_cli: fix sign-compare warning
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-06-07 09:09:26 +02:00
Oliver Hartkopp 4b86049167 Makefile: add j1939 datetime tools
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-06-07 09:09:26 +02:00
Marc Kleine-Budde cf0091c90c
Merge pull request #524 from olerem/j1939-datetime-2024.05.15
Add support for the J1939 TimeDate services
2024-06-06 21:29:13 +02:00
Oleksij Rempel d0b04bd456 add j1939 datetime
Implement client and server side for SAE J1939-71:2002 - 5.3 pgn65254 -
Time/Date - TD.

Testing:
./j1939-timedate-srv -i vcan0 -a 0x70 &
./j1939-timedate-cli -i vcan0 -a 0x80 -r 0xff

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-06-06 13:54:26 +02:00
Oleksij Rempel af95ee0c6d move part of isobusfs code to the libj1939
Move part of isobusfs which can be reused by other applications to the
libj1939. By the way, reuse some of new libj1939 code in the j1939cat.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-06-06 13:53:19 +02:00
Oleksij Rempel 69c1e8289d add pr_err and pr_warn macros
This variant will be used in the j19393-timeday code.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-05-30 09:40:23 +02:00
Marc Kleine-Budde 72d097b2f9
Merge pull request #527 from marckleinebudde/buildsystems-cleanup
build-systems: remove autotools and Android.mk
2024-05-29 21:10:26 +02:00
Marc Kleine-Budde 97bfb2960a build-systems: remove autotools and Android.mk
Remove autotools and Android.mk support. This clauses less friction
when adding new tools.

Link: https://github.com/linux-can/can-utils/issues/526
2024-05-29 21:03:17 +02:00
Yegor Yefremov 8fdd8f9a5a github-actions: add workflow for NDK build
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2024-05-29 21:03:17 +02:00
Marc Kleine-Budde 4597b054e2 github-actions: add cross-compiling 2024-05-29 21:03:16 +02:00
Marc Kleine-Budde bc88e89caf github-actions: replace autotools by cmake 2024-05-29 21:02:59 +02:00
Marc Kleine-Budde db2fe6a605 travis.yml: remove
Travis is not used anymore.
2024-05-29 14:38:19 +02:00
Marc Kleine-Budde bfcf548f97
Merge pull request #542 from marckleinebudde/fix-compiler-errors
Fix compiler errors
2024-05-29 14:37:21 +02:00
Marc Kleine-Budde 1405a90e8b j1939spy: main(): fix shift-count-overflow error
Fix the following error, by converting recvflags into a 64 bit type.

| /home/j1939spy.c: In function 'main':
| /home/j1939spy.c:248:36: error: left shift count >= width of type [-Werror=shift-count-overflow]
|   248 |                 if (recvflags & (1 << SCM_TIMESTAMP)) {
|       |                                    ^~
2024-05-29 14:30:05 +02:00