]> rtime.felk.cvut.cz Git - socketcan-devel.git/log
socketcan-devel.git
14 years agoSome binaries in can-utils depend on features in the socket-can svn
hartkopp [Wed, 17 Mar 2010 19:21:38 +0000 (19:21 +0000)]
Some binaries in can-utils depend on features in the socket-can svn
repository. Building with exported headers from an unpatched kernel will
fail due to missing symbols or headers.

This patch adds two make variables to optionally disable building such
binaries, like this:

make PROGRAMS_ISOTP= PROGRAMS_CANGW= PROGRAMS_SLCAN= all

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

14 years agoTo simplify packaging of can-utils, add DESTDIR and PREFIX support to
hartkopp [Wed, 17 Mar 2010 19:12:26 +0000 (19:12 +0000)]
To simplify packaging of can-utils, add DESTDIR and PREFIX support to
the can-utils Makefile.

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

14 years agoReduce codesize by using a macro.
hartkopp [Fri, 12 Mar 2010 16:48:13 +0000 (16:48 +0000)]
Reduce codesize by using a macro.

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

14 years agoat91_can: sync with mainline kernel version (minor issues)
wolf [Fri, 5 Mar 2010 21:23:46 +0000 (21:23 +0000)]
at91_can: sync with mainline kernel version (minor issues)

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

14 years agomscan: sync with mainline kernel version (minor issues)
wolf [Fri, 5 Mar 2010 21:23:08 +0000 (21:23 +0000)]
mscan: sync with mainline kernel version (minor issues)

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

14 years agosja1000: sync with mainline kernel version (minor issues)
wolf [Fri, 5 Mar 2010 21:21:00 +0000 (21:21 +0000)]
sja1000: sync with mainline kernel version (minor issues)

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

14 years agosja1000: some minor white space fixes
wolf [Fri, 5 Mar 2010 20:53:22 +0000 (20:53 +0000)]
sja1000: some minor white space fixes

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

14 years agodrivers/net/: use DEFINE_PCI_DEVICE_TABLE()
wolf [Fri, 5 Mar 2010 20:41:36 +0000 (20:41 +0000)]
drivers/net/: use DEFINE_PCI_DEVICE_TABLE()

Use DEFINE_PCI_DEVICE_TABLE() so we get place PCI ids table into correct sec
in every case.

From net-next-2.6 commit a3aa18842a5303fc28fcc4d57dbd16618bd830a0 with
proper version dependencies.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1156 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agoRename modprobe file to can.conf to be placed in /etc/modprobe.d without problems.
hartkopp [Fri, 5 Mar 2010 10:58:23 +0000 (10:58 +0000)]
Rename modprobe file to can.conf to be placed in /etc/modprobe.d without problems.

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

14 years agoplx_pci: fix white space issue with KERNEL_VERSION to get strip-src working
wolf [Fri, 5 Mar 2010 09:16:56 +0000 (09:16 +0000)]
plx_pci: fix white space issue with KERNEL_VERSION to get strip-src working

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

14 years agocan: netlink support for bus-error reporting and counters
wolf [Fri, 5 Mar 2010 09:11:52 +0000 (09:11 +0000)]
can: netlink support for bus-error reporting and counters

This patch makes the bus-error reporting configurable and allows to
retrieve the CAN TX and RX bus error counters via netlink interface.
I have added support for the SJA1000. The TX and RX bus error counters
are also copied to the data fields 6..7 of error messages when state
changes are reported.

From net-next-2.6 commit 52c793f24054f5dc30d228e37e0e19cc8313f086

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

14 years agoInitialize packet counters when printing each routing entry.
hartkopp [Thu, 4 Mar 2010 10:59:24 +0000 (10:59 +0000)]
Initialize packet counters when printing each routing entry.

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

14 years agoAdded two missing kernel version depencies.
hartkopp [Sun, 28 Feb 2010 14:58:11 +0000 (14:58 +0000)]
Added two missing kernel version depencies.

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

14 years agoRework of help text.
hartkopp [Sat, 27 Feb 2010 16:07:58 +0000 (16:07 +0000)]
Rework of help text.

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

14 years agoDeclare local modification functions as static.
hartkopp [Sat, 27 Feb 2010 15:55:14 +0000 (15:55 +0000)]
Declare local modification functions as static.
Fix typo.

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

14 years agoWhen sending a sequence, we need to resend the same frame when poll() returns.
hartkopp [Fri, 26 Feb 2010 08:38:47 +0000 (08:38 +0000)]
When sending a sequence, we need to resend the same frame when poll() returns.
Fixed that to be a valid data source e.g. for ptx cansequence.

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

14 years agoAdded commandline option '-p <timeout>' to enable polling on the writing socket.
hartkopp [Thu, 25 Feb 2010 20:53:19 +0000 (20:53 +0000)]
Added commandline option '-p <timeout>' to enable polling on the writing socket.
Inspired by Marc Kleine-Budde :-)

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

14 years agosofting_cs: fix for net-next-2.6 (2.6.33+)
hartkopp [Thu, 25 Feb 2010 17:10:40 +0000 (17:10 +0000)]
softing_cs: fix for net-next-2.6 (2.6.33+)

The pcmcia_request_window() is postponed a little, as some flags must be
set before this call (I believe). It is a small change, but with some
noise in the patch. Same with softing_card_irq().

The netif_start_queue() is omitted, as softing_cycle() does a
netif_wake_queue().

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@1146 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agocan: mscan-mpc5xxx: fix broken support for the MPC5200
hartkopp [Thu, 25 Feb 2010 08:04:22 +0000 (08:04 +0000)]
can: mscan-mpc5xxx: fix broken support for the MPC5200
Due to an invalid "#ifdef CONFIG_PPC_MPC5200", the real clock setup
function was not called for the MPC5200.

Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
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=c5bab5e94d148aee2c852450374143c89aa56511

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

14 years agoAdded funtionality to flush all GW jobs in one netlink message.
hartkopp [Tue, 23 Feb 2010 19:13:17 +0000 (19:13 +0000)]
Added funtionality to flush all GW jobs in one netlink message.

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

14 years agoAdded Kconfig entry for the CAN Gateway/Router.
hartkopp [Tue, 23 Feb 2010 18:18:50 +0000 (18:18 +0000)]
Added Kconfig entry for the CAN Gateway/Router.

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

14 years agoBeautify the listing of registered gwjobs (cangw -L).
hartkopp [Mon, 22 Feb 2010 18:57:45 +0000 (18:57 +0000)]
Beautify the listing of registered gwjobs (cangw -L).

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

14 years agoAdded missing include for rcu hlist.
hartkopp [Mon, 22 Feb 2010 11:26:02 +0000 (11:26 +0000)]
Added missing include for rcu hlist.

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

14 years agoAdded feature to list created gateway jobs.
hartkopp [Mon, 22 Feb 2010 09:57:12 +0000 (09:57 +0000)]
Added feature to list created gateway jobs.
Also added some fixes and removed debug printf's.

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

14 years agoAdded netlink error message support to be able to provide return values.
hartkopp [Sun, 21 Feb 2010 12:34:34 +0000 (12:34 +0000)]
Added netlink error message support to be able to provide return values.
Renamed some structure elements. Updated usage text.

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

14 years agoMoved kernel parsing of netlink attributes into can_can_parse_attr().
hartkopp [Sat, 20 Feb 2010 20:41:24 +0000 (20:41 +0000)]
Moved kernel parsing of netlink attributes into can_can_parse_attr().
Added functionalitiy to remove formerly created CAN GW jobs.

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

14 years agoCopy the struct members separately to ensure that no uninitialized
hartkopp [Sat, 20 Feb 2010 18:04:56 +0000 (18:04 +0000)]
Copy the struct members separately to ensure that no uninitialized
data are copied in the 3 bytes hole of the struct. This is needed
to make easy compares of the data in the struct can_can_gw.

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

14 years agoAdded cangw netlink gateway configuration tool.
hartkopp [Fri, 19 Feb 2010 13:33:59 +0000 (13:33 +0000)]
Added cangw netlink gateway configuration tool.

TODO (in both cangw and can-gw.ko) : Support removal and listing of rules.
So far the gateway jobs are only removed on can-gw.ko module unload or when
the used CAN netdevices disappear.

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

14 years agoems_pcmcia: Fix compiler errors with recent net-next-2.6
wolf [Fri, 19 Feb 2010 09:02:36 +0000 (09:02 +0000)]
ems_pcmcia: Fix compiler errors with recent net-next-2.6

Fix compiler errors with recent net-next-2.6 for 2.6.33
- Removed IRQInfo1 (as for irq_req_t)
- window_handle_t is now unsigned long instead of window_t*
- pcmcia_request_window needs now only a pointer, not pointer to pointer
- pass struct pcmcia_device pointer to pcmcia_map_mem_page
- Replaced cs_error function with dbg_err

Signed-off-by: Markus Plessing <plessing@ems-wuensche.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1135 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agoConsistently rename LOOPBACK to ECHO to meet IFF_ECHO for CAN.
hartkopp [Fri, 19 Feb 2010 08:07:37 +0000 (08:07 +0000)]
Consistently rename LOOPBACK to ECHO to meet IFF_ECHO for CAN.

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

14 years agoAdded include for gw.h to be accessed by can-utils.
hartkopp [Fri, 19 Feb 2010 07:46:56 +0000 (07:46 +0000)]
Added include for gw.h to be accessed by can-utils.

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

14 years agodoc fix. Struct can_filter is only 8 bytes long.
hartkopp [Fri, 19 Feb 2010 07:24:35 +0000 (07:24 +0000)]
doc fix. Struct can_filter is only 8 bytes long.

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

14 years agoGrrr. Fixed previous commit which was using the wrong skb ... and a typo.
hartkopp [Fri, 19 Feb 2010 07:10:02 +0000 (07:10 +0000)]
Grrr. Fixed previous commit which was using the wrong skb ... and a typo.

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

14 years agoAdded flag to preserve the timestamp from the source device when routing
hartkopp [Fri, 19 Feb 2010 07:06:17 +0000 (07:06 +0000)]
Added flag to preserve the timestamp from the source device when routing
the CAN frame (which saves some time, if the timestamp is not needed).
Usually the skb->tstamp is cleared which makes the destination interface
create a new timestamp (e.g. when the frame hit's the bus) on loopback.

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

14 years agoSwapped the parameters inside the modifier attribute to have the aligned
hartkopp [Fri, 19 Feb 2010 05:12:49 +0000 (05:12 +0000)]
Swapped the parameters inside the modifier attribute to have the aligned
struct can_frame the first parameter. This allows the usage of 'packed'
structs in userspace with an aligned access to the CAN frame structures.

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

14 years agoCorrect frame counter in gw_rcv.
hartkopp [Thu, 18 Feb 2010 21:43:42 +0000 (21:43 +0000)]
Correct frame counter in gw_rcv.
Fix error path in gw_create_job() to prevent double put of netdevs.

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

14 years agoAdded netlink powered CAN gateway functionality with CAN frame modification features.
hartkopp [Thu, 18 Feb 2010 18:37:20 +0000 (18:37 +0000)]
Added netlink powered CAN gateway functionality with CAN frame modification features.
TODO: Implement removal of single routing entries / Dump complete entries with packet counters.

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

14 years agoesd_usb2: fix compile warnings with 2.6.32
wolf [Mon, 15 Feb 2010 09:43:44 +0000 (09:43 +0000)]
esd_usb2: fix compile warnings with 2.6.32

Check the return value of device_create_file to make gcc happy.

Signed-off-by: Daniel Baluta <daniel.baluta@gmail.com>
Reported-by: Thorsten Godau <dl9sec@gmx.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1126 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agoplx_pci: sync with net-next-2.6
wolf [Thu, 11 Feb 2010 12:33:56 +0000 (12:33 +0000)]
plx_pci: sync with net-next-2.6

This patch makes the plx_pci driver in the BerliOS repo same as in
net-next-2.6

Changes since previous revision (1120):
- Added some defines for static inline int plx_pci_check_sja1000(...)
- static struct pci_device_id plx_pci_tbl[] replaced by
  static DEFINE_PCI_DEVICE_TABLE(plx_pci_tbl)
- Typo fixed
- Changed order of device info to have the PCI devices in alphabetical
  order

From net-next-2.6 commit 24c4a3b29255f9f8bc48d93597a58256b5a1f83f

Signed-off-by: Pavel Cheblakov <P.B.Cheblakov@inp.nsk.su>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1125 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agoesd_pci331: fix 64bit compiler warning
wolf [Wed, 10 Feb 2010 09:25:28 +0000 (09:25 +0000)]
esd_pci331: fix 64bit compiler warning

This patch removes a warning when compiling in 64 bit systems.

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

14 years agocan: Proper ctrlmode handling for CAN devices
wolf [Fri, 5 Feb 2010 19:47:46 +0000 (19:47 +0000)]
can: Proper ctrlmode handling for CAN devices

From net-next-2.6 commit ad72c347e56bf3a0231b9d686e17764157d2961c

This patch adds error checking of ctrlmode values for CAN devices. As
an example all availabe bits are implemented in the mcp251x driver.

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

14 years agoThe hlist content ensured only CAN netdevices to be accessed by the
hartkopp [Wed, 3 Feb 2010 17:55:16 +0000 (17:55 +0000)]
The hlist content ensured only CAN netdevices to be accessed by the
can_rx_(un)register() functions which accidently dropped away together with
the receive list access speedup in rev 1118 and rev 1119.

This patch re-introduces the check for CAN netdevices in can_rx_(un)register()
(not in the hot path!) for Kernels >= 2.6.26.

See upstream commit:
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=8b64056dacf6ec81986d63dff96fca039fe95f6e

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

14 years agomcp251x: misc bugfixes
wolf [Sat, 30 Jan 2010 19:07:06 +0000 (19:07 +0000)]
mcp251x: misc bugfixes

Several bugs are fixed: utilization of just half of the RX buffers,
useless wait for interrupt on open, more reliable reset sequence.
The MERR interrupt is not used anymore: it overloads the CPU in
bus-off state without any additional information. One shot mode for
the MCP2515 is added.

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

14 years agosja1000: Driver for some PLX PCI bridge + sja1000 CAN controllers
wolf [Mon, 25 Jan 2010 10:35:12 +0000 (10:35 +0000)]
sja1000: Driver for some PLX PCI bridge + sja1000 CAN controllers

It's a next version of sja1000_plx_pci driver.
In struct plx_pci_card_info pointer to device-dependent reset function was
added. It's necessary for special reset operations which take place in
some cards (like Marathon CAN-bus-PCI).
Also, I've introduced a special reset function for Marathon card. This
function incapsulates ability to reset the SJA1000 on such cards.

plx_pci_check_sja1000 was slightly modified for a purpose of exhaustive
checking.

Signed-off-by: Pavel Cheblakov <P.B.Cheblakov@inp.nsk.su>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1120 030b6a49-0b11-0410-94ab-b0dab22257f2

14 years agoConsistently clean up the reference dev->ml_priv when the device receiver list is...
hartkopp [Sun, 24 Jan 2010 21:35:06 +0000 (21:35 +0000)]
Consistently clean up the reference dev->ml_priv when the device receiver list is (to be) removed.
Cleanly separate find_dev_rcv_lists() function for 2.6.26+ as we do not need the fallback.

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

14 years agoSince 2.6.26 a new "midlevel private" ml_priv pointer has been
hartkopp [Sat, 23 Jan 2010 21:25:23 +0000 (21:25 +0000)]
Since 2.6.26 a new "midlevel private" ml_priv pointer has been
introduced in struct net_device. We use this pointer to omit the
linear walk through the can_rx_dev_list. A similar speedup has been
queued for 2.6.34 mainline but using the new netdev_rcu lists.

The mainline commit:
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=20dd3850bcf860561496827b711fa10fecf6e787

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

14 years agoAdded 2.6.33 compatibility due to:
hartkopp [Sat, 23 Jan 2010 21:15:00 +0000 (21:15 +0000)]
Added 2.6.33 compatibility due to:

net: pass kern to net_proto_family create function

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

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

14 years agoFix rcu handling by removing nested rcu locks.
hartkopp [Sat, 23 Jan 2010 11:20:23 +0000 (11:20 +0000)]
Fix rcu handling by removing nested rcu locks.

This problem was also solved in upstream commit
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=20dd3850bcf860561496827b711fa10fecf6e787

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

14 years agoREADME.submitting-patches: fix typos
wolf [Sun, 17 Jan 2010 16:46:10 +0000 (16:46 +0000)]
README.submitting-patches: fix typos

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

14 years agoREADME.submitting-patches: fix typos and add some missing doc
wolf [Sun, 17 Jan 2010 15:55:56 +0000 (15:55 +0000)]
README.submitting-patches: fix typos and add some missing doc

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

14 years agoREADME on how to submit Socket-CAN patches
wolf [Sun, 17 Jan 2010 14:22:38 +0000 (14:22 +0000)]
README on how to submit Socket-CAN patches

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

14 years agoTry to ignore the usual value restrictions of sockopt SO_RCVBUF when running
hartkopp [Fri, 15 Jan 2010 19:15:08 +0000 (19:15 +0000)]
Try to ignore the usual value restrictions of sockopt SO_RCVBUF when running
as root (with CAP_NET_ADMIN) by using SO_RCVBUFFORCE if possible.

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

14 years agoAdded '-d' option to support the receive packet drop counting introduced in
hartkopp [Fri, 15 Jan 2010 18:35:37 +0000 (18:35 +0000)]
Added '-d' option to support the receive packet drop counting introduced in
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=3b885787ea4112eaa80945999ea0901bf742707f

This is done by using recvmsg() instead of recvfrom() to allow the timestamp
and the dropcounter to be received within one syscall.

When the application (here 'candump') ist not fast enough to process the
incomming CAN frames the frames are dropped in the socket receive queue.
When this happens and '-d' is set, we get this info now:
DROPCOUNT: dropped 1 CAN frame on 'xxx' socket (total drops 1)

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

14 years agoSupport for the esd USB2 CAN interface
wolf [Thu, 14 Jan 2010 19:40:31 +0000 (19:40 +0000)]
Support for the esd USB2 CAN interface

This patch adds support for the esd USB2 CAN interface.

Changelog
V4:
- remove unnecessary 'else' path after goto statement
  in esd_usb2_start_xmit()
- remove driver startup message
- move module_init/module_exit macros
- increase MAX_TX_URBS to next power of two value (16)
- remove done_index variable in esd_usb2_tx_done_msg()
- mask tx_contexts[] index in esd_usb2_tx_done_msg()
  for robustness
- esd_usb2_start/close(): 1+1=2
- use u8/u16/u32/__le32 types
- remove unused device message structs
- use kfree_skb() instead of dev_kfree_skb()
- fix cleanup path in esd_usb2_start_xmit()
- explain IDADD filter message more detailed

V3:
- handle msg->msg.txdone.status != 0 in esd_usb2_tx_done_msg()
- move active_tx_urbs-- to esd_usb2_tx_done_msg() from
  ...write_bulk_callback
- move netif_wake_queue(netdev) to esd_usb2_tx_done_msg()
- add BTR macros

V2:
- remove duplicate line "netdev->flags |= IFF_ECHO; ..."
  in esd_usb2_probe_one_net()
- set can.state back to CAN_STATE_STOPPED in esd_usb2_close()
  Without this setting the bitrate via sysfs after an interface
  up/down cycle does not work.
- remove "#undef DEBUG" line
- codingstyle clean (tabs, empty lines, ...)
- don't check against 0, but use !()
- remove netif_queue_stopped() check before calling netif_wake_queue()
- remove double netif_device_detach() from esd_usb2_open()
- print canbtr in esd_usb2_set_bittiming()
- use __types in structures that a exchanged with the device
- add ESD_MAX_ID_SEGMENT macro to get rid of the magic hardcoded "64"
  when setting up the device's ID filter.
- Add some comments about the IDADD message.
- move esd_usb2_bittiming_const close to esd_usb2_set_bittiming()
- move macro definitions to top of file
- use if() for single case switch statements
- add macros for esd bus state event codes
- order declarations somehow: move structs to top
- get rid of ibuf variable in esd_usb2_read_bulk_callback()
- rename no_nets to net_count :-)
- consequently do not use unlikely()
- call can_get_echo_skb() from esd_usb2_tx_done_msg() to loopback
  only when message has been sent successfully
- increase MAX_TX_URBS because releasing tx_contexts is now done
  much later and we easily run out of free tx_contexts
- check dev->nets[i] before netif_device_detach() in ...read_bulk_callback()
- make esd_usb2_setup_rx_urbs() succeed when we got at least one urb
  setup correctly
- implement common error handling in esd_usb2_start_xmit()
- handle failure of alloc_can_(err_)sbk: stats->rx_dropped++
- rename netdev's private data pointer from "net" to "priv"
- add "device %s registered" message on successful net creation

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

14 years agoTo prevent the CAN drivers to operate on invalid socketbuffers the skbs are
hartkopp [Tue, 12 Jan 2010 11:06:55 +0000 (11:06 +0000)]
To prevent the CAN drivers to operate on invalid socketbuffers the skbs are
now checked and silently dropped at the xmit-function consistently.

Also the netdev stats are consistently using the CAN data length code (dlc)
for [rx|tx]_bytes now.

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

14 years agoesd_pci331: fix sending erroneous frames when loopback is disabled
wolf [Tue, 12 Jan 2010 08:54:13 +0000 (08:54 +0000)]
esd_pci331: fix sending erroneous frames when loopback is disabled

This patch fixes sending erroneous frames when loopback is disabled.
Also stats->tx_bytes is now only increased in TX-done interrupt and
not earlier.

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

14 years agomscan-mpc5xxx: add missing include for clk functions clk_get, etc.
wolf [Sun, 10 Jan 2010 15:25:52 +0000 (15:25 +0000)]
mscan-mpc5xxx: add missing include for clk functions clk_get, etc.

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

14 years agopowerpc/mpc5xxx: add OF platform binding doc for FSL MSCAN devices
wolf [Sat, 9 Jan 2010 09:40:00 +0000 (09:40 +0000)]
powerpc/mpc5xxx: add OF platform binding doc for FSL MSCAN devices

From net-next-2.6 commit 932a3bca9a21c05a856891921d0164b5f0dcbff7

This patch adds documentation for the MSCAN OF device bindings for
the MPC512x and moves the one for the MPC5200 to the new common file
"Documentation/powerpc/dts-bindings/fsl/can.txt".

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

14 years agocan: mscan-mpc5xxx: add support for the MPC512x processor
wolf [Sat, 9 Jan 2010 09:36:24 +0000 (09:36 +0000)]
can: mscan-mpc5xxx: add support for the MPC512x processor

From net-next-2.6 commit 56bf9403d4429501999f762129a7ab415ac8f3d0

The main differences compared to the MSCAN on the MPC5200 are:

- More flexibility in choosing the CAN source clock and frequency:

  Three different clock sources can be selected: "ip", "ref" or "sys".
  For the latter two, a clock divider can be defined as well. If the
  clock source is not specified by the device tree, we first try to
  find an optimal CAN source clock based on the system clock. If that
  is not possible, the reference clock will be used.

- The behavior of bus-off recovery is configurable:

  To comply with the usual handling of Socket-CAN bus-off recovery,
  "recovery on request" is selected (instead of automatic recovery).

Note that only MPC5121 Rev. 2 and later is supported.

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

14 years agocan: mscan: fix improper return if dlc < 8 in start_xmit function
wolf [Sat, 9 Jan 2010 09:34:47 +0000 (09:34 +0000)]
can: mscan: fix improper return if dlc < 8 in start_xmit function

From net-next-2.6 commit 06c0906719433535e7e38f6f8e1284035cc01335

The start_xmit function of the MSCAN Driver did return improperly if
the CAN dlc check failed (skb not freed and invalid return code). This
patch adds a proper check of the frame lenght and data size and returns
now correctly. The invalid skb packets are dropped silently as suggested
by David Miller in the thread "[RFC] ndo_validate_skb: Let the netdev
check a valid skb content" on the netdev mailing list.

Furthermore, a typo has been fixed.

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

14 years agoThis patch adds the flag CAN_CTRLMODE_ONE_SHOT. It is used as mask
hartkopp [Wed, 6 Jan 2010 19:39:24 +0000 (19:39 +0000)]
This patch adds the flag CAN_CTRLMODE_ONE_SHOT. It is used as mask
or flag in the "struct can_ctrlmode".

It allows userspace via netlink to set a CAN controller into the special
"one-shot" mode. In this mode, if supported by the CAN controller, it
tries only once to deliver a CAN frame and aborts it if an error
(e.g.: arbitration lost) happens.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
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=c1c5523dd1517250cac8b15a4acbc237c24a67d4

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

14 years agough - fixed order in patch generation commands
hartkopp [Wed, 6 Jan 2010 19:26:07 +0000 (19:26 +0000)]
ugh - fixed order in patch generation commands

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

14 years agoAdded sed command to replace include/socketcan with include/linux to create
hartkopp [Wed, 6 Jan 2010 18:44:31 +0000 (18:44 +0000)]
Added sed command to replace include/socketcan with include/linux to create
patches from the SVN includes that fit into the Linux kernel.

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

14 years agoUpdate include paths.
hartkopp [Wed, 6 Jan 2010 18:39:24 +0000 (18:39 +0000)]
Update include paths.

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

14 years agoAdded new integrated files to file list.
hartkopp [Wed, 6 Jan 2010 18:24:18 +0000 (18:24 +0000)]
Added new integrated files to file list.

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

14 years agoChange include paths from include/linux to include/socketcan to get the correct ...
hartkopp [Wed, 6 Jan 2010 18:22:23 +0000 (18:22 +0000)]
Change include paths from include/linux to include/socketcan to get the correct (and latest) includes.

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

14 years agoRemoved obsolete CC770 Kconfig parts as seen in a mail from Steve Deiters.
hartkopp [Wed, 6 Jan 2010 18:07:07 +0000 (18:07 +0000)]
Removed obsolete CC770 Kconfig parts as seen in a mail from Steve Deiters.

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

14 years agoCorrect NULL test discovered by Julias Lawall:
hartkopp [Tue, 5 Jan 2010 17:51:26 +0000 (17:51 +0000)]
Correct NULL test discovered by Julias Lawall:

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

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

14 years agoUpdated slcan to 2.6.32 including:
hartkopp [Fri, 4 Dec 2009 07:31:11 +0000 (07:31 +0000)]
Updated slcan to 2.6.32 including:

net: use NETDEV_TX_OK instead of 0 in ndo_start_xmit() functions
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6ed106549d17474ca17a16057f4c0ed4eba5a7ca

headers: remove sched.h from interrupt.h
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=d43c36dc6b357fa1806800f18aa30123c747a6d1

slip: Clean up create and destroy
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=5342b77c4123ba39f911d92a813295fb3bb21f69

The network layer now has a destructor we can hook to clean up the slip
devices array. That needs us to initiate unregister events in the right
places which with the current tty layer we can do, and with network
refcounting is safe to do.

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

14 years agoRenamed the GET_CAN_DLC() macro to lower-case get_can_dlc() and added some
hartkopp [Thu, 3 Dec 2009 21:14:43 +0000 (21:14 +0000)]
Renamed the GET_CAN_DLC() macro to lower-case get_can_dlc() and added some
documentation as suggested by Wolfgang Grandegger.

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

14 years agoIntroduced new GET_CAN_DLC() macro, that casts the data length code information to...
hartkopp [Thu, 3 Dec 2009 18:29:17 +0000 (18:29 +0000)]
Introduced new GET_CAN_DLC() macro, that casts the data length code information to __u8 and ensures the dlc not to be > 8.
Make use of this new macro in all drivers and clean-up/fix current dlc handling in the receive path.

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

14 years agomscan/mpc52xx_can: fix usage of obsolete dev->base_addr
wolf [Mon, 30 Nov 2009 18:16:35 +0000 (18:16 +0000)]
mscan/mpc52xx_can: fix usage of obsolete dev->base_addr

As pointed out by Oliver, it has been forgotten to replace
dev->base_addr by priv->reg_base properly for the mpc52xx_can
driver.

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

14 years agofflush the new configurable stdout output to allow proper pipe/netcat setups.
hartkopp [Wed, 25 Nov 2009 18:51:31 +0000 (18:51 +0000)]
fflush the new configurable stdout output to allow proper pipe/netcat setups.

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

14 years agoAllow to specify the name of the IP tunnel netdevice via commandline option '-n ...
hartkopp [Wed, 25 Nov 2009 17:15:09 +0000 (17:15 +0000)]
Allow to specify the name of the IP tunnel netdevice via commandline option '-n <name>'

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

14 years agoRemove feature to quit the isotptun by keypress (from stdin) as it was not possible...
hartkopp [Wed, 25 Nov 2009 16:43:17 +0000 (16:43 +0000)]
Remove feature to quit the isotptun by keypress (from stdin) as it was not possible to run it from a start-script.
Added a signal handler to gracefully leave the isotptun.

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

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