Commit Graph

28 Commits (ceda93bd5c56927c72d48dcaa30e17d6ecea86b8)

Author SHA1 Message Date
Ashcon Mohseninia 999c650e87 slcan: increase BTR char limit to 8 for 32bit BTR
As required by some Atmel MCU SLCAN implementations.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2023-02-23 16:36:33 +01:00
Jayachandran Dharuman 2ac24b86fd closes #master: Fixed typo erros in slcan and testj1939 2022-02-01 19:55:27 +05:30
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
Rosen Penev b153fe3f35
clang-tidy: sort includes alphabetically
Found with llvm-include-order

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 23:28:58 -07:00
Alexander Gerasiov 09f6dc6d17 slcan_attach.c: Reformat help/usage output to be compatible with help2man.
Signed-off-by: Alexander Gerasiov <gq@debian.org>

Gbp-Pq: Name 0023-slcan_attach.c-Reformat-help-usage-output-to-be-comp.patch
2020-04-27 08:20:09 +03:00
Oliver Hartkopp 226d6393b8 slcan tools: fix stringop-truncation warnings
Rework string handling for ioctl() syscalls for netdev name operations.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2019-08-25 18:25:35 +02:00
Yegor Yefremov 7b7331976a Add SPDX identifiers
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-06-19 12:24:24 +02:00
Yegor Yefremov 1ce4dc7b39 Add missing return value checks
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2018-09-18 13:43:29 +02:00
Maximilian Pachl c548eee04a slcan: added listen-only flag
Signed-off-by: Maximilian Pachl <m@ximilian.info>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-10-15 10:18:15 +02:00
Yegor Yefremov f0abaaacb0 Include linux/sockios.h to fix musl build
Including <sys/ioctl.h> and <net/if.h> is not sufficient
to musl to find SIOCSIFNAME, so <linux/sockios.h> must be
included too.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2015-07-22 21:12:51 +02:00
Jeremiah Mahler ca79909197 use line discipline number from linux/tty.h
The line discipline number is provided in include/linux/tty.h.
Use that instead of a #define in each program.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2014-12-23 18:03:09 +01:00
Oliver Hartkopp 836d3cc012 remove obsolete SVN ID tags
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2012-11-14 20:57:16 +01:00
Yegor Yefremov 4d3a002ec1 can-utils: cleanup headers
- add missing sys/socket.h: on some systems (like Android)
have SOCK_RAW definition directly in sys/socket.h

- use sys/wait.h instead if wait.h

- include termios.h explicitly (Android)

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-03-20 11:16:43 +01:00
Marc Kleine-Budde 722a09116d treewide: replace berlios contact email by linux-can@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-01-11 12:14:15 +01:00
Oliver Hartkopp 7ef581fec0 slcan_attach: added '-f' commandline option to read status flags.
In the case of pending bus errors on some slcan adapters the read of the
status flags resets the adapter and clears the error LED.

This patch adds the commandline option to send the status read command to the
adapter as suggested by Thorsten Godau.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2011-01-09 11:49:20 +00:00
Oliver Hartkopp eb1a99f8c7 slcan_attach: 'close' the slcan adapter before setting a bitrate
As investigated by Thorsten Godau the bitrate can only be set after the
slcan adapter is in 'close' state.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Tested-by: Thorsten Godau <dl9sec@gmx.net>
2011-01-09 11:35:03 +00:00
Oliver Hartkopp d1efcd1d75 slcan_attach: Added new commandline option to specify the created netdevice name. 2010-11-17 11:55:46 +00:00
Oliver Hartkopp f213d0fea8 slcan_attach: Print the name of the assigned netdevice after attaching the tty. 2010-11-17 06:59:20 +00:00
Oliver Hartkopp 4369ac1c55 Consistencely allow '-?' to get a help text. 2009-01-13 09:32:45 +00:00
Oliver Hartkopp 9b717158c6 Reworked slcan_attach to give slcan setup values directly on the commandline. 2008-11-04 10:47:09 +00:00
Oliver Hartkopp afcac3462a The number for the SLCAN line discipline can not be found in
<linux/tty.h> anyway but needs to be written as module alias

tty-ldisc-17 slcan

So we remove the annoying #error output and use the correctly defined 
'17' from Kernel 2.6.25+ as default.
2008-09-17 13:02:49 +00:00
Oliver Hartkopp 4c7d5e434f Removed bad hacks in vcan.c and slcan_attach.c.
Giving some hints for users of older kernels than 2.6.25 that a 
compilation error is a normal behaviour in these cases.
2008-06-11 16:35:19 +00:00
Oliver Hartkopp d0b24ffc10 Fixed contradiction in Sourcecode discalimer.
See details at
http://marc.info/?l=linux-netdev&m=119074747913703&w=2
2007-09-27 12:29:32 +00:00
Oliver Hartkopp 44fb4089c3 Update outdated comment. 2007-09-21 07:21:24 +00:00
Oliver Hartkopp 47ca8b7900 Updated LDISC number to 17 (16 is occupied in the Kernel) 2007-06-25 13:05:43 +00:00
Oliver Hartkopp 60b77912ab Fixed Makefiles to compile test-apps and can-utils again.
Added new commandline parameter (linediscipline value) to slcan_attach.
2007-03-05 21:58:28 +00:00
Oliver Hartkopp 79cc51a867 Added CAN interface driver for low-cost CAN-Interfaces with ASCII protocol
via serial (or quasi serial via USB) lines.

This driver is partly derived from linux/net/driver/slip.c and uses a new
tty line discipline (N_SLCAN) analogue to N_SLIP to encapsulate can_frames
sent to a slc* netdevice for the serial line and vice versa.

As only the sending and receiving of can_frames is implemented, this driver
should work with the (serial/USB) CAN hardware from:
> www.canusb.com / www.can232.com / www.mictronic.com / www.canhack.de <

The sending and receiving frames format is pretty common. The other settings
and the 'open' command 'O' of the specific adapters may be set with a
terminal programm (like minicom) before switching the CAN data stream to
the slc* netdevice using the slcan_attach userspace tool.

Feel free to send patches / extensions to slcan.c / slcan_attach.c :)

ps. There had been no performances measurements until now. As long as the
data fit's through the 'serial' line it works obviously well. The slcan-driver
nor the Linux network layer will definitely have no problems to process
the received data. Remember the 'low-cost' hardware approach. We'll see ...
2007-02-22 12:47:37 +00:00