]> rtime.felk.cvut.cz Git - socketcan-devel.git/log
socketcan-devel.git
12 years agoAdd modifiers for sampling-point and sjw to can_if start/stop script. master
hartkopp [Fri, 30 Sep 2011 11:40:21 +0000 (11:40 +0000)]
Add modifiers for sampling-point and sjw to can_if start/stop script.

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

12 years agocandev: allow SJW user setting for bittiming calculation
hartkopp [Fri, 30 Sep 2011 10:02:24 +0000 (10:02 +0000)]
candev: allow SJW user setting for bittiming calculation

This patch adds support for SJW user settings to not set the synchronization
jump width (SJW) to 1 in any case when using the in-kernel bittiming
calculation.

The ip-tool from iproute2 already supports to pass the user defined SJW
value. The given SJW value is sanitized with the controller specific sjw_max
and the calculated tseg2 value. As the SJW can have values up to 4 providing
this value will lead to the maximum possible SJW automatically. A higher SJW
allows higher controller oscillator tolerances.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1276 030b6a49-0b11-0410-94ab-b0dab22257f2

12 years agoThe commit aabdcb0b553b9c9547b1a506b34d55a764745870 ("can bcm: fix tx_setup
hartkopp [Fri, 30 Sep 2011 06:23:03 +0000 (06:23 +0000)]
The commit aabdcb0b553b9c9547b1a506b34d55a764745870 ("can bcm: fix tx_setup
off-by-one errors") fixed only a part of the original problem reported by
Andre Naujoks. It turned out that the original code needed to be re-ordered
to reduce complexity and to finally fix the reported frame counting issues.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream commit: https://github.com/davem330/net/commit/12d0d0d3a7349daa95dbfd5d7df8146255bc7c67

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

12 years agocan bcm: fix tx_setup off-by-one errors
hartkopp [Thu, 29 Sep 2011 05:38:44 +0000 (05:38 +0000)]
can bcm: fix tx_setup off-by-one errors

This patch fixes two off-by-one errors that canceled each other out.
Checking for the same condition two times in bcm_tx_timeout_tsklet() reduced
the count of frames to be sent by one. This did not show up the first time
tx_setup is invoked as an additional frame is sent due to TX_ANNONCE.
Invoking a second tx_setup on the same item led to a reduced (by 1) number of
sent frames.

Reported-by: Andre Naujoks <nautsch@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream commit https://github.com/davem330/net/commit/aabdcb0b553b9c9547b1a506b34d55a764745870

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

12 years agogrr - fix whitespace issue to make strip-src work again.
hartkopp [Thu, 1 Sep 2011 09:55:35 +0000 (09:55 +0000)]
grr - fix whitespace issue to make strip-src work again.

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

12 years agoAdd missinf includes for tasklet usage.
hartkopp [Thu, 1 Sep 2011 09:49:42 +0000 (09:49 +0000)]
Add missinf includes for tasklet usage.

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

12 years agoAdd kernel version depency for Kernel 3.1.x which extended __rtnl_register().
hartkopp [Thu, 1 Sep 2011 09:43:16 +0000 (09:43 +0000)]
Add kernel version depency for Kernel 3.1.x which extended __rtnl_register().

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

12 years agoAdded missing inclusion of linux/types.h
hartkopp [Thu, 1 Sep 2011 09:32:47 +0000 (09:32 +0000)]
Added missing inclusion of linux/types.h

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

12 years agoBeautify check for valid CAN netdevices.
hartkopp [Thu, 1 Sep 2011 09:18:54 +0000 (09:18 +0000)]
Beautify check for valid CAN netdevices.

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

12 years agoFix whitespace issues remarked by checkpatch.pl
hartkopp [Thu, 1 Sep 2011 09:13:28 +0000 (09:13 +0000)]
Fix whitespace issues remarked by checkpatch.pl

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

12 years agoAs we're using skb_mac_header() functions which rely on the fact, that CAN
hartkopp [Wed, 31 Aug 2011 19:43:11 +0000 (19:43 +0000)]
As we're using skb_mac_header() functions which rely on the fact, that CAN
netdevices do not use the header_ops, we should test if these header_ops are
really not in use.

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

12 years agoUpdate copyright date for first mainline attempt.
hartkopp [Wed, 31 Aug 2011 19:33:36 +0000 (19:33 +0000)]
Update copyright date for first mainline attempt.

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

12 years agoAdded test script analogue to the LTP test to check the CAN networklayer.
hartkopp [Mon, 18 Jul 2011 17:30:47 +0000 (17:30 +0000)]
Added test script analogue to the LTP test to check the CAN networklayer.

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

12 years agoRemove unused variables detected by -Wunused-but-set-variable ...
hartkopp [Sat, 9 Jul 2011 18:04:47 +0000 (18:04 +0000)]
Remove unused variables detected by -Wunused-but-set-variable ...

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

12 years agoAdded new programm to test the CAN filters in af_can.c .
hartkopp [Sat, 9 Jul 2011 18:00:41 +0000 (18:00 +0000)]
Added new programm to test the CAN filters in af_can.c .
As the formerly test bench consisting of
- tst-filter-master.c
- tst-filter-server.c
- tst-filter-server.result
is pretty hard to use, this new tst-filter tool is intended to replace these
tools in the Linux test project LTP.

Together with tst-rcv-own-msgs, tst-filter is a complete new test bench then.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1263 030b6a49-0b11-0410-94ab-b0dab22257f2

12 years agoThe two options "CAN bit-timing calculation" and
hartkopp [Wed, 29 Jun 2011 16:54:18 +0000 (16:54 +0000)]
The two options "CAN bit-timing calculation" and
"Platform CAN drivers with Netlink support" have a "default Y". In order to
activate them by default, change to "default y".

Upstream commit: http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=a30d5155a4f80af3cbe1fe0366e9f0c6fdbfd8dd

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1262 030b6a49-0b11-0410-94ab-b0dab22257f2

12 years agominor doc changes ... tbc
hartkopp [Sun, 26 Jun 2011 12:47:21 +0000 (12:47 +0000)]
minor doc changes ... tbc

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

12 years agodocumentation: rework chapter numbering & references
hartkopp [Fri, 10 Jun 2011 19:08:26 +0000 (19:08 +0000)]
documentation: rework chapter numbering & references

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

12 years agonet: convert %p usage to %pK
hartkopp [Thu, 2 Jun 2011 18:58:43 +0000 (18:58 +0000)]
net: convert %p usage to %pK

Hide kernel pointer information using %pK in kernel 3.0 and up.

See upstream commits:

http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=71338aa7d050c86d8765cd36e46be514fb0ebbce
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=12e6c419b48c4d1803918e5d952ebee07bae7465

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1259 030b6a49-0b11-0410-94ab-b0dab22257f2

12 years agocan: avoids a false warning
hartkopp [Sat, 21 May 2011 12:03:55 +0000 (12:03 +0000)]
can: avoids a false warning

At this point optlen == sizeof(sfilter) but some compilers are dumb.

Reported-by: Németh Márton <nm127@freemail.h
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream commit:
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=4ffa87012efd7b664762b579213d4663560ef4a3

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

12 years agocan: rename can_try_module_get to can_get_proto
hartkopp [Thu, 5 May 2011 14:55:40 +0000 (14:55 +0000)]
can: rename can_try_module_get to can_get_proto

can_try_module_get does return a struct can_proto.
The name explains what is done in so much detail that a caller
may not notice that a struct can_proto is locked/unlocked.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1253 030b6a49-0b11-0410-94ab-b0dab22257f2

12 years agocan: make struct can_proto const
hartkopp [Thu, 5 May 2011 14:42:58 +0000 (14:42 +0000)]
can: make struct can_proto const

commit 53914b67993c724cec585863755c9ebc8446e83b had the
same message. That commit did put everything in place but
did not make can_proto const itself.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1252 030b6a49-0b11-0410-94ab-b0dab22257f2

12 years agonet: check the length of the socket address passed to connect(2)
hartkopp [Tue, 3 May 2011 11:39:23 +0000 (11:39 +0000)]
net: check the length of the socket address passed to connect(2)

I missed that upstream commit from Changli Gao.
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=6503d96168f891ffa3b70ae6c9698a1a722025a0
So here it comes for the BerliOS trunk also ... (in branches/j1939 it is already included)

Check the length of the socket address passed to connect(2). If the
length is invalid, -EINVAL will be returned.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1251 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocan: add missing socket check in {raw|bcm|isotp}_release functions
hartkopp [Wed, 20 Apr 2011 12:02:58 +0000 (12:02 +0000)]
can: add missing socket check in {raw|bcm|isotp}_release functions

We can get here with a NULL socket argument passed from userspace,
so we need to handle it accordingly.

Thanks to Dave Jones pointing at this issue in net/can/bcm.c

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1240 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agoFix common misspellings
hartkopp [Tue, 19 Apr 2011 14:15:21 +0000 (14:15 +0000)]
Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Upstream commit: http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=25985edcedea6396277003854657b5f3cb31a628

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

13 years agocan: convert protocol handling to RCU
hartkopp [Tue, 19 Apr 2011 13:31:20 +0000 (13:31 +0000)]
can: convert protocol handling to RCU

This patch removes spin_locks at CAN socket creation time by using RCU.

Inspired by the discussion with Kurt van Dijck and Eric Dumazet the RCU code
was partly derived from af_phonet.c

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1238 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocan: make struct proto const
hartkopp [Tue, 19 Apr 2011 13:03:41 +0000 (13:03 +0000)]
can: make struct proto const

can_ioctl is the only reason for struct proto to be non-const.
script/check-patch.pl suggests struct proto be const.

Setting the reference to the common can_ioctl() in all CAN protocols directly
removes the need to make the struct proto writable in af_can.c

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1237 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocan: test size of struct sockaddr in sendmsg
hartkopp [Tue, 19 Apr 2011 12:27:58 +0000 (12:27 +0000)]
can: test size of struct sockaddr in sendmsg

This patch makes the CAN socket code conform to the manpage of sendmsg.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1236 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocan-utils/lib: fix build issues introduced with sprintf_can_error_frame()
wolf [Mon, 14 Feb 2011 16:10:39 +0000 (16:10 +0000)]
can-utils/lib: fix build issues introduced with sprintf_can_error_frame()

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1235 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocandump: add option -e to dump error messages in human readable format
wolf [Mon, 14 Feb 2011 15:49:27 +0000 (15:49 +0000)]
candump: add option -e to dump error messages in human readable format

If "candump" is called with the option "-e", the error messages are
dumped in human readable format:

  # candump -e any,0:0,#FFFFFFFF
  ...
  can0  20000088  [8] 00 00 80 19 00 00 00 00   ERRORFRAME
        protocol-violation{{error-on-tx}{acknowledge-slot}}
        bus-error
        error-counter{tx{128}rx{97}}
  ...
  can0  2000008C  [8] 00 08 80 19 00 00 00 00   ERRORFRAME
        controller-problem{tx-error-warning}
        protocol-violation{{error-on-tx}{acknowledge-slot}}
        bus-error
        error-counter{tx{128}rx{97}}

"candump" actually calles a library function snprintf_can_error_frame()
to do the formatting. It could be used for other purposes as well.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1234 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agoslcan: fix referenced website in Kconfig help text
hartkopp [Thu, 3 Feb 2011 19:16:16 +0000 (19:16 +0000)]
slcan: fix referenced website in Kconfig help text

Fix the referenced project website to www.mictronics.de in the Kconfig
help text for the slcan driver.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1233 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocandump: Avoid ragged output of timestamp values when printing differential
hartkopp [Wed, 19 Jan 2011 17:43:07 +0000 (17:43 +0000)]
candump: Avoid ragged output of timestamp values when printing differential
timestamps (commandline option -td).
Idea & original patch by Uwe Bonnes.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1232 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocangen: set seed value for pseudo random numbers
hartkopp [Wed, 19 Jan 2011 17:35:37 +0000 (17:35 +0000)]
cangen: set seed value for pseudo random numbers

As pointed out by Andre Naujoks the pseudo random generator should be
initialized with a seed to prevend this ugly behaviour:

$ ./cangen vcan2 -v & ./cangen vcan1 -v
[1] 5995
  vcan2  567#69.98.3C.64.73.48
  vcan1  567#69.98.3C.64.73.48
  vcan2  451#4A.94.E8.2A.EC.58.55.62
  vcan1  451#4A.94.E8.2A.EC.58.55.62
  vcan2  729#BA.58.1B.3D.AB.D7.7E.50
  vcan1  729#BA.58.1B.3D.AB.D7.7E.50
(..)

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1231 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agoslcan_attach: added '-f' commandline option to read status flags.
hartkopp [Sun, 9 Jan 2011 11:49:20 +0000 (11:49 +0000)]
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>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1230 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agoslcan_attach: 'close' the slcan adapter before setting a bitrate
hartkopp [Sun, 9 Jan 2011 11:35:03 +0000 (11:35 +0000)]
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>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1229 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agoslcand: replace char pointers with static char buffers
hartkopp [Thu, 6 Jan 2011 19:20:18 +0000 (19:20 +0000)]
slcand: replace char pointers with static char buffers

The buffers to build the pathnames had been malloc'ed and never been free'd.
This patch removes the malloc stuff entirely.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1228 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocan-bcm: Use inode instead of kernel address for /proc file
hartkopp [Sat, 1 Jan 2011 17:14:20 +0000 (17:14 +0000)]
can-bcm: Use inode instead of kernel address for /proc file

Since the socket address is just being used as a unique identifier, its
inode number is an alternative that does not leak potentially sensitive
information.

CC-ing stable because MITRE has assigned CVE-2010-4565 to the issue.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream commit:
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=9f260e0efa4766e56d0ac14f1aeea6ee5eb8fe83

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

13 years agoCleanup of default target configs in Makefiles.
hartkopp [Sun, 12 Dec 2010 18:26:05 +0000 (18:26 +0000)]
Cleanup of default target configs in Makefiles.

Removed currently SVN-unmaintained drivers from default targets:

- the USB drivers EMS_USB and ESD_USB2 (are part of the Mainline kernel)
- the PCMCIA drivers (EMS/SOFTING) do not compile on recent kernels

Added to default targets:
- slcan
- cc770

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

13 years agocangw: Do not use skb->sk to detect already routed CAN frames.
hartkopp [Thu, 9 Dec 2010 18:58:59 +0000 (18:58 +0000)]
cangw: Do not use skb->sk to detect already routed CAN frames.

As the latest changes to the can-gw have shown, the use of skb->sk created
several problems and still looks like a bad hack.

While checking the struct skbuff for usable containers to detect routed CAN-
frames that do not interfere with other sophisticated network technique, the
pointers to the [transport|network|mac]_header looked interesting.

So we mark routed frames by setting some mac header length which is not
relevant for the CAN frames located in the skb->data section.

As dev->header_ops is not set in CAN netdevices no one is ever accessing the
various header offsets in the CAN skbuffs anyway. E.g. using the packet socket
to read CAN frames is still working after this change to gw.c .

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

13 years agoslcan: Add missing linux/sched.h include.
hartkopp [Thu, 9 Dec 2010 18:03:47 +0000 (18:03 +0000)]
slcan: Add missing linux/sched.h include.

drivers/net/can/slcan.c: In function 'slcan_open':
drivers/net/can/slcan.c:568: error: dereferencing pointer to incomplete type

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream commit:
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=84b3cdc38cd2882d7ac3c2ae4b6faf5c199874e3

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

13 years agoskb->sk is used in dev_pick_tx() which is called from dev_queue_xmit(). If
hartkopp [Mon, 6 Dec 2010 16:44:00 +0000 (16:44 +0000)]
skb->sk is used in dev_pick_tx() which is called from dev_queue_xmit(). If
sk points to an arbitrary magic value, dev_pick_tx() returns a wrong value,
which can lead to various memory corruption bugs.

In commit a4ee3ce3293dc931fab19beb472a8bde1295aebe dev_pick_tx() was
changed  to look the new field in socket called sk_tx_queue_mapping.

Original patch provided by Michal Sojka <sojkam1@fel.cvut.cz>

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

13 years agoRTNL is used as a global lock for all changes to network configuration.
hartkopp [Sun, 5 Dec 2010 19:37:16 +0000 (19:37 +0000)]
RTNL is used as a global lock for all changes to network configuration.
Therefore the cgw_list_lock was obvoiusly over-engineered 8-)
This patch makes use of the rtnl_lock to protect cangw route entry changes.

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

13 years agocapabilities have been dropped in 2.6.33
hartkopp [Tue, 30 Nov 2010 19:27:36 +0000 (19:27 +0000)]
capabilities have been dropped in 2.6.33
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.33.y.git;a=commitdiff;h=13f18aa05f5abe135f47b6417537ae2b2fedc18c

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

13 years agoslcan: Fix whitespace issues for mainline.
hartkopp [Mon, 29 Nov 2010 19:59:27 +0000 (19:59 +0000)]
slcan: Fix whitespace issues for mainline.

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

13 years agoKconfig: Remove trailing whitespace.
hartkopp [Mon, 29 Nov 2010 19:48:07 +0000 (19:48 +0000)]
Kconfig: Remove trailing whitespace.

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

13 years agoUpdated slcan Kconfig entry for mainlining.
hartkopp [Mon, 29 Nov 2010 19:33:19 +0000 (19:33 +0000)]
Updated slcan Kconfig entry for mainlining.

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

13 years agocandump: Added '-u <usecs>' commandline option to delay bridged CAN frames by
hartkopp [Mon, 29 Nov 2010 19:11:11 +0000 (19:11 +0000)]
candump: Added '-u <usecs>' commandline option to delay bridged CAN frames by
usecs microseconds.

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

13 years agocangen: Added '-n <count>' commandline option analogue to candump tool.
hartkopp [Mon, 29 Nov 2010 18:58:12 +0000 (18:58 +0000)]
cangen: Added '-n <count>' commandline option analogue to candump tool.
Inspired by Uwe Bonnes.

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

13 years agoAdded missing #include redirections.
hartkopp [Tue, 23 Nov 2010 09:41:17 +0000 (09:41 +0000)]
Added missing #include redirections.

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

13 years agoAdded new documentation layout contributed by Daniele Venzano.
hartkopp [Mon, 22 Nov 2010 19:41:13 +0000 (19:41 +0000)]
Added new documentation layout contributed by Daniele Venzano.

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

13 years agoslcand : added new commandline option to support direct assignment of a CAN
hartkopp [Fri, 19 Nov 2010 19:52:39 +0000 (19:52 +0000)]
slcand : added new commandline option to support direct assignment of a CAN
netdevice name to the given tty (by renaming the created netdevice).

Signed-off-by: Robert Haddon <robert.haddon@cirrascale.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1213 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agoslcan: let network statistic handling look like in slip.c
hartkopp [Thu, 18 Nov 2010 21:31:41 +0000 (21:31 +0000)]
slcan: let network statistic handling look like in slip.c

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

13 years agoslcan: clean up #includes
hartkopp [Thu, 18 Nov 2010 20:36:40 +0000 (20:36 +0000)]
slcan: clean up #includes

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

13 years agoslcan: This commit reverts commit rev1171 that has been done to
hartkopp [Thu, 18 Nov 2010 20:19:23 +0000 (20:19 +0000)]
slcan: This commit reverts commit rev1171 that has been done to
enable the swtc char hack. Once swtc has gone the upstream commit
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=5342b77c4123ba39f911d92a813295fb3bb21f69
is restored now to his original extend.

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

13 years agoMostly cosmetic changes to make the code look similar to the latest
hartkopp [Thu, 18 Nov 2010 19:51:14 +0000 (19:51 +0000)]
Mostly cosmetic changes to make the code look similar to the latest
net-next-2.6/drivers/net/slip.c code where it has been updated since
we branched slcan.c.

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

13 years agoslcan: Remove unused debug stuff.
hartkopp [Wed, 17 Nov 2010 18:43:00 +0000 (18:43 +0000)]
slcan: Remove unused debug stuff.

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

13 years agoslcan: Change copyright/module author according to the real maintainer.
hartkopp [Wed, 17 Nov 2010 18:35:54 +0000 (18:35 +0000)]
slcan: Change copyright/module author according to the real maintainer.

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

13 years agoslcan: Create netdevice names 'slcan%d' instead of 'can%d' to make it easier to
hartkopp [Wed, 17 Nov 2010 18:27:37 +0000 (18:27 +0000)]
slcan: Create netdevice names 'slcan%d' instead of 'can%d' to make it easier to
rename the netdevices to wanted assignments.

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

13 years agoslcan: Revert SVN commit r1170 (SWTC char hack), as it is superfluous.
hartkopp [Wed, 17 Nov 2010 18:23:18 +0000 (18:23 +0000)]
slcan: Revert SVN commit r1170 (SWTC char hack), as it is superfluous.
https://lists.berlios.de/pipermail/socketcan-users/2010-November/001652.html

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

13 years agoslcan_attach: Added new commandline option to specify the created netdevice name.
hartkopp [Wed, 17 Nov 2010 11:55:46 +0000 (11:55 +0000)]
slcan_attach: Added new commandline option to specify the created netdevice name.

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

13 years agoslcan_attach: Print the name of the assigned netdevice after attaching the tty.
hartkopp [Wed, 17 Nov 2010 06:59:20 +0000 (06:59 +0000)]
slcan_attach: Print the name of the assigned netdevice after attaching the tty.

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

13 years agoisotp: the timestamp for rx stmin enforcement was reset in the function that
hartkopp [Mon, 15 Nov 2010 15:08:36 +0000 (15:08 +0000)]
isotp: the timestamp for rx stmin enforcement was reset in the function that
receives the flow control. Of course it has to be in the funtion that sends
the FC to the sender of the data. :-(
This patch fixes the rx/tx issue.

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

13 years agoAdded new socketoptions to force the isotp protocol to intentionally
hartkopp [Sun, 14 Nov 2010 08:55:06 +0000 (08:55 +0000)]
Added new socketoptions to force the isotp protocol to intentionally
misbehave for regression tests.

CAN_ISOTP_TX_STMIN:
Set a value in nano secs that's used as minimum CF gap by the sender.
This value is used instead of the value provided by the receiver inside the FC.

CAN_ISOTP_RX_STMIN:
Ignores received CF frames which timestamps differ less than this value in nano
secs. This is used to test the receivers misbehaviour when the receiver
provides a lower stmin value that he's able to cope with. Received CF frames
are silently dropped when they come faster than specified by this value.

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

13 years agocan-bcm: fix minor heap overflow
hartkopp [Sat, 13 Nov 2010 16:43:29 +0000 (16:43 +0000)]
can-bcm: fix minor heap overflow

On 64-bit platforms the ASCII representation of a pointer may be up to 17
bytes long. This patch increases the length of the buffer accordingly.

http://marc.info/?l=linux-netdev&m=128872251418192&w=2

Reported-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
CC: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream Commit:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0597d1b99fcfc2c0eada09a698f85ed413d4ba84

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

13 years agocan-raw: add msg_flags to distinguish local traffic
hartkopp [Fri, 22 Oct 2010 05:24:03 +0000 (05:24 +0000)]
can-raw: add msg_flags to distinguish local traffic

CAN has no addressing scheme. It is currently impossible for userspace
to tell is a received CAN frame comes from another process on the local
host, or from a remote CAN device.

This patch add support for userspace applications to distinguish between
'own', 'local' and 'remote' CAN traffic. The distinction is made by returning
flags in msg->msg_flags in the call to recvmsg().

The added documentation explains the introduced flags.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream commit:
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=1e55659ce6ddb5247cee0b1f720d77a799902b85

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

13 years agoAdded information how to obtain timestamps as suggested by
hartkopp [Thu, 30 Sep 2010 12:51:54 +0000 (12:51 +0000)]
Added information how to obtain timestamps as suggested by
Daniele Venzano <venza@brownhat.org>. Extended the possibility
to get timestamps via recvmsg().

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

13 years agoFix datatype issue in sscanf() on 64bit systems.
hartkopp [Sat, 25 Sep 2010 10:24:37 +0000 (10:24 +0000)]
Fix datatype issue in sscanf() on 64bit systems.

On 64bit systems a 'long' is a 64bit value but the target values of scanf()
are always 32bit in the affected code - which means just an 'unsigned int'.
Unsigned int is fine on 32 and 64 bit systems.

Thanks to Andre Naujoks for reporting this issue.

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

13 years agoAdded support for inverted CAN ID filters.
hartkopp [Fri, 24 Sep 2010 18:23:42 +0000 (18:23 +0000)]
Added support for inverted CAN ID filters.

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

13 years agoFixed calculation of needed bits on the physical wire according Ken Tindells
hartkopp [Fri, 24 Sep 2010 17:56:53 +0000 (17:56 +0000)]
Fixed calculation of needed bits on the physical wire according Ken Tindells
*worst* case calculation for stuff-bits.
(see "Guaranteeing Message Latencies on Controller Area Network" 1st ICC'94)
Due to the bitstuffing estimation the calculated busload may exceed 100%.

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

13 years agocan: add limit for nframes and clean up signed/unsigned variables
hartkopp [Fri, 13 Aug 2010 16:15:16 +0000 (16:15 +0000)]
can: add limit for nframes and clean up signed/unsigned variables

This patch adds a limit for nframes as the number of frames in TX_SETUP and
RX_SETUP are derived from a single byte multiplex value by default.
Use-cases that would require to send/filter more than 256 CAN frames should
be implemented in userspace for complexity reasons anyway.

Additionally the assignments of unsigned values from userspace to signed
values in kernelspace and vice versa are fixed by using unsigned values in
kernelspace consistently.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Reported-by: Ben Hawkes <hawkes@google.com>
Acked-by: Urs Thuermann <urs.thuermann@volkswagen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream commit:
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=5b75c4973ce779520b9d1e392483207d6f842cde

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

13 years agoUpdated tool for a userfriendly result output.
hartkopp [Mon, 9 Aug 2010 14:00:21 +0000 (14:00 +0000)]
Updated tool for a userfriendly result output.

user@host:~/socketcan/trunk/test$ /bin/ip link show vcan0
9: vcan0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc noqueue state UNKNOWN
    link/can
user@host:~/socketcan/trunk/test$ ./tst-rcv-own-msgs vcan0
Starting PF_CAN frame flow test.
checking socket default settings ... ok.
check loopback 0 recv_own_msgs 0 ... ok.
check loopback 0 recv_own_msgs 1 ... ok.
check loopback 1 recv_own_msgs 0 ... ok.
check loopback 1 recv_own_msgs 1 ... ok.
PF_CAN frame flow test was successful.
user@hosts:~/socketcan/trunk/test$ echo $?
0

Remarks:

No need to make sure (in a script) that the CAN device has IFF_ECHO flags set!

e.g. with
/bin/ip link show vcan0 | grep -c ECHO

The return code of tst-rcv-own-msgs is
0 (success)
1 (failure)

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

13 years agoAdded mandatory commandline option to specify the CAN network device.
hartkopp [Thu, 29 Jul 2010 09:44:09 +0000 (09:44 +0000)]
Added mandatory commandline option to specify the CAN network device.

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

13 years agoAdded test programm to check the correct functionality of
hartkopp [Thu, 29 Jul 2010 09:11:12 +0000 (09:11 +0000)]
Added test programm to check the correct functionality of
CAN_RAW_LOOPBACK and CAN_RAW_RECV_OWN_MSGS socket options.

It needs a vcan0 virtual CAN network interface and should produce an output like this, when invoked:

sockopt default
 t : 0
 timeout
sockopt - -
 timeout
sockopt - R
 timeout
sockopt L -
 t : 3
 timeout
sockopt L R
 s : 4
 t : 4
 timeout
done.

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

13 years agocan-calc-bit-timing: remove rtcantl1
bet-frogger [Tue, 20 Jul 2010 14:10:38 +0000 (14:10 +0000)]
can-calc-bit-timing: remove rtcantl1

No one can verify the timing parameters to be correct.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1190 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocan-calc-bit-timing: add more can controller definitions and ref clocks
bet-frogger [Tue, 20 Jul 2010 13:43:20 +0000 (13:43 +0000)]
can-calc-bit-timing: add more can controller definitions and ref clocks

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1189 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocan-calc-bit-timing: calculate bit timings for all known controllers by default
bet-frogger [Tue, 20 Jul 2010 13:43:16 +0000 (13:43 +0000)]
can-calc-bit-timing: calculate bit timings for all known controllers by default

When testing or improving the bit timing algorithm, you're probably
interested in the values of all can controllers. Further you might not
know the all reference clocks of the controllers.

This patch add a "ref_clock" member to the "struct can_bittiming_const"
that holds the reference clock of the controller in Hz.

By default now the bit timing is calculated for all known can
controllers with the default ref_clock defined in "can_bittiming_const".

It's still possible to overwrite the ref clock with the command line
option "-c".

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1188 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocan-calc-bit-timing: improve printing of bit timing parameters
bet-frogger [Tue, 20 Jul 2010 13:43:12 +0000 (13:43 +0000)]
can-calc-bit-timing: improve printing of bit timing parameters

This patch adds additional fields when printing the bit timing
parameters. Now the real bitrate the nominal and the real sample point
as well as the error of the sample point is displayed.

The output now looks like this:

Bit timing parameters for at91 with 100.000000 MHz ref clock
nominal                                 real Bitrt   nom  real SampP
Bitrate TQ[ns] PrS PhS1 PhS2 SJW BRP Bitrate Error SampP SampP Error     CAN_BR
1000000     50   7    7    5   1   5 1000000  0.0% 75.0% 75.0%  0.0% 0x00040664
 800000     50   8    8    8   1   5  800000  0.0% 80.0% 68.0% 15.0% 0x00040777
 500000    100   8    8    3   1  10  500000  0.0% 87.5% 85.0%  2.9% 0x00090772
 250000    250   6    7    2   1  25  250000  0.0% 87.5% 87.5%  0.0% 0x00180561
 125000    500   6    7    2   1  50  125000  0.0% 87.5% 87.5%  0.0% 0x00310561
 100000    500   8    8    3   1  50  100000  0.0% 87.5% 85.0%  2.9% 0x00310772
  50000   1250   6    7    2   1 125   50000  0.0% 87.5% 87.5%  0.0% 0x007c0561
  20000 ***bitrate not possible***
  10000 ***bitrate not possible***

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1187 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocan-calc-bit-timing: use algorithm from the kernel
bet-frogger [Tue, 20 Jul 2010 13:43:08 +0000 (13:43 +0000)]
can-calc-bit-timing: use algorithm from the kernel

This patch copies the algorithm functions (can_update_spt and
can_calc_bittiming) from the kernel. Then some glue code is added that
these functions compile in userspace.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1186 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agocan-calc-bit-timing: fix indention
bet-frogger [Tue, 20 Jul 2010 13:43:04 +0000 (13:43 +0000)]
can-calc-bit-timing: fix indention

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1185 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agoadd can-calc-bit-timing to Makefiles + gitignore
bet-frogger [Tue, 20 Jul 2010 13:43:01 +0000 (13:43 +0000)]
add can-calc-bit-timing to Makefiles + gitignore

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1184 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agoadd can-calc-bit-timing
bet-frogger [Tue, 20 Jul 2010 13:42:57 +0000 (13:42 +0000)]
add can-calc-bit-timing

Add the tool as sent by Wolfgang via email
(<4BE152D2.6060306@grandegger.com>).

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1183 030b6a49-0b11-0410-94ab-b0dab22257f2

13 years agoAdded PCI device ID for the PCAN Express Card hardware.
hartkopp [Tue, 22 Jun 2010 20:41:17 +0000 (20:41 +0000)]
Added PCI device ID for the PCAN Express Card hardware.
Updated module descriptions with PCIe(xpress).

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

13 years agoMake protected command register access CONFIG_SMP unconditional.
hartkopp [Wed, 19 May 2010 16:21:00 +0000 (16:21 +0000)]
Make protected command register access CONFIG_SMP unconditional.
Added missing spin_lock_init() for the defined locking variable.

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

13 years agoFix writes to the SJA1000 command register on SMP systems.
hartkopp [Mon, 17 May 2010 10:22:59 +0000 (10:22 +0000)]
Fix writes to the SJA1000 command register on SMP systems.

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

13 years agoRemove compiler warning :
hartkopp [Fri, 14 May 2010 12:50:17 +0000 (12:50 +0000)]
Remove compiler warning :
warning: suggest explicit braces to avoid ambiguous ‘else’

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

13 years agoAdded isotpserver in autotool config file and gitignore
hartkopp [Fri, 14 May 2010 12:43:42 +0000 (12:43 +0000)]
Added isotpserver in autotool config file and gitignore

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

13 years agoAdded tiny ip server to send ISO 15765-2 PDUs via internetsockets to the CAN bus...
hartkopp [Fri, 14 May 2010 12:03:32 +0000 (12:03 +0000)]
Added tiny ip server to send ISO 15765-2 PDUs via internetsockets to the CAN bus and vice versa.

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

13 years agoAllow to have 4, 5 or 6 decimal places instead of only 4 & 6.
hartkopp [Tue, 11 May 2010 10:01:49 +0000 (10:01 +0000)]
Allow to have 4, 5 or 6 decimal places instead of only 4 & 6.

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

13 years agoUpdated gwtest.c to latest netlink CAN GW API.
hartkopp [Tue, 27 Apr 2010 06:03:58 +0000 (06:03 +0000)]
Updated gwtest.c to latest netlink CAN GW API.

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

14 years agoadd autotools infrastructure
bet-frogger [Mon, 19 Apr 2010 12:12:18 +0000 (12:12 +0000)]
add autotools infrastructure

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1174 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agoadd .gitignore
bet-frogger [Mon, 19 Apr 2010 12:12:04 +0000 (12:12 +0000)]
add .gitignore

This may be usefull once the can-utils are migrated to git.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1173 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agocangw: replace obsolete bzero by memset
bet-frogger [Mon, 19 Apr 2010 12:11:49 +0000 (12:11 +0000)]
cangw: replace obsolete bzero by memset

uclibc for example doesn't implement bzero

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1172 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agoThe cleanup of slc_alloc() integrated in SVN Rev1095 based on upstream commit
hartkopp [Sun, 18 Apr 2010 09:03:15 +0000 (09:03 +0000)]
The cleanup of slc_alloc() integrated in SVN Rev1095 based on upstream commit
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=5342b77c4123ba39f911d92a813295fb3bb21f69
was not really Kernel-version depended ...

So far this code section is needed for the changes added in SVN Rev1170 so we
would need to revisit this code when mainlining the driver.

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

14 years agoAdded possibility to force the slcan driver to use a specific device number
hartkopp [Fri, 16 Apr 2010 19:39:09 +0000 (19:39 +0000)]
Added possibility to force the slcan driver to use a specific device number
when set via SWTC char (e.g. with stty). See thread
https://lists.berlios.de/pipermail/socketcan-users/2010-April/001378.html
Provided by Stephen Hellriegel <Stephen.Hellriegel@verari.com>
So far this change only applies for Kernels < 2.6.32 ...

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

14 years agoThere is no reason why the 'real' SLCAN interfaces should have a different
hartkopp [Fri, 16 Apr 2010 19:08:34 +0000 (19:08 +0000)]
There is no reason why the 'real' SLCAN interfaces should have a different
naming scheme than other 'real' CAN interfaces.
So create canX instead of slcX network device names with the slcan driver.

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

14 years agoAs Stephen Hellriegel pointed out in
hartkopp [Fri, 16 Apr 2010 19:03:14 +0000 (19:03 +0000)]
As Stephen Hellriegel pointed out in
https://lists.berlios.de/pipermail/socketcan-users/2010-April/001378.html
it does not make sense to monitor the tx data flow in the slcan driver as
we do not know anything about the CAN specific problems that may occur in the
slcan device.

Therefore we just wait until the ASCII data is sent on the serial line without
having a separate timeout handler in the slcan driver.

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

14 years agoAdded CRC8 profiles to handle additional data for checksum generation.
hartkopp [Fri, 16 Apr 2010 08:46:17 +0000 (08:46 +0000)]
Added CRC8 profiles to handle additional data for checksum generation.

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

14 years agoAdded checksum functionality and some documentation in gw.h
hartkopp [Mon, 12 Apr 2010 14:41:14 +0000 (14:41 +0000)]
Added checksum functionality and some documentation in gw.h

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

14 years agoComplete rework of CAN netlink gateway.
hartkopp [Sat, 10 Apr 2010 16:38:48 +0000 (16:38 +0000)]
Complete rework of CAN netlink gateway.

Major changes:

- rework internal structures to prepare routings and modifications of CAN traffic also to non-CAN interfaces
- fix reading of netlink messages in cangw.c (added RTCAN_RTA / RTCAN_PAYLOAD macros)
- rework reading of gw-job lists in cgw_dump_jobs()
- rename of functions and API definitions to have a common namespace cgw_
- added infrastructure to perform crc8 and xor checksums in CAN frame data[]

TODO:

- add and test functionality for crc8 and xor checksums in CAN frame data[]
- add help text for crc8 and xor checksums in CAN frame data[]

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

14 years agoThese issues have been solved already
hartkopp [Thu, 25 Mar 2010 19:32:43 +0000 (19:32 +0000)]
These issues have been solved already

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1164 030b6a49-0b11-0410-94ab-b0dab22257f2