]> rtime.felk.cvut.cz Git - socketcan-devel.git/log
socketcan-devel.git
14 years agocan-utils: canfdtest, a full duplex test to find out-of-order messages
wolf [Wed, 25 Nov 2009 11:18:22 +0000 (11:18 +0000)]
can-utils: canfdtest, a full duplex test to find out-of-order messages

This patch is a pepped up version of Valdislav's canecho_gen and
canecho_dut test programs, which have prooved to be useful for
detecting out-of-order message transmisson and reception. Here
is a list of the changes and improvements:

- Both programs have been merged into on test program named
  canfdtest. Message generation can be selected via the command
  line option '-g'.
- The test loop count can be specified.
- A low and high verbosity level has been added.
- send/recv is used instead of write/read.
- The return code of send/recv is checked properly.
- Use Linux coding style.

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

14 years agonet/can: add driver for mscan family & mpc52xx_mscan
wolf [Sun, 22 Nov 2009 21:20:04 +0000 (21:20 +0000)]
net/can: add driver for mscan family & mpc52xx_mscan

Taken from socketcan-svn, fixed remaining todos, cleaned up, tested with a
phyCORE-MPC5200B-IO and a custom board.

From net-next-2.6 commit afa17a500a3667f66df450100538d06769529bba.

The old driver mpc52xx_can.c is kept for backward compatibility with
older kernel version.

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

14 years agocc770: move Kconfig entries into the cc770 sub-directory
wolf [Sat, 21 Nov 2009 20:36:39 +0000 (20:36 +0000)]
cc770: move Kconfig entries into the cc770 sub-directory

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

14 years agonet: Support specifying the network namespace upon device creation.
wolf [Sat, 21 Nov 2009 20:28:17 +0000 (20:28 +0000)]
net: Support specifying the network namespace upon device creation.

There is no good reason to not support userspace specifying the
network namespace during device creation, and it makes it easier
to create a network device and pass it to a child network namespace
with a well known name.

We have to be careful to ensure that the target network namespace
for the new device exists through the life of the call.  To keep
that logic clear I have factored out the network namespace grabbing
logic into rtnl_link_get_net.

In addtion we need to continue to pass the source network namespace
to the rtnl_link_ops.newlink method so that we can find the base
device source network namespace.

From net-next-2.6 commit 81adee47dfb608df3ad0b91d230fb3cef75f0060
adapted for SVN trunk.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1085 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agocan: Fix driver Kconfig structure
wolf [Sat, 21 Nov 2009 20:20:17 +0000 (20:20 +0000)]
can: Fix driver Kconfig structure

In 2.6.32-rc the new EMS USB CAN driver was contributed and added the Kconfig
entry right behind an entry of the same *vendor*. This teared the SJA1000
based driver selection into pieces.

This fix cleans up the 2.6.32-rc Kconfig files for the CAN drivers and moves
the SJA1000 and USB Kconfig portions into the belonging directories.

As there are many new CAN drivers in the queue getting this cleanup into
2.6.32-rc would massively reduce the problems for the upcoming drivers.

From net-2.6 commit b93cf3f0bb45560d2ce62bdcc2181c40660cfdbf adapted
for SVN rtunk

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

14 years agocan: fix setting mcp251x bit timing on open
wolf [Tue, 17 Nov 2009 20:12:25 +0000 (20:12 +0000)]
can: fix setting mcp251x bit timing on open

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1083 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agocan: add the missing netlink get_xstats_size callback
wolf [Mon, 16 Nov 2009 22:09:58 +0000 (22:09 +0000)]
can: add the missing netlink get_xstats_size callback

This patch adds the missing "get_xstats_size" callback for the
netlink interface, which is required if "fill_xstats" is used,
as pointed out by Patrick McHardy.

From net-2.6 commit 55369c0a6441e95062cfaeef6eefcfb357a31e8c

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1082 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agosyncs socketcan version of mcp251x driver to that accepted in mainline
wolf [Mon, 16 Nov 2009 22:00:13 +0000 (22:00 +0000)]
syncs socketcan version of mcp251x driver to that accepted in mainline

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1081 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agoAdd MODULE_FIRMWARE definitions.
hartkopp [Wed, 11 Nov 2009 06:38:03 +0000 (06:38 +0000)]
Add MODULE_FIRMWARE definitions.
These definitions should IMO live next to the card descriptions, which should
in turn live in the modules that actually drive the cards.
Therefore, this patch moves all PCMCIA card descriptions
& MODULE_FIRMWARE statements into softing_cs.
Before this patch, the card description was looked up twice.
The pc104 descriptions (which have not yet been tested) have no seperate
module to go into, and live still in softing_fw.c

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

14 years agobcm_proc_getifname() is called with RTNL and dev_base_lock
hartkopp [Sun, 8 Nov 2009 17:29:22 +0000 (17:29 +0000)]
bcm_proc_getifname() is called with RTNL and dev_base_lock
not held. It calls __dev_get_by_index() without locks, and
this is illegal (might crash)

Close the race by holding dev_base_lock and copying dev->name
in the protected section.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=6755aebaaf9fc5416acfd4578ab7a1e122ecbc74

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

14 years agocan: fix WARN_ON dump in net/core/rtnetlink.c:rtmsg_ifinfo()
wolf [Sun, 8 Nov 2009 13:48:06 +0000 (13:48 +0000)]
can: fix WARN_ON dump in net/core/rtnetlink.c:rtmsg_ifinfo()

On older kernels, e.g. 2.6.27, a WARN_ON dump in rtmsg_ifinfo()
is thrown when the CAN device is registered due to insufficient
skb space, as reported by various users. This patch adds the
rtnl_link_ops "get_size" to fix the problem. I think it's
required for more recent kernels as well, even if no WARN_ON
dumps are triggered. Maybe we also need it for the CAN xstats.

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

14 years agoIn 2.6.32+ the setsockopt function provides an unsigned optlen.
hartkopp [Fri, 6 Nov 2009 16:54:18 +0000 (16:54 +0000)]
In 2.6.32+ the setsockopt function provides an unsigned optlen.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b7058842c940ad2c08dd829b21e5c92ebe3b8758

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

14 years agoAdded channel information in sysfs.
hartkopp [Fri, 6 Nov 2009 15:46:21 +0000 (15:46 +0000)]
Added channel information in sysfs.

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

14 years ago- Fix 64bit division for 32bit systems.
hartkopp [Fri, 6 Nov 2009 15:32:27 +0000 (15:32 +0000)]
- Fix 64bit division for 32bit systems.
- Fix compile warning in dev_dbg() output
- Added include of <linux/sched.h> needed in 2.6.32
- Reordered timestamp functions to prevent a forward declaration.

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

14 years agoAdded hook to print selected logfile lines on stdout for further processing.
hartkopp [Fri, 6 Nov 2009 08:07:45 +0000 (08:07 +0000)]
Added hook to print selected logfile lines on stdout for further processing.

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

14 years agomscan: do not set err value on slprq timeout
wolf [Thu, 5 Nov 2009 16:33:04 +0000 (16:33 +0000)]
mscan: do not set err value on slprq timeout

If the RXACT flag is not cleared on the mscan, the slprq will eventually
fail. This could be the situation when some opposite is keeping resending
frames because of some communication errors. This way we will the initrq or
cswai will also not be set and the mscan controller will got stuck till
the bus is restarted. To avoid this we kick out setting the err value beyong a
slprq failure to let the controller proceed. This is hacky since calling e.g.
initrq while the mscan is really doing stuffs might disturb the bus
communication. For now we however don't have other possiblities to work around
the behaviour of mscan mentioned above.

Chanages to V1: turn dev_warn to dev_dbg. put part of the warning messages into
the comment

Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1073 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agomcp251x: SPI clean-up for mainline inclusion
wolf [Thu, 29 Oct 2009 19:57:41 +0000 (19:57 +0000)]
mcp251x: SPI clean-up for mainline inclusion

This patch clears the MCP251x SPI driver in trunk for mainline
submission. CAN bus transitions should be correctly handled now.

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1072 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agosja1000: fix improper library functions for skb allocation usage
wolf [Mon, 26 Oct 2009 10:54:44 +0000 (10:54 +0000)]
sja1000: fix improper library functions for skb allocation usage

The commit 1068 "can: provide library functions for skb allocation" did
forget to remove two line of the SJA1000 driver resulting in a
'skb_over_panic' when calling skb_put.

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

14 years agoWrap the CAN include/linux header files to include/socketcan
wolf [Thu, 15 Oct 2009 08:36:11 +0000 (08:36 +0000)]
Wrap the CAN include/linux header files to include/socketcan

To avoid conflicts with the *almost* similar kernel include files we
use a separate set of header files in include/socketcan (instead of
include/linux). But the include/linux header files are still needed
for the user space applications, e.g. the can-utils. To simplify
maintanance, wrappers to the corresponding files in include/socketcan
are used. Kernel-only header files are removed from include/linux.

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

14 years agoRework of can_if start script:
hartkopp [Thu, 8 Oct 2009 10:41:01 +0000 (10:41 +0000)]
Rework of can_if start script:
- make use of 'ip' tool from iproute2 package
- support Debian depency start scripts
- support setting of bitrates and restart-ms
- remove created vcan devices at shutdown

Thanks to Andre Naujoks.

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

14 years agocan: provide library functions for skb allocation
wolf [Wed, 7 Oct 2009 17:37:57 +0000 (17:37 +0000)]
can: provide library functions for skb allocation

This patch makes the private functions alloc_can_skb() and
alloc_can_err_skb() of the at91_can driver public and adapts all
drivers to use these. While making the patch I realized, that
the skb's are *not* setup consistently. The skb's are now setup
as shown:

skb->protocol = __constant_htons(ETH_P_CAN);
skb->pkt_type = PACKET_BROADCAST;
skb->ip_summed = CHECKSUM_UNNECESSARY;
*cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
memset(*cf, 0, sizeof(struct can_frame));

The frame is zeroed out to avoid uninitialized data to be passed
to user space.

Some drivers or library code used "htons(ETH_P_CAN)" or did not set
"pkt_type" or "ip_summed" or did not zero the fame.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1068 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agoems_usb: Increase MAX_TX_URBS
wolf [Wed, 7 Oct 2009 17:34:19 +0000 (17:34 +0000)]
ems_usb: Increase MAX_TX_URBS

This patch increases the maximum number of transmission URBs in flight.
This change results in a massively improved transmission performance.

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

14 years agoat91_can: sync with the version accepted for kernel inclusion
wolf [Wed, 30 Sep 2009 12:28:53 +0000 (12:28 +0000)]
at91_can: sync with the version accepted for kernel inclusion

Sync with commit 68f40152747da28ae0de21633c9062671448b66c
of Dave's net-2.6 tree.

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

14 years agoems_usb: sync with the version accepted for kernel inclusion
wolf [Wed, 30 Sep 2009 12:24:17 +0000 (12:24 +0000)]
ems_usb: sync with the version accepted for kernel inclusion

Snyc with commit 702171adeed3607ee9603ec30ce081411e36ae42
of David Miller's "net-2.6" tree.

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

14 years agoFix missing kernel version depency from commit rev 1060
hartkopp [Wed, 23 Sep 2009 18:14:40 +0000 (18:14 +0000)]
Fix missing kernel version depency from commit rev 1060

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

14 years agoFix kernel version depency from commit rev 1060
hartkopp [Wed, 23 Sep 2009 18:03:35 +0000 (18:03 +0000)]
Fix kernel version depency from commit rev 1060

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

14 years agoems_usb: move ems_usb.c into the sub-directory usb
wolf [Wed, 23 Sep 2009 09:50:16 +0000 (09:50 +0000)]
ems_usb: move ems_usb.c into the sub-directory usb

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

14 years agocan: make the number of echo skb's configurable
wolf [Tue, 22 Sep 2009 08:08:15 +0000 (08:08 +0000)]
can: make the number of echo skb's configurable

This patch allows the CAN controller driver to define the number
of echo skb's used for the local loopback (echo), as suggested by
Kurt, via:

  struct net_device *alloc_candev(int sizeof_priv,
                                  unsigned int echo_skb_max);

The drivers have been adapted accordingly. Please check if the
value of echo_skb_max is OK for your driver.

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

14 years agocan: Handle netdev->last_rx and netdev_tx_t properly for 2.6.31
wolf [Fri, 18 Sep 2009 12:01:20 +0000 (12:01 +0000)]
can: Handle netdev->last_rx and netdev_tx_t properly for 2.6.31

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

14 years agocan: mscan: fix TX message handling to ensure proper message ordering
wolf [Wed, 16 Sep 2009 08:42:21 +0000 (08:42 +0000)]
can: mscan: fix TX message handling to ensure proper message ordering

An out-of-order TX message problem has been reported and demonstrated
by Vladislav. The TX message buffers were not handled properly if
just one message was pending. This patch remembers the id of the buffer
used previously and increase the buffer priority if the next one has a
lower id number. This allows up to approx. 3*256 messages to be sent
until the lowest buffer priority of 255 is reached.

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

14 years agosja1000: fix network statistics update
wolf [Tue, 15 Sep 2009 18:42:01 +0000 (18:42 +0000)]
sja1000: fix network statistics update

The member "tx_bytes" of "struct net_device_stats" should be
incremented when the interrupt is done and an "arbitration
lost error" is a TX error and the statistics should be updated
accordingly.

See net-next-2.6 commit 8935f57e68c40c6469efe03f996bfb6150e18c6b

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

14 years agoat91_can: fix missing version dependencies for superfluous ->last_rx stores
wolf [Tue, 15 Sep 2009 18:37:11 +0000 (18:37 +0000)]
at91_can: fix missing version dependencies for superfluous ->last_rx stores

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

14 years agoat91_can: add NAPI support fix error and bus off handling
wolf [Tue, 15 Sep 2009 18:25:47 +0000 (18:25 +0000)]
at91_can: add NAPI support fix error and bus off handling

This patch updates the at91_can driver it features:
- NAPI for rx and error packages
  (tx and state changes stay in irq handler)
- implemented bus off and errror handling conforming to the
  Linux CAN API

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

14 years agocan: fix NOHZ local_softirq_pending 08 warning
hartkopp [Tue, 15 Sep 2009 17:29:13 +0000 (17:29 +0000)]
can: fix NOHZ local_softirq_pending 08 warning

When using nanosleep() in an userspace application we get a ratelimit warning

NOHZ: local_softirq_pending 08

for 10 times.

The echo of CAN frames is done from process context and softirq context only.
Therefore the usage of netif_rx() was wrong (for years).

This patch replaces netif_rx() with netif_rx_ni() which has to be used from
process/softirq context. It also adds a missing comment that can_send() must
no be used from hardirq context.

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>
Also in mainline.

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

14 years agoems_usb: Fix inconsistent naming of devs
wolf [Thu, 10 Sep 2009 14:18:23 +0000 (14:18 +0000)]
ems_usb: Fix inconsistent naming of devs

This patch fixes inconsistent use of netdev, dev and priv
variable names.

Signed-off-by: Sebastian Haas <haas@ems-wuensche.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1054 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agoems_usb: CAN/USB driver for EMS CPC-USB/ARM7 CAN interfaces
wolf [Thu, 10 Sep 2009 11:36:21 +0000 (11:36 +0000)]
ems_usb: CAN/USB driver for EMS CPC-USB/ARM7 CAN interfaces

This patch adds support for the CAN/USB interface CPC-USB/ARM7 from EMS
Dr. Thomas Wuensche.

Signed-off-by: Sebastian Haas <haas@ems-wuensche.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1053 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agoIntroduce KERNELDIR variable to allow override when invoking make on commandline.
hartkopp [Thu, 10 Sep 2009 08:01:00 +0000 (08:01 +0000)]
Introduce KERNELDIR variable to allow override when invoking make on commandline.

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

14 years agocan: sja1000: remove duplicated includes
hartkopp [Thu, 10 Sep 2009 07:43:36 +0000 (07:43 +0000)]
can: sja1000: remove duplicated includes

Following:

http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=e2372902d84af3443d421a984d812ec87eeb0758

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

14 years agoMove BCM server into can-utils as it is not test application anymore.
hartkopp [Thu, 10 Sep 2009 07:39:33 +0000 (07:39 +0000)]
Move BCM server into can-utils as it is not test application anymore.

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

14 years agoRemove obsolete 'vcan' tool.
hartkopp [Thu, 10 Sep 2009 07:34:06 +0000 (07:34 +0000)]
Remove obsolete 'vcan' tool.

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

14 years agoFix connotation remarked by Chris Verges.
hartkopp [Thu, 3 Sep 2009 06:32:43 +0000 (06:32 +0000)]
Fix connotation remarked by Chris Verges.

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

14 years agorevert code movement from previous commit.
hartkopp [Mon, 31 Aug 2009 14:41:15 +0000 (14:41 +0000)]
revert code movement from previous commit.

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

14 years agoUpdate minor changes from mainline, e.g.
hartkopp [Mon, 31 Aug 2009 12:16:26 +0000 (12:16 +0000)]
Update minor changes from mainline, e.g.

can: switch carrier on if device was stopped while in bus-off state
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=1b0d92244ff2434a98272f6d2525da32fc230f19

And reorder of can_update_spt() in can_calc_bittiming().

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

14 years agoSupport nested #if LINUX_VERSION_CODE ... conditions.
thuermann [Mon, 31 Aug 2009 09:02:05 +0000 (09:02 +0000)]
Support nested #if LINUX_VERSION_CODE ... conditions.
This is needed in kernel/2.6/drivers/net/can/mscan/mpc52xx_can.c.
Also fix white-space.

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

14 years agocan: use correct NET_RX_ return values
hartkopp [Mon, 31 Aug 2009 06:35:22 +0000 (06:35 +0000)]
can: use correct NET_RX_ return values

Dropped skb's should be documented by an appropriate return value.
Use the correct NET_RX_DROP and NET_RX_SUCCESS values for that reason.

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

14 years agoAdd support for seq_file in Kernels >= 2.6.26.
hartkopp [Mon, 31 Aug 2009 06:26:30 +0000 (06:26 +0000)]
Add support for seq_file in Kernels >= 2.6.26.

Provided by Alexey Dobriyan.

http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=ea00b8e2223170a842bee06e0f27754ccdf2a217

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

14 years agoSubstitute ND2D() macro by default when creating patches with mkpatch.
hartkopp [Thu, 27 Aug 2009 05:55:41 +0000 (05:55 +0000)]
Substitute ND2D() macro by default when creating patches with mkpatch.

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

14 years agoUpdated Kconfig entries that are already in mainline to the mainline content.
hartkopp [Thu, 27 Aug 2009 05:27:31 +0000 (05:27 +0000)]
Updated Kconfig entries that are already in mainline to the mainline content.

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

14 years agoUpdated Kconfig.kernel to latest mainline version.
hartkopp [Thu, 27 Aug 2009 05:20:55 +0000 (05:20 +0000)]
Updated Kconfig.kernel to latest mainline version.

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

14 years agocan: Use WARN_ONCE() instead of BUG_ON() for sanity check in receive path
hartkopp [Wed, 26 Aug 2009 12:20:34 +0000 (12:20 +0000)]
can: Use WARN_ONCE() instead of BUG_ON() for sanity check in receive path

Only for Kernel 2.6.27+
Upstream for Mainline 2.6.32

http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=1758c0947605211ef953cc91d6bbdf847a21b822

To ensure a proper handling of CAN frames transported in skbuffs some checks
need to be performed at receive time.

As stated by Michael Olbrich and Luotao Fu BUG_ON() might be to restrictive.
This is right as we can just drop the non conform skbuff and the Kernel can
continue working.

This patch replaces the BUG_ON() with a WARN_ONCE() so that the system remains
healthy but we made the problem visible (once).

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>
CC: Michael Olbrich <m.olbrich@pengutronix.de>
CC: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1039 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agomerged branches/netlink in rev. 1037 back to trunk.
hartkopp [Fri, 21 Aug 2009 10:00:21 +0000 (10:00 +0000)]
merged branches/netlink in rev. 1037 back to trunk.

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

14 years agonet/can bugfix: use after free bug in can protocol drivers
hartkopp [Mon, 20 Jul 2009 07:11:21 +0000 (07:11 +0000)]
net/can bugfix: use after free bug in can protocol drivers

Fix a use after free bug in can protocol drivers

The release functions of the can protocol drivers lack a call to
sock_orphan() which leads to referencing freed memory under certain
circumstances.

This patch fixes a bug reported here:
https://lists.berlios.de/pipermail/socketcan-users/2009-July/000985.html

net-2.6 git commit f7e5cc0c40dff92bad2894153f675c6c542ba2f0

Signed-off-by: Lothar Wassmann <LW@KARO-electronics.de>
Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1033 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agonet/can: add module alias to can protocol drivers
hartkopp [Mon, 20 Jul 2009 07:01:03 +0000 (07:01 +0000)]
net/can: add module alias to can protocol drivers

Add appropriate MODULE_ALIAS() to facilitate autoloading of can protocol drivers

git commit: b13bb2e9933b9dfa25c81d959d847c843481111e

Signed-off-by: Lothar Wassmann <LW@KARO-electronics.de>
Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1032 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agodev: add can_get_echo_skb() for cleanup purposes
wolf [Tue, 2 Jun 2009 11:57:19 +0000 (11:57 +0000)]
dev: add can_get_echo_skb() for cleanup purposes

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

14 years agodev: Use minimal set of SYSFS flies for intelligent CAN controllers
wolf [Tue, 2 Jun 2009 11:55:06 +0000 (11:55 +0000)]
dev: Use minimal set of SYSFS flies for intelligent CAN controllers

Active or intelligent CAN controllers do the setting of the bit-timing
internally rendering most of the standard bit-timing parameters for
the passive CAN controllers unnecessary. Usually just an index to a
fixed bit-time setting can be selected. For this purpose, just the
SYSFS file "can_bittiming/bitrate" will be created, if the CAN
bit-timing constants are not provided for the device.

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

14 years agoDriver for the esd PCI/331, CPCI/331 and PMC/331 cards
wolf [Tue, 2 Jun 2009 11:47:02 +0000 (11:47 +0000)]
Driver for the esd PCI/331, CPCI/331 and PMC/331 cards

This patch adds support for the PCI/331, CPCI/331 and PMC/331 CAN
interface cards from electronic system design gmbh.

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

15 years agoAdded slcand daemon contributed by Robert Haddon <robert.haddon@verari.com>
hartkopp [Tue, 5 May 2009 09:40:10 +0000 (09:40 +0000)]
Added slcand daemon contributed by Robert Haddon <robert.haddon@verari.com>

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

15 years agoAs the original code was already under GPL the additional license information was...
hartkopp [Tue, 5 May 2009 09:00:33 +0000 (09:00 +0000)]
As the original code was already under GPL the additional license information was removed.
Also moved the dual license BSD/GPL to only GPL.
Added some information about N_SLCAN in precompiled Kernels provided by Lionel Saugrain.

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

15 years agoAdded backport of slcan driver to kernel 2.4 tree.
hartkopp [Tue, 5 May 2009 08:49:03 +0000 (08:49 +0000)]
Added backport of slcan driver to kernel 2.4 tree.

Signed-off-by: Lionel Saugrain <lionel.saugrain at sogeti.com>
Signed-off-by: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@971 030b6a49-0b11-0410-94ab-b0dab22257f2

15 years agoDrivers for esd SJA1000 based PCI CAN cards
wolf [Thu, 23 Apr 2009 08:47:30 +0000 (08:47 +0000)]
Drivers for esd SJA1000 based PCI CAN cards

This patch adds support for SJA1000 based PCI CAN interface cards
from electronic system design gmbh.

The following list of boards are supported:

        CAN-PCI/200 (PCI)
        CAN-PCI/266 (PCI)
        CAN-PMC266 (PMC module)
        CAN-PCIe/2000 (PCI Express)
        CAN-CPCI/200 (Compact PCI, 3U)
        CAN-PCI104 (PCI104)

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@970 030b6a49-0b11-0410-94ab-b0dab22257f2

15 years agoFor the Network Drop Monitor introduced in 2.6.30 by Neil Horman the
hartkopp [Thu, 16 Apr 2009 08:43:14 +0000 (08:43 +0000)]
For the Network Drop Monitor introduced in 2.6.30 by Neil Horman the
end-of-line points for skbs that are not dropped due to errors should
use consume_skb() instead of kfree_skb() to not be monitored as a 'drop'.

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

15 years agoAdded commandline option '-r' to set the per-socket receive buffer size.
hartkopp [Thu, 16 Apr 2009 08:05:42 +0000 (08:05 +0000)]
Added commandline option '-r' to set the per-socket receive buffer size.

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

15 years agoRemoved the limitation for the number of CAN filters for each interface.
hartkopp [Mon, 6 Apr 2009 11:15:27 +0000 (11:15 +0000)]
Removed the limitation for the number of CAN filters for each interface.
Updated Copyright notice.
And finally: Yeah! I did something with malloc :-)

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

15 years agoAT91SAM9263 CAN driver taken from Marc's GIT repository
wolf [Mon, 6 Apr 2009 10:59:05 +0000 (10:59 +0000)]
AT91SAM9263 CAN driver taken from Marc's GIT repository
(http://pasiphae.extern.pengutronix.de/?p=mkl/linux-can;a=summary)
commit id 95742fd12484176ecaa7c54a1d08e744fac487e3
and adapted to work with the latest SVN version 963 of SocketCAN
according to SJA1000 driver. Changes:

- change register_netdev() to register_candev()
- fix bittiming constants to enable bitrates up to 1000000 bps
- some cosmetic changes and spelling errors fixes

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

15 years agoAdd functionality to
hartkopp [Mon, 6 Apr 2009 08:41:17 +0000 (08:41 +0000)]
Add functionality to
terminate after receiption of <count> CAN frames.

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

15 years agoproc 2/2: remove struct proc_dir_entry::owner
hartkopp [Fri, 3 Apr 2009 15:12:40 +0000 (15:12 +0000)]
proc 2/2: remove struct proc_dir_entry::owner

Updated SVN for Kernel versions > 2.6.29 following git commit

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=99b76233803beab302123d243eea9e41149804f3

from Alexey Dobriyan <adobriyan@gmail.com>

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

15 years agoAdded some more documentation.
hartkopp [Tue, 17 Mar 2009 14:50:02 +0000 (14:50 +0000)]
Added some more documentation.

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

15 years agoAdded signal handler (from Andre Naujoks) and read exit condition.
hartkopp [Wed, 11 Mar 2009 11:02:49 +0000 (11:02 +0000)]
Added signal handler (from Andre Naujoks) and read exit condition.

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

15 years agoAdded BCM receive functions 'R', 'F' and 'X'.
hartkopp [Wed, 11 Mar 2009 09:53:22 +0000 (09:53 +0000)]
Added BCM receive functions 'R', 'F' and 'X'.
Changed command parser to be robust for single chars and select().
Documentation & cosmetics.

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

15 years agoRemove some pointless conditionals before kfree_skb().
hartkopp [Sun, 1 Mar 2009 19:03:27 +0000 (19:03 +0000)]
Remove some pointless conditionals before kfree_skb().
(for Kernels > 2.6.16)

Following commit

http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=ce030edfb4ba6734248b8d9f98d0a6f1dcd142e7

from Wei Yongjun.

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

15 years agoAdd missing SET_NETDEV_DEV() in SJA1000 OF platform driver
wolf [Fri, 27 Feb 2009 07:54:30 +0000 (07:54 +0000)]
Add missing SET_NETDEV_DEV() in SJA1000 OF platform driver

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

15 years agoAdded base patch for 2.6.28 patch generation with mkpatch.
hartkopp [Tue, 24 Feb 2009 17:56:22 +0000 (17:56 +0000)]
Added base patch for 2.6.28 patch generation with mkpatch.

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

15 years agoSJA1000: remove dead code in sja1000.h
wolf [Thu, 19 Feb 2009 16:01:41 +0000 (16:01 +0000)]
SJA1000: remove dead code in sja1000.h

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

15 years agoSJA1000: generic OF platform bus driver
wolf [Wed, 18 Feb 2009 18:38:12 +0000 (18:38 +0000)]
SJA1000: generic OF platform bus driver

This patch adds a generic driver for SJA1000 chips on the OpenFirmware
platform bus found on embedded PowerPC systems. You need a SJA1000 node
definition in your flattened device tree source (DTS) file similar to:

   can@3,100 {
           compatible = "philips,sja1000";
           reg = <3 0x100 0x80>;
           clock-frequency = <8000000>;
           cdr-reg = <0x48>;
           ocr-reg = <0x0a>;
           interrupts = <2 0>;
           interrupt-parent = <&mpic>;
   };

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

15 years agoSome minor beautifications of output messages
wolf [Tue, 17 Feb 2009 11:28:31 +0000 (11:28 +0000)]
Some minor beautifications of output messages

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

15 years agoSJA1000: add missing netdev_ops support for > 2.6.29
wolf [Tue, 17 Feb 2009 11:27:17 +0000 (11:27 +0000)]
SJA1000: add missing netdev_ops support for > 2.6.29

We need that for kernel inclusion as well, puh!

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

15 years agoUse EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL for drivers
wolf [Tue, 17 Feb 2009 11:02:09 +0000 (11:02 +0000)]
Use EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL for drivers

As suggested by Sam, the safer approach is to be more restrictive.
If we later decide we want to support non-gpl we can be less restrictive.
Therefore let's go for the GPL version of the exports for now.

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

15 years agoUse type u64 instead of uint64_t as suggested by Sam
wolf [Tue, 17 Feb 2009 09:19:35 +0000 (09:19 +0000)]
Use type u64 instead of uint64_t as suggested by Sam

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

15 years agoMake CONFIG_CAN_DEV depend on SYSFS
wolf [Tue, 17 Feb 2009 09:18:21 +0000 (09:18 +0000)]
Make CONFIG_CAN_DEV depend on SYSFS

The device driver interface requires SYSFS for proper operation

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

15 years agoFix warnings reported by make sparse
wolf [Tue, 17 Feb 2009 09:17:15 +0000 (09:17 +0000)]
Fix warnings reported by make sparse

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

15 years agoAdd missing CAN_DEBUG_DEVICES Kconfig entry
wolf [Sun, 15 Feb 2009 19:34:29 +0000 (19:34 +0000)]
Add missing CAN_DEBUG_DEVICES Kconfig entry

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

15 years agoSpagetti code cleanup:
hartkopp [Sun, 15 Feb 2009 17:40:32 +0000 (17:40 +0000)]
Spagetti code cleanup:
Moved conversions into separate functions can2pty() and pty2can().
Updated and enhanced some comments.
Variable name cleanups inside the separate functions.
Fix handling on wrong pty commands (was a wrong 'continue' statement).

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

15 years agoPrelimary quilt patch stack for including the device drivers interface
wolf [Sun, 15 Feb 2009 10:38:25 +0000 (10:38 +0000)]
Prelimary quilt patch stack for including the device drivers interface

This is a prelimary quilt patch stack to include the CAN network
device driver interface and some drivers into Linux kernel. It is
based on the netdev GIT tree currently at version 2.6.29-rcX:

git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6

Please test and give feedback.

Wolfgang.

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

15 years agoMSCAN-MPC5200: more style fixes and make MSCAN variant depend on PPC
wolf [Sun, 15 Feb 2009 10:13:09 +0000 (10:13 +0000)]
MSCAN-MPC5200: more style fixes and make MSCAN variant depend on PPC

The MSCAN variant for the MPC5200 is also used on MPC512x processors
and therefore CONFIG_PPC_MPC52xx would not be correct any more.

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

15 years agoMSCAN: further cleanup, remove volatile and whitespace
wolf [Sun, 15 Feb 2009 08:21:25 +0000 (08:21 +0000)]
MSCAN: further cleanup, remove volatile and whitespace

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

15 years agoSJA1000: more cleanup and use SJA1000_MAX_IRQ instead of a plain number
wolf [Sat, 14 Feb 2009 20:40:46 +0000 (20:40 +0000)]
SJA1000: more cleanup and use SJA1000_MAX_IRQ instead of a plain number

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

15 years agoSJA1000: remove error message in ISR with shared interrupts
wolf [Sat, 14 Feb 2009 20:38:23 +0000 (20:38 +0000)]
SJA1000: remove error message in ISR with shared interrupts

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

15 years agoEnable device dev_dbg with CONFIG_CAN_DEBUG_DEVICES
wolf [Sat, 14 Feb 2009 14:35:38 +0000 (14:35 +0000)]
Enable device dev_dbg with CONFIG_CAN_DEBUG_DEVICES

The following patch allows to enable CAN device debug messages via
CONFIG_CAN_DEBUG_DEVICES and adds some useful dev_dbg() to dev.c,
sja1000.c and mscan.c.

The old MSCAN driver used dev_dbg() the heavy way, e.g. printing
messages for each message sent and received. I think that's only
useful for development.

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

15 years agoMSCAN/MPC52xx: copyright note fixes and beautification
wolf [Sat, 14 Feb 2009 14:32:35 +0000 (14:32 +0000)]
MSCAN/MPC52xx: copyright note fixes and beautification

I restricted the copyright to GPL v2 and added a copyright line for myself.
Furthermore, I changed the file header to a more usual format. I also
changed the MODULE_AUTHOR in mpc52xx_can.c to myself for my re-written
version using the OF platform.

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

15 years agodev.c: cleanup and name changes and more doc
wolf [Sat, 14 Feb 2009 14:31:34 +0000 (14:31 +0000)]
dev.c: cleanup and name changes and more doc

This patch briefly documents exported functions of the CAN device
driver interface. I also changed the module description to "CAN
network device driver interface" because it's more appropriate than
"CAN netdevice library", I think. Comments?
Finally, I fix the issue marked with "#ifdef FIXME".

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

15 years agoVarious fixes for dev.h
wolf [Sat, 14 Feb 2009 14:30:19 +0000 (14:30 +0000)]
Various fixes for dev.h

Remove spinlock_t stats_lock because it's not used anywhere. Add myself
to the copyright and correct macro name for the header file.

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

15 years agodrivers/net/can/Kconfig cleanup and beautification
wolf [Sat, 14 Feb 2009 14:29:41 +0000 (14:29 +0000)]
drivers/net/can/Kconfig cleanup and beautification

This patch fixes some white space issues and uses consequently the tag
"---help---" for help text. Furthermore it changes the type of
CAN_CALC_BITTIMING to "bool".

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

15 years agodev: print useful error message if the bit-timing is not valid
wolf [Sat, 14 Feb 2009 14:27:32 +0000 (14:27 +0000)]
dev: print useful error message if the bit-timing is not valid

This should avoid confusion when CONFIG_CAN_CALC_BITTIMING is disabled or
"ifconfig canX up" failed due to missing bit-timing setup.

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

15 years agoMakefile.common: allow CONFIG_CAN_CALC_BITTIMING to be disabled
wolf [Sat, 14 Feb 2009 14:26:52 +0000 (14:26 +0000)]
Makefile.common: allow CONFIG_CAN_CALC_BITTIMING to be disabled

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

15 years agomcp251x CAN driver: correctly initializes can error frame with zeros
wolf [Fri, 13 Feb 2009 16:42:21 +0000 (16:42 +0000)]
mcp251x CAN driver: correctly initializes can error frame with zeros

Use 64-bit access to clear message frame instead of memset as suggested
by Oliver Hartkopp.

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

15 years agomcp251x CAN driver: fixes race condition on module unload and can device up
wolf [Fri, 13 Feb 2009 16:40:34 +0000 (16:40 +0000)]
mcp251x CAN driver: fixes race condition on module unload and can device up

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@934 030b6a49-0b11-0410-94ab-b0dab22257f2

15 years agomcp251x CAN driver: fix issue with RX getting stuck on heavy load
wolf [Fri, 13 Feb 2009 16:39:46 +0000 (16:39 +0000)]
mcp251x CAN driver: fix issue with RX getting stuck on heavy load

This change fixes an issue with some CPU's (such as the PXA270)
that don't support level interrupts where interrupts get stuck
under heavy RX load.

This patch was suggested by Christian Pellegrin <chripell@evolware.org>, the
author of this driver.

Signed-off-by: Cliff Brake <cbrake@bec-systems.com>
Acked-by: Christian Pellegrin <chripell@fsfe.org>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@933 030b6a49-0b11-0410-94ab-b0dab22257f2

15 years agoAdded CONFIG_CAN_CALC_BITTIMING to be defined by default when compiling
hartkopp [Fri, 6 Feb 2009 10:03:54 +0000 (10:03 +0000)]
Added CONFIG_CAN_CALC_BITTIMING to be defined by default when compiling
CAN drivers on the SVN trunk. This fixes an issue caused by commit r920:
"Make CAN bit-timing calculation configurable"

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

15 years agoMSCAN-MPC52XX: fix section mismatch and OF compatible device list
wolf [Wed, 4 Feb 2009 20:14:42 +0000 (20:14 +0000)]
MSCAN-MPC52XX: fix section mismatch and OF compatible device list

We also need to support "fsl,mpc5200b-*" compatible nodes. We drop
legacy support for old compatible nodes (without fsl).

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

15 years agoAllow SLCAN RTR frames without data length code field.
hartkopp [Wed, 4 Feb 2009 16:51:04 +0000 (16:51 +0000)]
Allow SLCAN RTR frames without data length code field.

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