Commit Graph

334 Commits (c50b5a39de9f59a406d0e615aee204feed8f2342)

Author SHA1 Message Date
Kurt Van Dijck c50b5a39de can-j1939: add jspy 'sniffer' program
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-18 11:04:15 +01:00
Kurt Van Dijck 1d3f8a1893 can-j1939: add libj1939
libj1939 provides a parser for struct sockaddr_can with j1939 info

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-18 11:04:15 +01:00
Kurt Van Dijck 19ee95491a can-j1939: update headers with j1939
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-18 11:04:15 +01:00
Marc Kleine-Budde 635a04f79f travis: include config file in tarball
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-18 11:04:15 +01:00
Marc Kleine-Budde 2ed3e4f960 travis: we don't need sudo 2018-01-17 18:00:59 +01:00
Yegor Yefremov c011ccd742 Add Travis-CI support
This configuration performs build tests for GCC and Clang
compilers.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-17 16:47:29 +01:00
Marc Kleine-Budde d8c86cd995 GNUmakefile.am: add missing vxcan.h to be included in tarball
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-17 15:54:43 +01:00
Marc Kleine-Budde 9a967265bc include: import header files from kernel v4.15-rc5
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-17 15:51:31 +01:00
Oliver Hartkopp 6bbcf9d90c
Merge pull request #62 from sgh/master
Set low-latency flag on serial port.

Thanks for monitoring!
2018-01-14 14:46:36 +01:00
Søren Holm d052ad1a6b Set low-latency flag on serial port.
Some serial drivers does not default to lowlatency mode by default.
2018-01-14 14:16:20 +01:00
Marc Kleine-Budde cf949a926a unconditionally define _GNU_SOURCE
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-09 14:42:17 +01:00
Oliver Hartkopp ee0233505b canplayer: ensure 6 decimal places in timestamp
Ensure the fractions of seconds are 6 decimal places long to catch
3rd party or handcrafted logfiles that treat the timestamp as float.

See: https://github.com/linux-can/can-utils/issues/60

Reported-by: https://github.com/hauptmech
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2017-12-13 20:12:32 +01:00
Oliver Hartkopp 33640c8643 candump: make hardware timestamps Linux version agnostic
Hardware timestamps have been introduced in Linux 2.6.30. Check for the
availability of SO_TIMESTAMPING and print an appropriate error message if
missing. Additionally fix some style issues and define the proper length
of ctrlmsg[].

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2017-12-06 10:16:09 +01:00
Oliver Hartkopp 7b8607ca89
Merge pull request #59 from FabianInostroza/hw_timestamp
Add option to read hardware timestamps.
2017-12-06 10:15:00 +01:00
Fabián Inostroza eeb0dc2390 Fix style and add reference to timestamps struct offset. 2017-12-02 16:43:52 -03:00
Fabián Inostroza 3195717961 Remove deprecated flag. See timestamping.txt 2017-12-02 16:07:04 -03:00
Fabián Inostroza fbebc61881 Add option to read hardware timestamps. 2017-12-02 03:33:43 -03:00
Oliver Hartkopp 60de0d9783
Merge pull request #58 from jschall/patch-1
increase TTYPATH_LENGTH

tnx jschall!
2017-11-29 11:00:08 +01:00
jschall f1c3ed1461
increase TTYPATH_LENGTH
ttypath can't fit filenames such as /dev/serial/by-id/usb-Zubax_Robotics_Zubax_Babel_1D002A00185732523935382000000000-if00
2017-11-28 13:02:01 -08:00
Oliver Hartkopp 5b518a0a5f Merge pull request #50 from darbedar/main-optimization
omit extra sets and clears - tnx!
2017-08-30 22:05:34 +02:00
Heydar Elahi c45ee0cdbe omit extra sets and clears
old code does extra sets and clears in case of quiet==1 so I've changed if statement orders and used else if
2017-08-09 18:53:35 +04:30
Oliver Hartkopp 846eddd854 Merge pull request #49 from darbedar/master
Another macro usage
2017-08-09 10:47:40 +02:00
Heydar Elahi 1ae8714d0d Another macro usage
Used same macro instead of array
2017-08-09 11:56:05 +04:30
Oliver Hartkopp c6ed797918 Merge pull request #48 from darbedar/master
use a macro for standardization & fix protocol violation location
2017-08-09 08:40:07 +02:00
Heydar Elahi 23249c5cd8 Protocol violation location mistake in error message
I changed "id.28-to-id.28" to	"id.28-to-id.21"
2017-08-09 10:44:19 +04:30
Heydar Elahi 243bab70d5 use a macro
the hex_asc_upper_lo macro which is defined before do the same thing.
2017-08-09 02:36:47 +04:30
Oliver Hartkopp 4c8fb05cb4 can-utils: remove strict-aliasing compiler warning
GitHub user 'crossband' raised an issue regarding the strict-aliasing compiler
warning in his specific setup: https://github.com/linux-can/can-utils/issues/42

In fact memcpy() and memset() are a better solution than the former pointer
magics, so remove the issues and the compiler warning flag too.

Reported-by: crossband (https://github.com/crossband)
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2017-07-01 19:01:01 +02:00
Oliver Hartkopp 5109ca4f3c cangen/cansend: fix typo 'ist' -> 'is'
Reported-by: Stanislavs Rogozins <stanislavs.rogozins@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2017-06-29 19:55:52 +02:00
Oliver Hartkopp 791890542a README: Add short decription for provided tools
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2017-04-28 20:42:35 +02:00
Oliver Hartkopp 2a2efbbc7f Updated README.md inspired by Alan (https://github.com/alan707)
Alan sent a pull request to update the README.md with some markdown tweaks
and a SocketCAN logo. Good idea!
After creating a SocketCAN logo PNG in the can-logos repository we can
reference the PNG inside the linux-can organization.
A license file needs to be added too - but this has to be discussed on the
mailing list first.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2017-04-27 21:22:03 +02:00
Marc Kleine-Budde cb33a55720 Merge pull request #37 from kohtala/master
isotptun: add option to daemonize (-D)
2017-02-16 14:26:13 +01:00
Marko Kohtala 35f3dc375b isotptun: add -D option to daemonize after tun device created
System startup needs to wait for tun device to be created before
continuing on use of the tun device. Add -D option to fork a daemon of
isotptun and exit(EXIT_SUCCESS) when the tun device can be used.

Log errors to syslog when daemonized or to stderr when in foreground.

Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
2017-02-14 11:16:07 +02:00
Marko Kohtala 51192feff8 isotptun: print command line parsing error messages to stderr
Command line parsing error messages are printed to stdout. Other errors
and usage goes to stderr.

Change to print errors to stderr.

Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
2017-02-14 11:14:29 +02:00
Marko Kohtala 7eb005d9f3 isotptun: use EXIT_FAILURE instead of 0 (EXIT_SUCCESS) for errors
Exit code does not tell if the service was provided or if it was not
provided due to command line or setup errors.

Change errors to return EXIT_FAILURE instead of 0. Also change other uses
of 0 to EXIT_SUCCESS and 1 to EXIT_FAILURE for clarity and POSIX
conformance.

Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
2017-02-14 11:12:51 +02:00
Jiho Chu 99f1664e0c bcmserver: allow CAN netdevice names greater than 6 characters
The sscanf() function to parse bcmserver command strings limited the length of
the CAN netdevice name to six characters. With this patch the length is derived
from the IFNAMSIZ which defines the space in ifr.ifr_name.

Signed-off-by: Jiho Chu <jiho.chu@samsung.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2017-01-14 20:15:40 +01:00
Marc Kleine-Budde c3305fdd51 Merge pull request #36 from rahul-bedarkar/fix-build-with-glibc
Add check to detect clock_nanosleep() in librt
2016-12-20 15:06:23 +01:00
Rahul Bedarkar 5f4785c2ac Add check to detect clock_nanosleep() in librt
With glibc versions before 2.17, we get following build error:

  canfdtest.o: In function `millisleep':
  canfdtest.c:(.text+0x212): undefined reference to `clock_nanosleep'
  collect2: error: ld returned 1 exit status
  make[1]: *** [canfdtest] Error 1
  make[1]: *** Waiting for unfinished jobs....

glibc versions before 2.17 needs to link with -lrt for
clock_nanosleep(). This patch adds support to detect if linking with
librt is required.

This build issue is detected by Buildroot autobuilder:
http://autobuild.buildroot.net/results/0e5/0e5242376ff6aa82e89ed1172350e05009d48156/build-end.log

Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
2016-12-20 19:29:15 +05:30
Marc Kleine-Budde 64edc021d2 Merge pull request #33 from rshanmu/master
canfdtest: remove usage of gettimeofday
2016-11-21 15:22:57 +01:00
Ramesh Shanmugasundaram cf1b2a177f canfdtest: remove usage of gettimeofday
This patch fixes this bug
https://github.com/linux-can/can-utils/issues/13

Modified the existing millisleep function to use clock_nanosleep with
MONOTONIC clock and relative timeout.

Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
2016-11-21 13:55:27 +00:00
Stephane Grosjean 4d0e6d5169 canfdtest: fix typo while waiting for tv_stop time
After a few complaint about 100% CPU usage of canfdtest over our PCI
-like boards, I have had a look to the source file, and think I have
found the issue in can_echo_dut().

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2016-11-21 11:37:01 +01:00
Oliver Hartkopp 73ae306a11 bcm: add support for CAN FD frames
Update bcm.h following Linux mainline commit 6f3b911d5f29b98752

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2016-10-10 14:19:42 +02:00
IOhannes m zmölnig ea6219b0b4 slcand: log to stdout when running in foreground
when slcand runs in daemon mode, it makes sense to output via syslog.
but when running in foreground, it is nicer to have all the info on the stdout.
2016-10-05 07:42:55 +02:00
Oliver Hartkopp cddb2612b1 candump: print correct interface names on stderr
The cmdlinename[i] output contains the filter definitions e.g.
'can0,300:700' but you want to see only 'can0' when printing on stderr.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2016-08-31 19:14:07 +02:00
Marc Kleine-Budde 8f74b1cc21 Merge pull request #28 from ajneu/no_exit_on_down
don't exit when device goes down
2016-08-31 10:19:56 +02:00
ajneu 7a9e10173a don't exit when device goes down 2016-08-30 20:04:39 +02:00
Ramesh Shanmugasundaram 42ee04ff64 cangen: reset frame flags at the start of iteration (#16)
This patch fixes a bug in cangen.c

Bug: When used with -m option, if a CAN FD frame with BRS option set is
sent, that flag never gets cleared for the subsequent frames.

Fix: Reset frame.flags at the start of iteration.

Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
2016-06-30 21:33:16 +02:00
Marc Kleine-Budde 8c5cd245f6 Merge pull request #24 from ajneu/master1
header-guard for lib.h
2016-06-13 11:00:34 +02:00
ajneu 3a33ee995c header-guard for lib.h 2016-06-13 10:52:41 +02:00
Marc Kleine-Budde 862e8ed178 Merge pull request #23 from ajneu/master1
pointer to const in lib
2016-06-13 10:35:26 +02:00
ajneu ef2ea8fa59 pointer to const in lib 2016-06-13 10:26:53 +02:00