Commit Graph

1040 Commits (42edaeaf52fdfa6af250030d5ca9e3be14764b29)

Author SHA1 Message Date
Marc Kleine-Budde 9e5b6266b1
Merge pull request #330 from marckleinebudde/fix-types
testj1939: fix 64-bit types for some platforms
2022-01-03 10:47:39 +01:00
Rosen Penev e370ad5256 testj1939: fix 64-bit types for some platforms
Revert commit that introduced PRIx64 to print an __u64, and added
define to get the same types on all platforms.

With __SANE_USERSPACE_TYPES__ the Linux headers use an unsigned long
long for __u64 on all platforms, especially MIPS64.

Fixes: eb9cfac954 ("use PRIx64")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2022-01-03 10:44:29 +01:00
Marc Kleine-Budde fd1d61490c
Merge pull request #328 from marckleinebudde/fix-musl
CMakeLists: unconditionally define _GNU_SOURCE
2021-12-30 13:00:59 +01:00
Marc Kleine-Budde da642181a9 CMakeLists: unconditionally define _GNU_SOURCE
This fixes compilation on musl libc.

Link: https://github.com/linux-can/can-utils/pull/326
Reported-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-12-30 12:57:12 +01:00
Marc Kleine-Budde 6bd7ced052
Merge pull request #325 from neheb/patch-1
mcp251xfd: add missing libgen.h header
2021-12-16 10:05:09 +01:00
Marc Kleine-Budde 9ca68a12c7
Merge pull request #327 from neheb/patch-3
use PRIx64
2021-12-16 10:04:04 +01:00
Rosen Penev eb9cfac954
use PRIx64
This is the proper specifier for uint64_t.
2021-12-15 18:08:13 -08:00
Rosen Penev 7dd714907b
mcp251xfd: add missing libgen.h header
Needed for the basename() function under musl.
2021-12-15 18:00:39 -08:00
Oliver Hartkopp a705182b28 candump: trivial typo exchange sentence point with closing bracket
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2021-11-28 20:14:43 +01:00
Oliver Hartkopp 0d84033fa4 canplayer: introduce option to limit the number of processed frames
Analogue to the '-n <count>' option to limit the number of processed CAN
frames in candump and cangen this option makes sense in canplayer too.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2021-10-30 13:02:42 +02:00
Marc Kleine-Budde ab9bd4f287
Merge pull request #318 from jgressma/feat/canfdtest-custom-can-ids-squashed
canfdtest: enables program use alongside existing CAN bus traffic
2021-10-25 15:33:09 +02:00
Jean Gressmann 2dde06801a canfdtest: adds support for custom CAN IDs
This change enables the use of this app alongside the traffic
typically found on a CAN bus.
2021-10-25 11:20:58 +02:00
Marc Kleine-Budde 607b643e0f
Merge pull request #319 from marckleinebudde/fix-j1939cat
j1939cat: properly fix printf format string to work both on 32 and 64 bit systems
2021-10-21 11:24:12 +02:00
Marc Kleine-Budde eb0eb78896 j1939cat: properly fix printf format string to work both on 32 and 64 bit systems
Fixes: 7b8457ce9f ("j1939cat: fix long long unsigned int warning in x_name printf")
Fixes: cc155d2f63 ("j1939cat: make use of new RX UAPI")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-10-21 11:20:12 +02:00
Oliver Hartkopp 0edab8a402 cangen: improve help text to point out decimal places for the gap value
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2021-10-20 06:12:27 +02:00
Oliver Hartkopp 622fcbb9b3 Makefile: remove obsolete requirements for lib.h
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2021-10-19 08:57:22 +02:00
Marc Kleine-Budde 02e8b1ff39
Merge pull request #316 from Rubusch/lothar/cansniffer
cansniffer: fix detection of invalid provided CAN interface, refacs
2021-10-19 08:43:20 +02:00
Lothar Rubusch 9fd2b2e617 Makefile: clean mcp251xfd/*.o
make distclean depend on clean target in Makefile

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
2021-10-18 22:30:21 +01:00
Lothar Rubusch 8bf57429fc cansniffer: simplify conditional cases
refactoring, reduce some levels of indention

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
2021-10-18 22:30:21 +01:00
Lothar Rubusch 93a6cd6dfb cansniffer: simplify, avoiding else case indention
refactoring

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
2021-10-18 22:08:44 +01:00
Lothar Rubusch d9368a6003 cansniffer: simplify logic
refactoring

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
2021-10-18 22:08:05 +01:00
Lothar Rubusch c36bdc743f cansniffer: fix warning on unused variable
make use of former (not really) used "ret" in main()

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
2021-10-18 22:02:21 +01:00
Oliver Hartkopp f7307b8290 can-utils: check for return values of if_nametoindex()
if_nametoindex() returns zero and a specific errno in the case the network
interface does not exist. The missing check leads to the use of the 'any'
CAN device but leaves the user alone as the user gets no error message.

Reported-by: Lothar Rubusch <lotophagon@protonmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2021-10-18 09:37:46 +02:00
Marc Kleine-Budde 5a3d1703d2
Merge pull request #314 from gibsson/master
j1939cat: fix comparison signs issue
2021-10-13 16:48:40 +02:00
Gary Bisson 57cc73d413 j1939cat: fix comparison signs issue
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
2021-10-13 16:32:32 +02:00
Marc Kleine-Budde 4236614ab6
Merge pull request #315 from marckleinebudde/can-calc-bit-timing
can-calc-bit-timing: can_fixup_bittiming(): change type of tseg1 and alltseg to unsigned int
2021-10-13 15:25:26 +02:00
Marc Kleine-Budde e03f3e1049 can-calc-bit-timing: can_fixup_bittiming(): change type of tseg1 and alltseg to unsigned int
All timing calculation is done with unsigned integers, so change type
of tseg1 and alltseg to unsigned int, too.

Link: https://lore.kernel.org/all/20211013130653.1513627-1-mkl@pengutronix.de
Link: https://github.com/linux-can/can-utils/pull/314
Reported-by: Gary Bisson <bisson.gary@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-10-13 15:21:56 +02:00
Oliver Hartkopp 7b8457ce9f j1939cat: fix long long unsigned int warning in x_name printf
warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]

Fixes: cc155d2f63 ("j1939cat: make use of new RX UAPI")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2021-10-11 20:54:22 +02:00
Marc Kleine-Budde 9f269db070
Merge pull request #311 from olerem/j1939-rx-2021.07.16
J1939 rx state support
2021-08-20 13:56:50 +02:00
Oleksij Rempel cc155d2f63 j1939cat: make use of new RX UAPI
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2021-08-20 13:38:42 +02:00
Oleksij Rempel 0107f07d83 include: import j1939.h from kernel v5.14-rc5+netdev-next
Import latest j1939.h to provide support for the RX state notifications

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2021-08-20 10:21:20 +02:00
Marc Kleine-Budde 3615bac17e
Merge pull request #301 from kurt-vd/canbusload-fd
[V2] canbusload with FD support
2021-06-24 15:03:07 +02:00
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
Marc Kleine-Budde c1aae77740
Merge pull request #302 from kurt-vd/more-chips-bittiming
[v2] more chips bittiming
2021-06-24 14:34:07 +02:00
Kurt Van Dijck 37f316ebc3 can-calc-bittiming: add mcan
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
2021-06-24 14:16:22 +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
Kurt Van Dijck e9a298ec21 can-calc-bittiming: add c_can
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
2021-06-24 05:19:15 +02:00
Kurt Van Dijck e19b5abb5c can-calc-bittiming: add stm32 bxcan
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
2021-06-24 05:19:11 +02:00
Marc Kleine-Budde e9dd86fa5c
Merge pull request #300 from hartkopp/master
canplayer: add interactive single-step frame processing mode
2021-06-07 16:14:23 +02:00
Oliver Hartkopp affdc1b799 can: uapi: update can.h to latest upstream version
This update includes:

commit f5076c6ba02e ("can: uapi: can.h: mark union inside struct can_frame packed")
commit 7e97d274db92 ("can: uapi: update CAN-FD frame description")
commit 025468842212 ("can: uapi: introduce CANFD_FDF flag for mixed content in struct canfd_frame")

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2021-06-01 19:55:40 +02:00
Marc Kleine-Budde a70801f1ce
Merge pull request #297 from marckleinebudde/fix-candump
candump: fix epoll_wait() returning -1, errno == -EINTR
2021-05-28 12:22:59 +02:00
Marc Kleine-Budde 1b4e317083 candump: fix epoll_wait() returning -1, errno == -EINTR
-EINTR is not an error, just restart the syscall.

Fixes: 639498bc80 ("candump: use epoll_wait() instead of select()")
Link: https://github.com/linux-can/can-utils/issues/296
Reported-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-05-28 11:57:38 +02:00
Marc Kleine-Budde f8a2cf01fa
Merge pull request #293 from marckleinebudde/misc-cleanups
Misc cleanups
2021-05-06 15:59:52 +02:00
Marc Kleine-Budde b88a64e9fc slcan_attach: add bit rate table for -s parameter
Reported-by: Chris Fiege <chris.fiege.pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-05-06 15:56:07 +02:00
Marc Kleine-Budde 70eda640d5 slcan_attach: remove trailing whitespace
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-05-06 15:54:39 +02:00
Marc Kleine-Budde fd6829eb4f canfdtest: main(): sort switch/case in cmd line parser alphabetically
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-05-04 12:00:39 +02:00
Marc Kleine-Budde 4b94546cf9 canfdtest: print_usage(): sort options alphabetically
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-05-04 11:58:25 +02:00
Oliver Hartkopp aaa7fd215f canplayer: add interactive single-step frame processing mode
Wait for ENTER key to process next CAN frame from the log file.

As the new line is printed each time this approach doesn't win a
design price. But this feature is very uncommon and setting the
terminal into some raw mode to get the raw keyboard hits would
introduce a big code overhead to handle e.g. CTRL-C signals which
is a vital functionality for canplayer.

Link: https://github.com/linux-can/can-utils/issues/280
Suggested-by: https://github.com/nico0481
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2021-04-17 13:01:29 +02:00
Oliver Hartkopp 553f0d282b canplayer: fix usec overflow handling
Commit 9c2de072a0 ("asc2log: Correct usec overflow handling") fixed the
usec overflow handling which is contained in a similar code snippet in
canplayer too.

Cc: Simon Tegelid <simon.tegelid@niradynamics.se>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2021-04-16 16:18:40 +02:00
Simon Tegelid 9c2de072a0 asc2log: Correct usec overflow handling
This commit fixes these lines
(1614188635.1000000) can1 4A8##28001E9A318ACC0 R
to become this
(1614188636.000000) can1 4A8##28001E9A318ACC0 R
2021-04-16 14:30:50 +02:00