Commit Graph

557 Commits (c5cb7e1a7c0562dd52c295583d859c5920abbbb7)

Author SHA1 Message Date
jogo- 9aa993df4c isotpdump: fix service 0x23 naming according to UDS specification
Fix Service 0x23 naming according to the standard
"ReadDataByMemory" -> "ReadMemoryByAddress"

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2019-07-30 22:09:50 +02:00
Marc Kleine-Budde c10c049ce7
Merge pull request #147 from ffontaine/master
fix include to find SIOCGSTAMP with latest kernel
2019-07-15 08:34:00 +02:00
Fabrice Fontaine e9590b1ca7 fix include to find SIOCGSTAMP with latest kernel
In linux kernel commit 0768e17073dc527ccd18ed5f96ce85f9985e9115
the asm-generic/sockios.h header no longer defines SIOCGSTAMP.
Instead it provides only SIOCGSTAMP_OLD.

The linux/sockios.h header now defines SIOCGSTAMP using either
SIOCGSTAMP_OLD or SIOCGSTAMP_NEW as appropriate. This linux only
header file is not pulled so we get a build failure.

canlogserver.c: In function 'main':
canlogserver.c:404:21: error: 'SIOCGSTAMP' undeclared (first use in this function); did you mean 'SIOCGRARP'?
     if (ioctl(s[i], SIOCGSTAMP, &tv) < 0)
                     ^~~~~~~~~~
                     SIOCGRARP
canlogserver.c:404:21: note: each undeclared identifier is reported only once for each function it appears in

Fixes:
 - http://autobuild.buildroot.org/results/363de7d9bf433be8bc47ba4ee52ae0bb80fa9021

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-07-14 22:14:10 +02:00
Yegor Yefremov 9ffb16495c
Merge pull request #146 from yegorich/gpl-2-only
Relicense GPL-2.0-or-later files to GPL-2.0-only
2019-07-10 22:47:11 +02:00
Yegor Yefremov 59f92965b9 Relicense GPL-2.0-or-later files to GPL-2.0-only
This way all licenses in the project will be homogenised.

Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Sven Schmitt <sven.schmitt@gmx.net>
Acked-by: Oleksij Rempel <ore@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Brennan Ashton <bashton@brennanashton.com>
Acked-By: IOhannes m zmölnig <zmoelnig@iem.at>
Acked-by: Frank Theile <ftheile@grundfos.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Jeremiah Mahler <jmmahler@gmail.com>
Acked-by: Jonathan Challinger <mr.challinger@gmail.com>
Acked-by: Cheng-Lung Lee <chenglung@gmail.com>
Acked-by: Ramesh Shanmugasundaram <rashanmu@gmail.com>
Acked-by: Mans Rullgard <mans@mansr.com>
Acked-by: Søren Holm <sgh@sgh.dk>
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-07-10 14:01:23 +02:00
Yegor Yefremov 9d0c08d8cb
Merge pull request #143 from yegorich/spdx
Add SPDX identifiers
2019-07-10 13:42:21 +02:00
Marc Kleine-Budde bb2cc1140f
Merge pull request #144 from olerem/errq-2019.05.25
queue status
2019-06-27 12:05:52 +02:00
Oleksij Rempel c4e68aff78 jcat: get status for all queued messages
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-06-25 07:36:36 +02:00
Oleksij Rempel 0e542c8dba jcat: make sure we can use decimal numbers for repeat parameter
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-06-24 13:53:31 +02:00
Yegor Yefremov 7b7331976a Add SPDX identifiers
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-06-19 12:24:24 +02:00
Marc Kleine-Budde a965086356
Merge pull request #140 from marckleinebudde/isotpdump
isotpdump: fix compiler warning
2019-06-03 20:26:11 +02:00
Marc Kleine-Budde 8ada533538 isotpdump: fix compiler warning
| isotpdump.c: In function ‘print_uds_message’:
| isotpdump.c:94:29: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
|   } else if (service >= 0x10 && service <= 0x3E ||
|              ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
| isotpdump.c:96:22: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
|       service >= 0xBA && service <= 0xBE)
|       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-06-03 19:56:27 +02:00
Oliver Hartkopp f185160bfb
Merge pull request #139 from buecheko/uds-dump
Add UDS output functionality to isotpdump
2019-05-30 20:37:42 +02:00
tr1core 0d8b0a8837 Add uds output functionality 2019-05-29 10:49:42 +02:00
Marc Kleine-Budde 045f75ad64
Merge pull request #135 from olerem/errq-2019.05.09.1
Provide error queue support
2019-05-09 14:50:29 +02:00
Oleksij Rempel 25025d05ae jcat: add repeat support
Add option to resend same data without closing the socket.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-05-09 14:40:16 +02:00
Oleksij Rempel edcce70373 jcat: provide errqueue support
The J1939 errqueue is a feedback interface to notify userspace
applications about actual transfer status. For now we can get
information about amount of data already send to the peer and errors
if session was aborted.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-05-09 14:40:16 +02:00
Oleksij Rempel 05368ef1ae jcat: rework poller
Make poller to be a main part of the send loop. It should make
application more understandable.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-05-09 14:40:16 +02:00
Oleksij Rempel 05a66d63fa jcat: enable polling by default
and set more or less meaningful default value.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-05-09 14:40:16 +02:00
Marc Kleine-Budde 6260263ef3 buildsystem: add SCM_TIMESTAMPING_OPT_STATS if not already defined 2019-05-09 14:40:16 +02:00
Oleksij Rempel 9ff370ea82 include: add errqueue.h, net_tstamp.h, netlink.h
this headers are take from kernel v5.0 and needed for
error queue support.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-05-09 14:36:53 +02:00
Marc Kleine-Budde e92806db21
Merge pull request #136 from olerem/namefix
libj1939: fix name parsing
2019-05-09 12:29:58 +02:00
Oleksij Rempel 5e342e3c50 libj1939: fix name parsing
name is 8 byte long.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-05-09 12:09:11 +02:00
Oleksij Rempel 38fa644069 include: import header files from linux-5.0 (including new j1939 filter struct)
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-05-08 10:53:00 +02:00
Marc Kleine-Budde afb88e9019
Merge pull request #134 from marckleinebudde/uapi
j1939: port j1939 tools to new UAPI
2019-04-04 11:00:53 +02:00
Oleksij Rempel 19d41bec45 jcat: allow to re-send rest of the buffer if we was interrupted
latest version of UAPI allows to continue sending on some signals.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2019-04-04 10:53:17 +02:00
Oleksij Rempel 48a4a4bef4 jcat: user recv() instead of recvfrom()
No information from recvfrom() is currently used. So, it is enough to
use plain recv().

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-04-04 10:45:33 +02:00
Oleksij Rempel b931fb514c jcat: add missing close of outfile and j1939 socket
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-04-04 10:45:33 +02:00
Oleksij Rempel 7192b0b9d7 jacd: set SO_BROADCAST
with latest UAPI version we should set this flag to be allowed to send
broadcast frames with broadcast destination address. Even if on CAN
every thing is a broadcast...

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-04-04 10:37:52 +02:00
Oleksij Rempel b8a2fa319a jacd: use sendto instead of send
Accordint to the new UAPI version, bind() with PGN set, should not be used
for destination PGN.

This change should work with new and old version of UAPI.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-04-04 10:37:49 +02:00
Oleksij Rempel 314f8a92ae j1939: use defines instead of magic values
for now cover most of PGN values.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-04-04 10:37:39 +02:00
Marc Kleine-Budde 06d3beb08c include: import header files from linux-5.0 (including new j1939 patches)
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-04-04 10:19:11 +02:00
Marc Kleine-Budde 83667e822c
Merge pull request #130 from marckleinebudde/testj1939
testj1939: use %zu to as format string to print sizeof()
2019-03-12 12:52:13 +01:00
Marc Kleine-Budde 9f60ed6fa0 testj1939: use %zu to as format string to print sizeof()
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-03-12 12:37:27 +01:00
Marc Kleine-Budde e1d5ee9907
Merge pull request #129 from marckleinebudde/cleanup
This pull request cleans up the Makefile by sorting things alphabetically and adding a missing newline to the GNUmakefile.am.
2019-03-12 12:34:42 +01:00
Marc Kleine-Budde c59dff1bb1 NUmakefile.am: EXTRA_DIST: add missing \
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-03-12 12:02:44 +01:00
Marc Kleine-Budde 4a1818aa55 Makefile: cleanup
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-03-12 10:14:27 +01:00
Oliver Hartkopp b6cb9a04e5 cansend: enhance help text to point out SFF/EFF identifiers
As suggested by https://github.com/jogo- an example was added that points
out how to send a CAN frame with CAN ID 123 as SFF (11 bit) and EFF (29 bit).

Reference: https://github.com/linux-can/can-utils/issues/126

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2019-02-14 09:47:46 +01:00
Oliver Hartkopp 46d620b27c cansend: enhance help text for length info in RTR frames
In 'classic' CAN 2.0 the RTR frames contain a length information in the
can_dlc field of a CAN frame control section. This length can be passed
to 'cansend' which has not been documented in the help text so far.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2019-02-13 14:55:47 +01:00
Marc Kleine-Budde 2328c6cfa0
Merge pull request #119 from twasilczyk/master
Don't build libj1939 for Android
2019-01-14 14:48:48 +01:00
Marc Kleine-Budde e0277cc960
Merge pull request #122 from olerem/test
testj1939: split output string in to 8 byte strings
2019-01-14 10:03:42 +01:00
Marc Kleine-Budde 7b70a433cf
Merge pull request #121 from olerem/size
testj1939: fail if we use unsupported size
2019-01-14 10:03:34 +01:00
Oleksij Rempel 5551de5e56 testj1939: split output string in to 8 byte strings
Currently if we send lots of bytes, test1939 output will get unreadable.
Make it easier to read by splitting output dump.
New format will looks as following example:
root@DistroKit:~ testj1939 can0:0x90 -r
80 12300: 01 23 45 67 89 ab cd ef
00008     01 23 45 67 89 ab cd ef
00010     01 23 45 67 89 ab cd ef
00018     01 23 45 67 89 ab cd ef
00020     01 23 45 67 89 ab cd ef
00028     01 23 45 67 89 ab cd ef
00030     01 23 45 67 89 ab cd ef
00038     01 23 45 67 89 ab cd ef
00040     01 23 45 67 89 ab cd ef
00048     01 23 45 67 89 ab cd ef
00050     01 23 45 67 89 ab cd ef
00058     01 23 45 67 89 ab cd ef
00060     01 23 45 67 89 ab cd ef
00068     01 23 45 67 89 ab cd ef
00070     01 23 45 67 89 ab cd ef
00078     01 23 45 67 89 ab cd ef

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-01-14 09:19:51 +01:00
Oleksij Rempel ed5b495da6 testj1939: fail if we use unsupported size
Currently if we set size which is more then 128 byte
will silently ignore provided value and send only maximal
supported size.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-01-14 09:16:05 +01:00
Tomasz Wasilczyk 4da344b2aa Don't build j1939 for Android
This library uses if_nameindex symbol, not available at this system.
2019-01-10 12:03:06 -08:00
Oliver Hartkopp 8991b5c47d
Merge pull request #118 from twasilczyk/master
Silence false positive unaligned pointer access warning
2019-01-10 19:28:12 +01:00
Tomasz Wasilczyk f6e07960d3 Silence false positive unaligned pointer access warning
This is a warning coming up on Android (ARM) platform.
Clang 4.x creates a false positive here: the can_id is the first
(and aligned) value in the packed struct modattr, so it's always
aligned if the struct itself is aligned.
2019-01-10 10:04:37 -08:00
Marc Kleine-Budde 02b87eb120
Merge pull request #117 from olerem/jcat-fixup
jcat: inverse if logic
2019-01-04 14:43:25 +01:00
Oleksij Rempel 5b68a2cef1 jcat: inverse if logic
it was if(offset != NULL), so it should be if(offset)

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-01-04 14:40:07 +01:00
Marc Kleine-Budde 0083a3762b
Merge pull request #114 from olerem/jcat-2018.12.14
add jcat
2019-01-04 13:56:12 +01:00