]> rtime.felk.cvut.cz Git - socketcan-devel.git/log
socketcan-devel.git
17 years agoForgot to use kv to get rid of the #ifdef LINUX_VERION_CODE stuff.
hartkopp [Fri, 9 Mar 2007 16:35:09 +0000 (16:35 +0000)]
Forgot to use kv to get rid of the #ifdef LINUX_VERION_CODE stuff.
Now it's fixed.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@182 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded patches for socketcan Revision 180 for the current Kernel 2.6.21-rc3 .
hartkopp [Fri, 9 Mar 2007 15:16:00 +0000 (15:16 +0000)]
Added patches for socketcan Revision 180 for the current Kernel 2.6.21-rc3 .

git-svn-id: svn://svn.berlios.de//socketcan/trunk@181 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoFor the first step into the mainstream kernel, we only provide the VCAN driver
hartkopp [Fri, 9 Mar 2007 07:52:21 +0000 (07:52 +0000)]
For the first step into the mainstream kernel, we only provide the VCAN driver
to get all the relevant infrastructure for CAN network drivers.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@180 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded can_id depended filter mask generation for can_rx_register() to
hartkopp [Fri, 9 Mar 2007 07:36:49 +0000 (07:36 +0000)]
Added can_id depended filter mask generation for can_rx_register() to
get the best masking value for a given single can_id.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@179 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoIntroduced can_core.h analogue to linux/can/core.h in Kernel 2.6 tree.
hartkopp [Thu, 8 Mar 2007 12:28:39 +0000 (12:28 +0000)]
Introduced can_core.h analogue to linux/can/core.h in Kernel 2.6 tree.
Updated dates in copyright notices. Cosmetics.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@178 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoMoved definition and prototypes for for CAN protocol modules using the PF_CAN
hartkopp [Thu, 8 Mar 2007 11:02:43 +0000 (11:02 +0000)]
Moved definition and prototypes for for CAN protocol modules using the PF_CAN
core module into linux/can/core.h to be public visible for external
compilation. Thanks to Urs for the hint and advisory.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@177 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded some comments in raw.h and bcm.h
hartkopp [Wed, 7 Mar 2007 16:12:46 +0000 (16:12 +0000)]
Added some comments in raw.h and bcm.h

git-svn-id: svn://svn.berlios.de//socketcan/trunk@176 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoRevert change r171 since kv can now handle these other comparison ops.
thuermann [Wed, 7 Mar 2007 14:29:02 +0000 (14:29 +0000)]
Revert change r171 since kv can now handle these other comparison ops.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@175 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoImplement comparison ops <, <=, and > in kv.
thuermann [Wed, 7 Mar 2007 14:27:36 +0000 (14:27 +0000)]
Implement comparison ops <, <=, and > in kv.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@174 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoFixed Makefiles to compile test-apps and can-utils again.
hartkopp [Mon, 5 Mar 2007 21:58:28 +0000 (21:58 +0000)]
Fixed Makefiles to compile test-apps and can-utils again.
Added new commandline parameter (linediscipline value) to slcan_attach.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@173 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoRemoved obsolete empty lines in LINUX_VERSION_CODE conditions to get a nicer
hartkopp [Mon, 5 Mar 2007 15:36:33 +0000 (15:36 +0000)]
Removed obsolete empty lines in LINUX_VERSION_CODE conditions to get a nicer
code output from the 'kv' script.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@172 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoChanged the LINUX_VERSION_CODE conditions to use the trunk/kv script from Urs
hartkopp [Mon, 5 Mar 2007 15:25:35 +0000 (15:25 +0000)]
Changed the LINUX_VERSION_CODE conditions to use the trunk/kv script from Urs
for an automated Kernel patch generation.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@171 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoVersion 2.0.0-pre6 - On the way to be posted on the LKML netdev ...
hartkopp [Mon, 5 Mar 2007 13:58:26 +0000 (13:58 +0000)]
Version 2.0.0-pre6 - On the way to be posted on the LKML netdev ...

git-svn-id: svn://svn.berlios.de//socketcan/trunk@170 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoDefined ARPHARD_CAN as 280 (formerly 804) due to my RFC on the socketcan-core
hartkopp [Mon, 5 Mar 2007 13:55:34 +0000 (13:55 +0000)]
Defined ARPHARD_CAN as 280 (formerly 804) due to my RFC on the socketcan-core
mailinglist. Had a phonecall with Marc who sees no problem with ARPHRD_CAN 280

git-svn-id: svn://svn.berlios.de//socketcan/trunk@169 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoBackported CodingStyles changes to kernel 2.4 tree.
hartkopp [Mon, 5 Mar 2007 13:33:59 +0000 (13:33 +0000)]
Backported CodingStyles changes to kernel 2.4 tree.
Cosmetics.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@168 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoReformated to meet Linux Documentation/Codingstyle (e.g. 80 chars/Line).
hartkopp [Mon, 5 Mar 2007 12:34:43 +0000 (12:34 +0000)]
Reformated to meet Linux Documentation/Codingstyle (e.g. 80 chars/Line).
Cosmetics.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@167 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded slim Makefiles that are working inside the kernel tree.
hartkopp [Mon, 5 Mar 2007 10:23:51 +0000 (10:23 +0000)]
Added slim Makefiles that are working inside the kernel tree.
For the first step only vcan and slcan drivers are on the roadmap for
integration into the kernel. IMHO the device drivers and the ioctl interface
as well as the CAN driver lib (candev.ko) from Andrey should be focussed
when we're stable integrated into the kernel tree.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@166 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoMoved the definitions of AF_CAN, PF_CAN, ARPHRD_CAN and ETH_P_CAN out of the
hartkopp [Mon, 5 Mar 2007 10:14:18 +0000 (10:14 +0000)]
Moved the definitions of AF_CAN, PF_CAN, ARPHRD_CAN and ETH_P_CAN out of the
file can.h to make can.h fit for a kernel integration path.
Therefore i added the 'hack' to the Makefiles which now contain the missing
defines. Maybe there will be a better solution in the future (when CAN is
part of the kernel). But currently it helps to maintain sourcecode to be
copied right into the kernel source tree.
Additionally added address structures for isotp and bap in sockaddr_can.
Cleanups. Cosmetics.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@165 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoMoved protoypes for the CAN network layer core from the public visible
hartkopp [Mon, 5 Mar 2007 08:45:45 +0000 (08:45 +0000)]
Moved protoypes for the CAN network layer core from the public visible
can/can.h to the local can/af_can.h (KERNEL 2.4 BACKPORT)

git-svn-id: svn://svn.berlios.de//socketcan/trunk@164 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoMoved protoypes for the CAN network layer core from the public visible
hartkopp [Mon, 5 Mar 2007 08:38:07 +0000 (08:38 +0000)]
Moved protoypes for the CAN network layer core from the public visible
linux/can.h to the local net/can/af_can.h

git-svn-id: svn://svn.berlios.de//socketcan/trunk@163 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoShortened the include files copyright and license header to Linux kernel style
hartkopp [Mon, 5 Mar 2007 08:25:02 +0000 (08:25 +0000)]
Shortened the include files copyright and license header to Linux kernel style

git-svn-id: svn://svn.berlios.de//socketcan/trunk@162 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded SLCAN-driver in Kconfig.
hartkopp [Mon, 5 Mar 2007 07:41:22 +0000 (07:41 +0000)]
Added SLCAN-driver in Kconfig.
Whitepace fixes.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@161 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoMinor change for readability.
thuermann [Sun, 4 Mar 2007 21:28:54 +0000 (21:28 +0000)]
Minor change for readability.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@160 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoFixed initialisation output into kernel log:
hartkopp [Wed, 28 Feb 2007 05:41:52 +0000 (05:41 +0000)]
Fixed initialisation output into kernel log:
can%d: sja1000 found ... -> can0: sja1000 found ...

git-svn-id: svn://svn.berlios.de//socketcan/trunk@159 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoSome code cleanup:
thuermann [Tue, 27 Feb 2007 11:39:09 +0000 (11:39 +0000)]
Some code cleanup:
- rename the canraw_sk() macro to raw_sk().
- define pointer ro = raw_sk() instead of using raw_sk() massively.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@158 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoUpgraded Version to 2.0.0-pre5
hartkopp [Thu, 22 Feb 2007 12:56:38 +0000 (12:56 +0000)]
Upgraded Version to 2.0.0-pre5

git-svn-id: svn://svn.berlios.de//socketcan/trunk@157 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded CAN interface driver for low-cost CAN-Interfaces with ASCII protocol
hartkopp [Thu, 22 Feb 2007 12:47:37 +0000 (12:47 +0000)]
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 ...

git-svn-id: svn://svn.berlios.de//socketcan/trunk@156 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded module parameter 'numdev' to modify the number of created virtual CAN
hartkopp [Thu, 22 Feb 2007 08:46:53 +0000 (08:46 +0000)]
Added module parameter 'numdev' to modify the number of created virtual CAN
interfaces. The default remains 4 interfaces.
More sophisticated error handling at netdevice creation.
Added missing device flag IFF_NOARP.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@155 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoChanged banner strings.
hartkopp [Wed, 21 Feb 2007 13:39:52 +0000 (13:39 +0000)]
Changed banner strings.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@154 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoEnabled the use of the rx_eff receive list. Cosmetics.
hartkopp [Sun, 18 Feb 2007 09:07:41 +0000 (09:07 +0000)]
Enabled the use of the rx_eff receive list. Cosmetics.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@153 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoCleaned up filter assignment due to a hint from Jan Kizka. See at
hartkopp [Sat, 17 Feb 2007 20:05:03 +0000 (20:05 +0000)]
Cleaned up filter assignment due to a hint from Jan Kizka. See at

https://lists.berlios.de/pipermail/socketcan-core/2007-February/000415.html

It's now possible to filter for EFF/RTR frames AND to filter not for them
explicitely (when CAN_EFF_FLAG or CAN_RTR_FLAG is set in the can_mask and
cleared in the can_id). This is indeed more straight and is what i intended
to have ...

git-svn-id: svn://svn.berlios.de//socketcan/trunk@152 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoFixed memory leak in Kernel 2.4 VCAN source when unloading the module.
hartkopp [Wed, 14 Feb 2007 14:56:39 +0000 (14:56 +0000)]
Fixed memory leak in Kernel 2.4 VCAN source when unloading the module.
Even if no one ever want's to unload this fancy code ;-)
Setting DO_LOOPBACK default OFF (analogue to Kernel 2.6 tree). Cosmetics.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@151 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoCleaned up the #includes for Kernel 2.4 analogue to Kernel 2.6 tree.
hartkopp [Wed, 14 Feb 2007 10:32:39 +0000 (10:32 +0000)]
Cleaned up the #includes for Kernel 2.4 analogue to Kernel 2.6 tree.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@150 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agofixed typo.
hartkopp [Mon, 12 Feb 2007 13:34:56 +0000 (13:34 +0000)]
fixed typo.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@149 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoRemove VW-specific targets from Makefile.
thuermann [Mon, 12 Feb 2007 10:19:15 +0000 (10:19 +0000)]
Remove VW-specific targets from Makefile.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@148 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded Option -l ('l'oop) to make the canplayer replay a given file more than
hartkopp [Mon, 12 Feb 2007 08:36:38 +0000 (08:36 +0000)]
Added Option -l ('l'oop) to make the canplayer replay a given file more than
one time. To replay a given file infinitely say '-l i'. Of course it is not
possible/reasonable to define '-l' when reading from stdin ...

git-svn-id: svn://svn.berlios.de//socketcan/trunk@147 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoRemoved possibility to terminate candump with an input from stdin.
hartkopp [Fri, 9 Feb 2007 09:53:16 +0000 (09:53 +0000)]
Removed possibility to terminate candump with an input from stdin.
Therefore it can be used in scripts now, e.g. for CAN-frame bridging:
   candump can1 -mFFF -v123 -b can3 -s 2 &
Use CTRL-C to terminate candump.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@146 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agosetting version to V2.0.0-pre4
hartkopp [Thu, 8 Feb 2007 13:27:42 +0000 (13:27 +0000)]
setting version to V2.0.0-pre4

git-svn-id: svn://svn.berlios.de//socketcan/trunk@145 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoRenamed can-sniffer to cansniffer.
hartkopp [Thu, 8 Feb 2007 13:18:07 +0000 (13:18 +0000)]
Renamed can-sniffer to cansniffer.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@144 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoLock the receive lists when removing in can_exit().
thuermann [Thu, 8 Feb 2007 13:00:54 +0000 (13:00 +0000)]
Lock the receive lists when removing in can_exit().
Disable soft-IRQs (traditionally aka bottom halves) when working on receive
lists, since can_notifier() is called in interrupt context.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@143 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoset driver device type to ARPHRD_CAN.
hartkopp [Mon, 5 Feb 2007 15:45:08 +0000 (15:45 +0000)]
set driver device type to ARPHRD_CAN.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@142 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoBackported Broadcastmanager (BCM) to Kernel 2.4.
hartkopp [Fri, 2 Feb 2007 07:28:05 +0000 (07:28 +0000)]
Backported Broadcastmanager (BCM) to Kernel 2.4.
Incremented Version Number to V2.0.0-pre3 .
Cosmetics in bcm.c (for Kernel 2.6)

git-svn-id: svn://svn.berlios.de//socketcan/trunk@141 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoBackported changes from bcm.c in Kernel 2.6 (r135 -> r136).
hartkopp [Thu, 1 Feb 2007 14:13:20 +0000 (14:13 +0000)]
Backported changes from bcm.c in Kernel 2.6 (r135 -> r136).

git-svn-id: svn://svn.berlios.de//socketcan/trunk@140 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoFixed memory allocation parameter.
hartkopp [Thu, 1 Feb 2007 11:47:58 +0000 (11:47 +0000)]
Fixed memory allocation parameter.
Only ARPHDR_CAN type netdevices are processed in af_can.c now.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@139 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoComplete reworked and beautified the Broadcast Manager (bcm)
hartkopp [Thu, 1 Feb 2007 09:15:00 +0000 (09:15 +0000)]
Complete reworked and beautified the Broadcast Manager (bcm)
The BCM now supports the binding to ifindex 0 like the raw socket does.
The first implementation of the BCM was from September 2003 and therefore
many historic stuff (e.g. unusual error reporting) was removed.
The support of ifindex 0 leads to the possibility to read from several
interfaces via one BCM-socket using sendto() / recvfrom().
See new test-apps tst-bcm-?x-sendto.c
The update of RX/TX_SETUPs 'on the run' are only possible with a smaller or
eval size of parameters now, as it is very complex in locking to provide the
other case and there was really now use-case for it ...

git-svn-id: svn://svn.berlios.de//socketcan/trunk@138 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoFixed another typo.
thuermann [Tue, 30 Jan 2007 10:33:47 +0000 (10:33 +0000)]
Fixed another typo.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@137 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoRemoved dynamic memory allocation inside bcm.c for bcm_opt.
hartkopp [Tue, 30 Jan 2007 08:57:08 +0000 (08:57 +0000)]
Removed dynamic memory allocation inside bcm.c for bcm_opt.
Added init function analogue to behaviour in raw.c.
Renamed all the user_data stuff to bcm_opt.
Comming soon: Ability to bind the BCM socket to any CAN device (ifindex=0)

git-svn-id: svn://svn.berlios.de//socketcan/trunk@136 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agofixed some typos.
hartkopp [Tue, 30 Jan 2007 07:12:59 +0000 (07:12 +0000)]
fixed some typos.
Thanks for the nice overview of the socketcan idea!

git-svn-id: svn://svn.berlios.de//socketcan/trunk@135 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdd section on motivation for socketcan to README.
thuermann [Mon, 29 Jan 2007 23:04:05 +0000 (23:04 +0000)]
Add section on motivation for socketcan to README.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@134 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdd file COPYING as referenced in the copyright notice in almost all files.
thuermann [Mon, 29 Jan 2007 12:34:40 +0000 (12:34 +0000)]
Add file COPYING as referenced in the copyright notice in almost all files.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@133 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoFirst shot of a README file for socketcan.
thuermann [Mon, 29 Jan 2007 12:23:15 +0000 (12:23 +0000)]
First shot of a README file for socketcan.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@132 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdd manual pages (templates) describing the CAN protocols and CAN utils.
thuermann [Mon, 29 Jan 2007 11:25:58 +0000 (11:25 +0000)]
Add manual pages (templates) describing the CAN protocols and CAN utils.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@131 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoUpdated vcan.c to support the new loopback functionality in af_can.c.
hartkopp [Fri, 26 Jan 2007 07:36:33 +0000 (07:36 +0000)]
Updated vcan.c to support the new loopback functionality in af_can.c.
Added Makefile parameters to allow to set the RAW and BCM capabilities at
compiletime, e.g. make RAWCAP=-DCONFIG_CAN_RAW_USER

git-svn-id: svn://svn.berlios.de//socketcan/trunk@130 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoFixed typo in log2asc.c
hartkopp [Wed, 10 Jan 2007 17:18:01 +0000 (17:18 +0000)]
Fixed typo in log2asc.c
Added asc2log.c to convert existing CANoe/CANalyser logfiles into socketcan
logfiles (with absolute and full qualified timestamps).
The date and the other settings (dec/hex absolute/relative) are taken from
the head of the ASC files.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@129 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoFixed wrong error frame filter handling.
hartkopp [Wed, 10 Jan 2007 16:26:33 +0000 (16:26 +0000)]
Fixed wrong error frame filter handling.
Moved CAN_ERR_MASK define to can.h .

git-svn-id: svn://svn.berlios.de//socketcan/trunk@128 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoSome new ASC files support 6 digits in decimal place.
hartkopp [Tue, 9 Jan 2007 16:01:46 +0000 (16:01 +0000)]
Some new ASC files support 6 digits in decimal place.
Added new option '-4' to generate 'old-style' ASC files.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@127 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded option '-L' to candump to create the compact logfile output on stdout.
hartkopp [Sun, 7 Jan 2007 11:19:37 +0000 (11:19 +0000)]
Added option '-L' to candump to create the compact logfile output on stdout.

Now you can forward CAN frames e.g. via netcat with candump and canplayer:

candump can0 can1 -L | canplayer vcan3=can0 vcan0=can1 -t

OK, maybe it would be reasonable to write a short program for this application.
But for some tests all this can be done with existing commandline tools.
In addition the filtering possibilities of candump can be used here.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@126 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoMinor fix and cosmetics in color handling in candump.c .
hartkopp [Sat, 6 Jan 2007 15:43:12 +0000 (15:43 +0000)]
Minor fix and cosmetics in color handling in candump.c .

Added new tool 'canplayer' to replay logfiles generated by candump -l .

Features of canplayer:

- Input from stdin or file.
- throttling of the replay to get nearly original timestamps / message gaps
- mapping and selection of CAN interfaces (assignment)
  e.g. canplay -I logfile vcan2=can2 vcan0=can1 can2=can3
  means: send frames received on can1 in the logfile to vcan0 and so on ...
- if no assignment is made the original interfaces are used for replay
- handling of multiple CAN interfaces simultaneously (if in logfile)
- option: throttle disable (do not look on timestamps => very FAST replay!)
- option: change the 'sleep time' in milli seconds

Remarks:
canplayer uses nanosleep() for throttling which means that the resolution of
the canplayer is about 1ms (Kernel HZ = 1000) or 10ms (Kernel HZ = 100).
After each nanosleep() all the CAN frames are send that had to be transmitted
until the timestamp at the current time. Giving e.g. the option '-g 500' for
500ms let's you see the behaviour. Using nanosleep() makes canplay a very
performant tool with minimum CPU load.

To transfer CAN frames over a TCP/IP network you may now say something like:
candump -> netcat -> netcat -> canplayer

git-svn-id: svn://svn.berlios.de//socketcan/trunk@125 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoremoved depreciated kmem_cache_t for kernel versions >= 2.6.20
hartkopp [Fri, 5 Jan 2007 16:57:53 +0000 (16:57 +0000)]
removed depreciated kmem_cache_t for kernel versions >= 2.6.20

git-svn-id: svn://svn.berlios.de//socketcan/trunk@124 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years ago- added error frame support in lib.c
hartkopp [Mon, 1 Jan 2007 18:29:52 +0000 (18:29 +0000)]
- added error frame support in lib.c
- added sprint_* functions for CAN-frame output in lib.c / lib.h
- added comments / cosmetics

candump.c:
- removed support for the output in ASC representation (moved to log2asc.c)
- added option '-l' for logfile creation e.g. 'candump-2007-01-01_164123.log'
- added funtionality to terminate candump by pressing [ENTER] (not only ^C)
- added error frame support
- added color support even when reading from 'any'
- three different color levels (e.g. -c -c -c)
- making use if lib.c

cangen.c:
-  CAN frames generator for testing purposes (e.g. on vcanx)
(nice when you're on vacancy at the baltic sea and have no real CAN source :)

log2long.c:
- convert compact CAN frame representation into user readable representation

log2asc.c:
- convert compact CAN frame logfile to ASC logfile for 3rd party CAN tools

Next step: Create a tool to replay candump logfiles.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@123 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agofixed includes and defines.
hartkopp [Thu, 14 Dec 2006 12:58:00 +0000 (12:58 +0000)]
fixed includes and defines.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@122 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoPreventing procfs output to overflow PAGE_SIZE.
hartkopp [Wed, 13 Dec 2006 07:47:34 +0000 (07:47 +0000)]
Preventing procfs output to overflow PAGE_SIZE.
Cosmetics in 2.4 af_can.c (looked broken & is unusual in the Kernel even when
it's ok for the compiler).

git-svn-id: svn://svn.berlios.de//socketcan/trunk@121 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoin 2.4, make rx_alldev_list part of the rx_dev_list.
thuermann [Tue, 12 Dec 2006 11:37:28 +0000 (11:37 +0000)]
in 2.4, make rx_alldev_list part of the rx_dev_list.
in 2.4, remove dynamically allocated dev_recv_lists on module unload.
add comment about possibly missing locking.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@120 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agobackported broadcast manager (BCM) changes from 2.6 socketcan tree.
hartkopp [Thu, 7 Dec 2006 16:20:18 +0000 (16:20 +0000)]
backported broadcast manager (BCM) changes from 2.6 socketcan tree.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@119 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoadded missing sanity checks in the case of socket error reporting.
hartkopp [Thu, 7 Dec 2006 13:13:20 +0000 (13:13 +0000)]
added missing sanity checks in the case of socket error reporting.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@118 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoBackported current functionality in Kernel 2.6 path to Kernel 2.4 path.
hartkopp [Thu, 7 Dec 2006 13:06:14 +0000 (13:06 +0000)]
Backported current functionality in Kernel 2.6 path to Kernel 2.4 path.

Changes:
- support for new sockopts CAN_RAW_LOOPBACK & CAN_RAW_RECV_OWN_MSGS
- allow raw socket filter with zero length
- check for alloc_skb failure
- DNAME macro in proc.c as preparation for rx_alldev_list changes

TODO:
- perform rx_alldev_list changes from revision 112/113
- remove device receive lists when unloading can.o from revision 115

git-svn-id: svn://svn.berlios.de//socketcan/trunk@117 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agofixed capabilites for Kernel 2.4 socketcan analog to fix in
hartkopp [Thu, 7 Dec 2006 08:27:33 +0000 (08:27 +0000)]
fixed capabilites for Kernel 2.4 socketcan analog to fix in
revision 107

git-svn-id: svn://svn.berlios.de//socketcan/trunk@116 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoremove device recv lists when unloading the can.ko module.
thuermann [Wed, 6 Dec 2006 15:13:19 +0000 (15:13 +0000)]
remove device recv lists when unloading the can.ko module.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@115 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoIn can_init(), call NETDEV_REGISTER notification for existing devices, like
hartkopp [Wed, 6 Dec 2006 13:48:00 +0000 (13:48 +0000)]
In can_init(), call NETDEV_REGISTER notification for existing devices, like
done in the register_notifier() function in linux 2.6.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@114 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agodon't allocate rx_alldev_list dynamically.
thuermann [Wed, 6 Dec 2006 12:20:15 +0000 (12:20 +0000)]
don't allocate rx_alldev_list dynamically.
make rx_alldev_list static as it's not used outside af_can.c.
add proper parentheses in DNAME() macro.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@113 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoMade the device receive list for sockets that are bound to 'any' interfaces an
hartkopp [Wed, 6 Dec 2006 10:42:02 +0000 (10:42 +0000)]
Made the device receive list for sockets that are bound to 'any' interfaces an
element of the rx_dev_list due to a discussion with Urs.
This has the effects:
1. The 'any' entries are shown in the procfs
2. remove of obsolete code
3. fix of debugging output (NULL pointer dereferencing)
4. preparation for removing the device receive lists in can_exit()

TODO: see point 4: The unloading of can.ko does not remove device receive
lists for devices that are currently registered.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@112 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoin NETDEV_REGISTER, add null pointer check, in case we insert the first
thuermann [Tue, 5 Dec 2006 14:37:24 +0000 (14:37 +0000)]
in NETDEV_REGISTER, add null pointer check, in case we insert the first
list item.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@111 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoRenamed #include<linux/config.h> to autoconf.h as config.h
hartkopp [Sat, 2 Dec 2006 11:49:02 +0000 (11:49 +0000)]
Renamed #include<linux/config.h> to autoconf.h as config.h
is no longer supported in Kernel 2.6.19.
In former Kernels config.h only included autoconf.h ...

git-svn-id: svn://svn.berlios.de//socketcan/trunk@110 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoFixed socket error reporting due to problems in hot-unplugging CAN-netdevices
hartkopp [Fri, 1 Dec 2006 12:05:39 +0000 (12:05 +0000)]
Fixed socket error reporting due to problems in hot-unplugging CAN-netdevices
like USB or PCMCIA. The fix is taken from the packet socket source.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@109 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoIntroduced return values for socketcan internal functions can_rx_register()
hartkopp [Wed, 29 Nov 2006 14:36:49 +0000 (14:36 +0000)]
Introduced return values for socketcan internal functions can_rx_register()
and can_rx_unregister().
Background: When hot-unplugging CAN netdevices (like CAN USB devices) the
device structures are removed due to the notifier in af_can.c.
As this notification is passed to the user-app, the user-app closes the socket
which causes the socket to remove the already nonexistent RX-entries.
This 'usual' unplugging event lead to a kernel error logging ...
Now the retval of the (un)register-functions gives the information to be
handled (if sensefull).

git-svn-id: svn://svn.berlios.de//socketcan/trunk@108 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agobug fix: meaning of CONFIG_CAN_RAW_USER and CONFIG_CAN_BCM_USER were negated.
thuermann [Tue, 28 Nov 2006 09:45:23 +0000 (09:45 +0000)]
bug fix: meaning of CONFIG_CAN_RAW_USER and CONFIG_CAN_BCM_USER were negated.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@107 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAPI fix (as described on the mailing list): call socket option
thuermann [Tue, 28 Nov 2006 09:43:07 +0000 (09:43 +0000)]
API fix (as described on the mailing list):  call socket option
CAN_RAW_ERR_FILTER with optval=0 instead of optlen=0 to clear the
error mask.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@106 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoadd and change some comments.
thuermann [Mon, 27 Nov 2006 19:34:34 +0000 (19:34 +0000)]
add and change some comments.
simplify the code for CAN_RAW_FILTER socket option.
don't remove filters in CAN_RAW_FILTER when an invalid address for a single
filter was given causing -EFAULT.
bug fix in CAN_RAW_FILTER: changed & to &&.
disallow optlen == 0 for CAN_RAW_LOOPBACK and CAN_RAW_RECV_OWN_MSGS.
remove a couple unnecessary type casts.
change prefix "af_can" to "CAN" in printk message.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@105 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agofix a typo in comment.
thuermann [Mon, 27 Nov 2006 11:47:38 +0000 (11:47 +0000)]
fix a typo in comment.
white-space changes.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@104 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agobackport from the 2.6 version:
thuermann [Mon, 27 Nov 2006 11:45:55 +0000 (11:45 +0000)]
backport from the 2.6 version:
- add 'loop' parameter to can_send().
- do loopback only if the interface hasn't IFF_LOOPBACK set.
- add struct can_proto and use that in can_proto_{,un}register().
- define type, protocol, and capability fields in struct can_proto instead
  of doing a switch() on type and proto in can_create().
- call protocol init function if defined.
- split off new function find_dev_rcv_lists() from find_rcv_list().
- rename struct rcv_list and rcv_dev_list to receiver and dev_rcv_lists.
- move memory allocation out of spin-locked region.
- rename struct notifier_list to notifier, and variable nlist to notifier_list.
- use kernel list implementation for notifier_list.
- protect access to notifier list by holding notifier_lock.
- use kmem_caches for struct receiver instead of kmalloc.
- do allocation/freeing of dev_rcv_lists in NETDEV_{,UN}REGISTER.
  + new element pprev in struct dev_rcv_lists to ease removal of list elements.
- rename CAN_MAX to CAN_NPROTO.
- rename some local variables for readability.
- rename raw_{init,exit}() to raw_module_{init,exit}().
- new function raw_init() to be called from can_create().
- return EINVAL from raw_bind() if already bound.

still TODO
- new ioctl's in raw.c: CAN_RAW_LOOPBACK, CAN_RAW_RECV_OWN_MSGS.
- allow setsockopt in raw.c to set 0 filters.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@103 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded debugging info to BCM procfs output to detect dataloss due to
hartkopp [Wed, 22 Nov 2006 19:36:42 +0000 (19:36 +0000)]
Added debugging info to BCM procfs output to detect dataloss due to
socket-queue overflow to the userspace application.
E.g. when the user-app is not able to deal with the (fast) data-updates from
the CAN-bus.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@102 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded / corrected some error handlings in the case of failing mallocs and
hartkopp [Sun, 19 Nov 2006 16:23:41 +0000 (16:23 +0000)]
Added / corrected some error handlings in the case of failing mallocs and
memcpy_fromiovec's.
Cosmetics.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@101 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoTADA! Revision 100 :-)
hartkopp [Sat, 18 Nov 2006 19:14:00 +0000 (19:14 +0000)]
TADA! Revision 100 :-)
Removed obsolete checkings and removed obsolete function.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@100 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded the possibility to set _no_ RX filter in CAN_RAW sockets as requested
hartkopp [Fri, 17 Nov 2006 15:55:09 +0000 (15:55 +0000)]
Added the possibility to set _no_ RX filter in CAN_RAW sockets as requested
by Wolfgang Grandegger on the socketcan-core mailinglist.
Updated tst-raw-filter testtool to checkout the functionality.
Indeed the setting of the default filter turned out to be much clearer in the
source code of raw.c. There's no swap-back to any default if the filter was
once changed by the user-space. Just a straight behavior. Tnx Wolfgang.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@99 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoupdated values to current settings in can.h to enable
hartkopp [Fri, 17 Nov 2006 15:18:55 +0000 (15:18 +0000)]
updated values to current settings in can.h to enable
autoloading of kernel-modules.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@98 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded include <sys/socket.h> to lib.c after discussion on commit-mailing-list.
hartkopp [Tue, 31 Oct 2006 10:41:21 +0000 (10:41 +0000)]
Added include <sys/socket.h> to lib.c after discussion on commit-mailing-list.
Fixed comments.
Fixed Makefile (remove all *.o files / added empty line at end of file).

git-svn-id: svn://svn.berlios.de//socketcan/trunk@97 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agonever try to include from /usr/include in kernel code:
thuermann [Mon, 30 Oct 2006 18:36:08 +0000 (18:36 +0000)]
never try to include from /usr/include in kernel code:
changed sys/socket.h to linux/socket.h.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@96 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded tiny tool cansend and a library to parse ASCII CAN frames (e.g. from
hartkopp [Mon, 30 Oct 2006 13:14:36 +0000 (13:14 +0000)]
Added tiny tool cansend and a library to parse ASCII CAN frames (e.g. from
the command line) that are defined in one concatenated string.
This is a requirement for the comming command line tool 'bcmsend' that allows
to send more than one CAN frame at a time.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@95 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoadded #include <sys/sockets.h> as it is needed for sa_family_t .
hartkopp [Mon, 30 Oct 2006 13:08:32 +0000 (13:08 +0000)]
added #include <sys/sockets.h> as it is needed for sa_family_t .

git-svn-id: svn://svn.berlios.de//socketcan/trunk@94 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agomove memory allocation out of spin-locked region.
thuermann [Fri, 27 Oct 2006 07:32:36 +0000 (07:32 +0000)]
move memory allocation out of spin-locked region.
remove two unnecessary checks for success of find_rcv_list().

git-svn-id: svn://svn.berlios.de//socketcan/trunk@93 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoFixed compiler warning & memory leak from Urs' last change.
hartkopp [Wed, 25 Oct 2006 15:44:50 +0000 (15:44 +0000)]
Fixed compiler warning & memory leak from Urs' last change.
Reworked rx-packet counting: Only count the rx-path on performed loopback
operation (in vcan.c or af_can.c). This gives the rx-counter a usable
content ...

git-svn-id: svn://svn.berlios.de//socketcan/trunk@92 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agorename can_device.[ch] to dev.[ch].
thuermann [Wed, 25 Oct 2006 11:59:41 +0000 (11:59 +0000)]
rename can_device.[ch] to dev.[ch].
move dev.h to include/linux/can.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@91 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agominor cleanups.
thuermann [Wed, 25 Oct 2006 11:48:17 +0000 (11:48 +0000)]
minor cleanups.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@90 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoUpdated to new IFF_LOOPBACK behaviour in af_can.c .
hartkopp [Wed, 25 Oct 2006 08:34:38 +0000 (08:34 +0000)]
Updated to new IFF_LOOPBACK behaviour in af_can.c .
Changed device type to ARPHDR_CAN.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@89 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoAdded support for interfaces that can perform the loopback inside the driver.
hartkopp [Wed, 25 Oct 2006 07:53:31 +0000 (07:53 +0000)]
Added support for interfaces that can perform the loopback inside the driver.
If so, set the IFF_LOOPBACK flag in your device.
If not, the loopback is still performed in af_can.c .

git-svn-id: svn://svn.berlios.de//socketcan/trunk@88 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoexplicitly initialize init() functions in bcm.c.
thuermann [Tue, 24 Oct 2006 18:09:10 +0000 (18:09 +0000)]
explicitly initialize init() functions in bcm.c.
removed and commented out unnecessary -I include options in Makefiles.
white-space clean up.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@87 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agochanged user space programs to use new include files.
thuermann [Tue, 24 Oct 2006 13:55:43 +0000 (13:55 +0000)]
changed user space programs to use new include files.
added missing include file <net/if.h> in most programs.
added volatile modifier to "int running" in candump.c.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@86 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoreorganized kernel include files:
thuermann [Tue, 24 Oct 2006 13:49:12 +0000 (13:49 +0000)]
reorganized kernel include files:
- move code from af_can.h to can.h
- move can.h to include/linux
- rename can_error.h and can_ioctl.h to error.h and ioctl.h
- changed all include directives accordingly

user space programs now include only linux/can.h, and linux/can/{raw,bcm.h}.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@85 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agoMove type, proto, and capability information about CAN protocols into
thuermann [Fri, 29 Sep 2006 08:24:54 +0000 (08:24 +0000)]
Move type, proto, and capability information about CAN protocols into
struct can_proto.  This simplifies can_create() significantly and allows
future CAN protocols to be loaded without the need to change af_can.c
Rename CAN_MAX to CAN_NPROTO.
Check for protocol numbers that are out of range in can_create().
Use find_dev_rcv_lists() in can_rcv() instead of scanning the list on our own.
Move comment on scanning the hlist.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@84 030b6a49-0b11-0410-94ab-b0dab22257f2

17 years agomake bcm_read_proc() static.
thuermann [Fri, 29 Sep 2006 07:11:29 +0000 (07:11 +0000)]
make bcm_read_proc() static.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@83 030b6a49-0b11-0410-94ab-b0dab22257f2