hartkopp [Fri, 24 Oct 2008 13:42:42 +0000 (13:42 +0000)]
This patch ensures that can_calc_bittiming() returns an error (-EDOM) if
the bit-rate error is greater than 5%. In that case, it's very unlikely
that the determined bit-timing works properly anyhow.
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@851 030b6a49-0b11-0410-94ab-b0dab22257f2
hartkopp [Thu, 23 Oct 2008 10:17:31 +0000 (10:17 +0000)]
Move sja1000 cdr and ocr defines into platform header as discussed on
SocketCAN ML:
https://lists.berlios.de/pipermail/socketcan-core/2008-October/002032.html
Signed-off-by: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@847 030b6a49-0b11-0410-94ab-b0dab22257f2
hartkopp [Wed, 22 Oct 2008 13:39:50 +0000 (13:39 +0000)]
From 0dcf8e2f6a5f453dca20b71aa146a28b470f4b07 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Sun, 19 Oct 2008 02:55:08 +0200
Subject: [PATCH] [CAN] add generic platform bus based sja1000 driver
This patch adds a generic platform bus based sja1000 driver.
Changes to original post:
- correct placing of config option in Kconfig file
- moved platform header file to separate directory
include/linux/can/platform
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@843 030b6a49-0b11-0410-94ab-b0dab22257f2
hartkopp [Sun, 19 Oct 2008 16:12:47 +0000 (16:12 +0000)]
The callbacks in the struct can_priv used u32 for state and mode.
There are already enums for these values. Use these enums to keep
sparse quiet if a driver already uses these values.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net> Acked-by: Wolfgang Grandegger <wg@grandegger.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@841 030b6a49-0b11-0410-94ab-b0dab22257f2
hartkopp [Sat, 18 Oct 2008 18:08:01 +0000 (18:08 +0000)]
The macro definition DRV_NAME is used for regions (/proc/ioports,
/proc/iomem), device names (/proc/bus/pci/devices), etc. The
names are now derived from the corresponding file name and do not
use the prefix "can-" any more.
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@840 030b6a49-0b11-0410-94ab-b0dab22257f2
hartkopp [Sat, 18 Oct 2008 13:22:00 +0000 (13:22 +0000)]
This patch fixes suspend/resume for platforms that "lose" bit
timing settings after a suspend/resume cycle and improves robustness
in case of misbehaving hardware (doesn't lock the machine anymore)
Signed-off-by: Christian Pellegrin <chripell@gmail.com> Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@839 030b6a49-0b11-0410-94ab-b0dab22257f2
hartkopp [Thu, 16 Oct 2008 14:13:50 +0000 (14:13 +0000)]
If priv->do_get_state returns an error, nothing is printed
and "0" thus no error is delivered into userspace. This patch
changes the behaviour so that the error is propagated into the
userspace correctly.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@838 030b6a49-0b11-0410-94ab-b0dab22257f2
hartkopp [Tue, 14 Oct 2008 19:08:33 +0000 (19:08 +0000)]
Applied patch from Christian Pellegrin
https://lists.berlios.de/pipermail/socketcan-core/2008-October/001960.html
after fixing some whitespace issues in a comment section and the removal
of an obsolete debug output.
wolf [Tue, 7 Oct 2008 07:36:50 +0000 (07:36 +0000)]
Fix problems with calculating bit-timing parameters
This patch fixes a bug resulting in a badly matching sample point.
Furthermore, it temporarily fixes the problems with prog_seg being
0 on AT91 and MPC2510 CAN controllers. A proper fix using min/max
values for prog_seg, phase_seg1 and phase_seg2 is on the to-do
list.
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@832 030b6a49-0b11-0410-94ab-b0dab22257f2
hartkopp [Mon, 6 Oct 2008 11:54:19 +0000 (11:54 +0000)]
Applied two cosmetic issues from Kurt van Dijck:
https://lists.berlios.de/pipermail/socketcan-core/2008-October/001885.html
https://lists.berlios.de/pipermail/socketcan-core/2008-October/001883.html
hartkopp [Mon, 6 Oct 2008 09:32:02 +0000 (09:32 +0000)]
Cleanup new bittime interface on Softing Cards as proposed by Kurt van Dijck:
https://lists.berlios.de/pipermail/socketcan-core/2008-October/001868.html
https://lists.berlios.de/pipermail/socketcan-core/2008-October/001870.html
hartkopp [Sun, 5 Oct 2008 17:00:52 +0000 (17:00 +0000)]
Support the new bittime interface.
Fixes in softing_reinit() in softing_fw.c:
- calculate bittiming at re-init the chips
- in debug trace: use card->bus[1]->can.bittiming.bitrate for bus1
hartkopp [Sat, 4 Oct 2008 18:55:01 +0000 (18:55 +0000)]
Added MCP251x SPI CAN driver posted by Chris Elston <celston@katalix.com>
and Christian Pellegrin <chripell@evolware.org> in
https://lists.berlios.de/pipermail/socketcan-core/2008-October/001861.html
after updating the driver to the new bitrate setting interface.
Changed comment line recognition:
Everything without a '(' at the beginning of an input line is treated as comment.
Changed buffer size to allow long comment lines & added overflow handling.
Added automatic extended frame format recognition.
Most SocketCAN userspace tools (like cansend) recognize the EFF by the
stringlength of the given CAN-ID: 3 -> SFF , 8 -> EFF.
This was missing in the candump filter definition and therefore the
values had to be specified with the CAN_EFF_FLAG set in the value, e.g. 92345678 for the extended CAN-ID 12345678 - this was not really nice.
Now the filtersets for extended frames can be specified as expected: 12345678:1FFFFFFF to filter for only 12345678 extended CAN-ID 000000AA:1FFFFFFF to filter for only AA extended CAN-ID.
wolf [Wed, 25 Jun 2008 09:07:06 +0000 (09:07 +0000)]
Add script mkseries to create kernel patches from the trunk
To continue developing Socket-CAN on the SVN trunk, the script mkseries
has been provided to create kernel patches suitible for posting on the
netdev mailing list. It requires a kernel version >= 2.6.25 against
which patches will be created.
Signed-off-by: Wolfgang Grandeger <wg@grandegger.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@798 030b6a49-0b11-0410-94ab-b0dab22257f2
hartkopp [Fri, 20 Jun 2008 09:15:13 +0000 (09:15 +0000)]
Introduced new functions:
unsigned char asc2nibble(char c);
int hexstring2candata(char *arg, struct can_frame *cf);
(see documentation in lib.h)
As prerequsite to fix the commandline interface of cangen.
wolf [Thu, 12 Jun 2008 12:41:05 +0000 (12:41 +0000)]
Get rid of ioctl.h for the new CAN drivers
This patch gets rid of include/linux/can/ioctl.h for the new
CAN device interface and drivers. The definitions have been
moved temporarily to include/linux/can/dev.h. Further cleanup
will follow when the bit timing code is updated. The ioctl.h
file has not been deleted, because it's still used by the old
CAN drivers.
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@782 030b6a49-0b11-0410-94ab-b0dab22257f2
hartkopp [Wed, 11 Jun 2008 16:35:19 +0000 (16:35 +0000)]
Removed bad hacks in vcan.c and slcan_attach.c.
Giving some hints for users of older kernels than 2.6.25 that a
compilation error is a normal behaviour in these cases.
wolf [Wed, 11 Jun 2008 14:31:27 +0000 (14:31 +0000)]
sja1000: various coding style fixes and include linux/*
According to the Linux coding style:
- don't use assignments in if statements.
- Use __func__ instead of __FUNCTION__, which is not gcc specific.
- EXPORT_SYMBOL() has to follow directly it's function.
- Do not initialise statics to 0 or NULL.
- Don't put braces around single statements.
- Add KERN_* log levels to printks.
Furthermore, include linux/* instead of asm/*.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@771 030b6a49-0b11-0410-94ab-b0dab22257f2
wolf [Wed, 11 Jun 2008 14:21:45 +0000 (14:21 +0000)]
mscan: various coding style fixes
According to the Linux coding style:
- Don't use assignments in if statements.
- Fix _MSCAN_RESERVED_ macro coding style.
- EXPORT_SYMBOL() has to follow directly it's function.
- Use the standard __func_ instead of gcc specific __FUNCTION__.
- Add KERN_* debug levels for mscan.
- Labels should not be indented.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@768 030b6a49-0b11-0410-94ab-b0dab22257f2
- Don't use assignments in if statements.
- EXPORT_SYMBOL() has to follow directly it's function.
- Use the standard __func_ instead of gcc specific __FUNCTION__.
- Labels should not be indented.
- No braces should be put around single statements.
- Pointers have to be written as "foo *bar", not "foo * bar".
- Static data doesn't have to be initialized with 0.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@762 030b6a49-0b11-0410-94ab-b0dab22257f2