Commit Graph

1226 Commits (130e0dced2888c96ffdfad1ec3c4af11ba3e6439)

Author SHA1 Message Date
Oliver Hartkopp c31addfa9c cansniffer: unify setsockopt error handling
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2023-12-08 17:12:16 +01:00
Oliver Hartkopp 7affaf217e isotpsniffer: fix missing CAN FD support on second listen socket
When sniffing CAN FD isotp traffic both listen-only sockets have to be
switched to process CAN FD frames.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2023-12-08 17:10:20 +01:00
Marc Kleine-Budde ef6c39ebd6 cansequence: add missing "--strict" to long_options
Fixes: 642190647e ("cansequence: add option to ignore classical CAN frames")
2023-12-05 10:38:23 +01:00
Marc Kleine-Budde 88f0c75334
Merge pull request #476 from marckleinebudde/cansequence
cansequence: cleanups and add support for CAN-FD
2023-11-29 18:35:43 +01:00
Marc Kleine-Budde 642190647e cansequence: add option to ignore classical CAN frames 2023-11-29 18:28:32 +01:00
Marc Kleine-Budde bd835f2ca2 cansequence: add support to send and receive CAN-FD 2023-11-29 18:24:19 +01:00
Marc Kleine-Budde 6695f6f557 cansequence: print_usage(): clarify help for -e, --extended option 2023-11-29 18:24:19 +01:00
Marc Kleine-Budde 92a99c33ad cansequence: print_usage(): convert tabs to spaces in help text 2023-11-29 18:24:19 +01:00
Marc Kleine-Budde 0b0bce87c4 cansequence: also show help for option "-?"
This avoids the "invalid option" error message in the auto generated
man pages.

| DESCRIPTION
|       ./cansequence: invalid option -- '?'
2023-11-29 18:24:19 +01:00
Marc Kleine-Budde e8a808e2ab cansequence: convert extended, receive from int -> bool 2023-11-29 18:24:19 +01:00
Marc Kleine-Budde 5c433340c3 cansequence: convert towards kernel coding style 2023-11-29 17:23:00 +01:00
Marc Kleine-Budde 39f6d37e47
Merge pull request #475 from marckleinebudde/can-calc-bit-timing
can-calc-bit-timing: add verbose mode to print bit timing limits
2023-11-29 12:02:42 +01:00
Marc Kleine-Budde 85da9de8d8 can-calc-bit-timing: add verbose mode to print bit timing limits
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2023-11-29 11:39:56 +01:00
Marc Kleine-Budde 2abf88cee4
Merge pull request #473 from tisyang/master
timestamp formatting: always use 64-bit for timesstamp formatting.
2023-11-28 08:47:45 +01:00
TyK ceda93bd5c timestamp formatting: always use 64-bit for timesstamp formatting.
Using C99 `unsigned long long` to format `struct timeval`'s `tv_sec`
and `tv_usec`, fix incorrect print under some 32bit platform which
 using time64.
2023-11-28 08:30:27 +08:00
Marc Kleine-Budde 97c8ccdbbf
Merge pull request #472 from marckleinebudde/cansequence
cansequence: print counter received data as hex
2023-11-24 08:17:49 +01:00
Marc Kleine-Budde 5e3397ee71 cansequence: print counter received data as hex
In the CAN universe, most data is displayed in hex. Change the verbose
output to hex, to ease debugging.
2023-11-24 08:04:55 +01:00
Marc Kleine-Budde 41ea759237
Merge pull request #468 from marckleinebudde/j1939spy
J1939spy: remove verbose option
2023-10-17 10:13:34 +02:00
Marc Kleine-Budde 574df84a5d j1939spy: remove verbose option
If j1939spy is started with the verbose option "-v" or "--verbose", it
will print the error "j1939spy: listening: Success" and exit. Remove
this option altogether.

Fixes: c50b5a39de ("can-j1939: add jspy 'sniffer' program")
2023-10-17 09:51:27 +02:00
Marc Kleine-Budde 51ee436e75 j1939spy: convert towards kernel coding style 2023-10-17 09:50:26 +02:00
Marc Kleine-Budde 46fae98b76
Merge pull request #466 from marckleinebudde/fix-canbusload
canbusload: main(): switch from pselect() to select()
2023-10-06 14:23:27 +02:00
Marc Kleine-Budde 8e2caa8f8a canbusload: main(): switch from pselect() to select()
We don't need to block any signals, so a select() is sufficient. This
also fixes the problem that sigmask is uninitialized and may block the
sig ARLM, which make canbusload hang until a CAN frame is recieved.

Closes: https://github.com/linux-can/can-utils/issues/465
2023-10-06 12:32:42 +02:00
Marc Kleine-Budde c5b64802a1
Merge pull request #464 from marckleinebudde/can-calc-bittiming
can-calc-bit-timing: at91_can: add 66 MHz CAN clock for sama5d3
2023-10-05 12:58:34 +02:00
Marc Kleine-Budde 0e428e36a5 can-calc-bit-timing: at91_can: add 66 MHz CAN clock for sama5d3 2023-10-05 12:52:57 +02:00
Marc Kleine-Budde 4b5b524256
Merge pull request #462 from marckleinebudde/lib
lib: coding style cleanups + fix printing of CAN_ERR_CNT
2023-09-27 16:30:18 +02:00
Marc Kleine-Budde 7d59157d4d lib: snprintf_can_error_frame(): don't bail out if CAN_ERR_CNT is set
If CAN_ERR_CNT is set, the snprintf_can_error_frame() bails out, as it
cannot decode CAN_ERR_CNT.

Fixes: 21fb43532e ("lib: snprintf_can_error_frame: print counter errors if CAN_ERR_CNT is set")
2023-09-27 16:26:50 +02:00
Marc Kleine-Budde 0a43e84bcd lib: convert towards kernel coding style 2023-09-27 16:26:50 +02:00
Marc Kleine-Budde 1be7e0e51d
Merge pull request #461 from marckleinebudde/canbusload
canbusload: coding style cleanups + use less screen estate in redraw mode
2023-09-27 12:46:15 +02:00
Marc Kleine-Budde 84919edbaa canbusload: redraw mode: use less screen estate
Use less screen estate by not printing unneeded newlines in redraw
mode.
2023-09-27 12:40:38 +02:00
Marc Kleine-Budde 92adbda471 canbusload: convert towards kernel coding style 2023-09-27 12:38:48 +02:00
Marc Kleine-Budde 3490282fc7
Merge pull request #460 from marckleinebudde/can-calc-bittiming-add-tq-help-text
can-calc-bit-timing: print_usage(): add --tq parameter to help text
2023-09-19 11:23:41 +02:00
Marc Kleine-Budde 47472cabc3 can-calc-bit-timing: print_usage(): add --tq parameter to help text
In 913311fc15 ("can-calc-bit-timing: add support to decode user
supplied bit timing parameters") support to decide user supplied bit
timing parameters was added. However, it was forgotten to add --tq to
the help text.

Add help text for the --tq paramter.

Reported-by: https://github.com/EnricoMontecaggi
Closes: https://github.com/linux-can/can-utils/issues/459
Fixes: 913311fc15 ("can-calc-bit-timing: add support to decode user supplied bit timing parameters")
2023-09-19 11:18:16 +02:00
Marc Kleine-Budde 39d6bba36a
Merge pull request #458 from marckleinebudde/cansequence-error-messages
cansequence: error messages
2023-09-19 09:07:20 +02:00
Marc Kleine-Budde c8cf342cb2 cansequence: main(): error handling: add "()" to function name in error message
Commit 0be066bee6 ("cansequence: main(): allow to bind on "any"
interface") converted from SIOCGIFINDEX ioctl() to if_nametoindex()
and adjusted the error message, but forgot the "()" after the function
name, which is used in the rest of the error messages in this file.

Add the missing "()".

Fixes: 0be066bee6 ("cansequence: main(): allow to bind on "any" interface")
2023-09-19 08:57:44 +02:00
Marc Kleine-Budde e7c03ee93b cansequence: do_receive(): fix error message if recvmsg() fails
In commit 9567230494 ("cansequence: print out dropped packages by
socket counter"), the read() syscall was replaced by recvmsg(). Adjust
error message accordingly.

Fixes: 9567230494 ("cansequence: print out dropped packages by socket counter")
2023-09-19 08:55:53 +02:00
Marc Kleine-Budde 096d42ab98
Merge pull request #457 from marckleinebudde/cansequence-version
cansequence: remove --version option from help text
2023-09-18 17:15:37 +02:00
Marc Kleine-Budde d7a51a5494 cansequence: remove --version option from help text
It is not implemented and not supported by any of the can-utils, so
remove it.

Reported-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2023-09-18 17:09:00 +02:00
Marc Kleine-Budde 2f9958c699
Merge pull request #447 from triveria/refactor-canplayer
Format code of canplayer
2023-09-05 11:51:56 +02:00
Michael Wagner ad850776c3 canplayer: Format code according to .clang-format 2023-09-05 10:51:30 +02:00
Michael Wagner 4657d02b1f Add .clang-format 2023-09-05 10:50:54 +02:00
Marc Kleine-Budde 33b2ae6f88
Merge pull request #454 from marckleinebudde/fix-poll-errno
Fix poll errno
2023-08-28 16:19:46 +02:00
Marc Kleine-Budde 87e6af1025 j1939cat: do_send(): fix errno check
"errno" hold the positive error value.

Link: https://github.com/linux-can/can-utils/issues/448
Fixes: cc155d2f63 ("j1939cat: make use of new RX UAPI")
Fixes: 19d41bec45 ("jcat: allow to re-send rest of the buffer if we was interrupted")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2023-08-28 16:11:29 +02:00
Marc Kleine-Budde 87a6788e6d cansequence: do_send(): fix errno check
"errno" hold the positive error value.

Link: https://github.com/linux-can/can-utils/issues/448
Reported-by:  Adien Akhmad <adien.akhmad@gmail.com>
Suggested-by: Oliver Hartkopp <socketcan@hartkopp.net>
Fixes: fb5903f226 ("[cansequece] added various improvements")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2023-08-28 16:11:24 +02:00
Oliver Hartkopp 79601bd1d4 canplayer: ensure 6 decimal places in timestamp for first frame
The check has only been applied after the first CAN frame has been read
and evaluated. This lead to an unintended sending of a single handcrafted
frame with a following (intended) failure at the second frame.

Apply the check also for the very first CAN frame that is processed.

Fixes: ee0233505b ("canplayer: ensure 6 decimal places in timestamp")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2023-08-10 10:31:26 +02:00
Marc Kleine-Budde 3aa72b8208
Merge pull request #445 from marckleinebudde/ccls-cleanups
ccls related cleanups
2023-08-01 22:05:58 +02:00
Marc Kleine-Budde 1d7d37c6ac gitignore: add ccls related files 2023-08-01 21:45:43 +02:00
Marc Kleine-Budde ac0059db12 calc-bit-timing: include compat.h to make ccls happy 2023-08-01 21:45:43 +02:00
Marc Kleine-Budde fd0837f7e6 can-calc-bit-timing: move kernel compatibility stuff into own header 2023-08-01 21:45:43 +02:00
Marc Kleine-Budde 90baa696cd
Merge pull request #444 from marckleinebudde/can-calc-bittiming-v6.3
can-calc-bit-timing: import bit timing calculation algorithm from v6.3
2023-08-01 14:19:05 +02:00
Marc Kleine-Budde ca304faad3 can-calc-bit-timing: import bit timing calculation algorithm from v6.3 2023-08-01 14:13:43 +02:00