hartkopp [Fri, 19 Oct 2007 07:32:59 +0000 (07:32 +0000)]
The definition of IFF_ECHO is part of the socketcan patchset for the
mainline kernel. As this patchset didn't go into 2.6.24 the
KERNEL_VERSION depended definition has to be adjusted ...
hartkopp [Thu, 18 Oct 2007 02:27:15 +0000 (02:27 +0000)]
Reverted the changes from r528 as 'ret' was set every time at socket
creation time even in the unlikely case that these protocol checks fail.
Additionally it was worse in readability.
Updated the comment for the whole protocol checks _code block_.
Therefore this comment is not directly placed before the first check.
I hope this was enough explanation why i reverted r528 like this.
If not, we should discuss it outside the SVN.
Oliver
thuermann [Thu, 4 Oct 2007 21:03:46 +0000 (21:03 +0000)]
Remove unnecessary includes of poll.h.
Rename debug to {can,raw,bcm}_debug respectively.
Change DBG() macros to work with {can,raw,bcm}_debug instead of debug.
Use module_param_named() instead of module_param().
Change prefix for can-core debug messages from "can-core" to "can".
Remove definitions of IDENT macro, use that value directly.
thuermann [Tue, 2 Oct 2007 10:15:26 +0000 (10:15 +0000)]
Rebase patch series to latest net-2.6.24.
Minor changes in intro.
Move change in include/linux/if.h from patch/02-can-core.diff
to patch/01-can-proto-numbers.diff
Introduced new interface flags IFF_ECHO which is to be used, when the
code hits the kernel. See discussion at
http://marc.info/?l=linux-netdev&m=119100461315453&w=2
Due to the masking of interface flags with IFF_VOLATILE in core/net/dev.c
IFF_ECHO cannot be used for external compilation, so we still use
IFF_LOOPBACK in older kernels and external compilation.
Changes suggested by Arnaldo Carvalho de Melo:
* Use gfp_any() instead of checking in_interrupt().
* Don't kfree() the sk_protinfo field in kerenls >= 2.6.12.
Remove dynamically allocated buffer for debug output.
Use kernel functions for hexdumps.
Don't interpret printf-style %-sequences in can_debug_cframe.
Specify the fixed fmt argument to DBG() macro and use GCC ## mechanism
to remove , when args is empty.
More changes after review from Patrick McHardy
- add _rcu to some hlist traversals.
- remove BH blocking from receive list spinlocks.
- use printk_ratelimit for module autoload failures.
Remove the BUG_ON() after assurance from Patrick that NETDEV_REGISTER
is always run in process context.
Introduced error handling in the case of can_rx_register() failure.
Additionally bind() and setsockopt() do not touch the socket state nor the
filterlists anymore when these syscalls failed for any reason.
Some changes suggested by Patrick McHardy:
* use sbk_share_check().
* use new and much simpler rtnl API
- delete list of vcan devices and struct vcan_priv.
- delete newlink() and dellink() functions.
To reduce kernel version depencies, the new rtnl API will
now only be used for 2.6.24 and higher.
A couple of changes, mostly suggested by Patrick McHardy:
* use round_jiffies() for statistics timer.
* make stats_timer static.
* add __read_mostly to a number of variables.
* in can_create() check for net namespace before loading modules.
* the NETDEV_REGISTER notifier can't run in interrupt context, so we
don't need to check that and call kzalloc() with GFP_KERNEL always.
* check that the sizeof(skb->cb) >= sizeof(struct sockaddr_can).
* use return values of can_proto_{un,}register().
* fix some comments.
* update version number.
Add attribution to Patrick in patch series intro text
(this change was actually done at Aug 3 with try #5 of
our patch series, but I missed to check it in).
Removed SET_MODULE_OWNER() macros for Kernel 2.6.24 and newer.
Reference:
[NET]: Nuke SET_MODULE_OWNER macro.
It's been a useless no-op for long enough in 2.6 so I figured it's time to
remove it. The number of people that could object because they're
maintaining unified 2.4 and 2.6 drivers is probably rather small.
[ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ]
Removed SET_MODULE_OWNER() macros for Kernel 2.6.24 and newer.
Reference:
[NET]: Nuke SET_MODULE_OWNER macro.
It's been a useless no-op for long enough in 2.6 so I figured it's time to
remove it. The number of people that could object because they're
maintaining unified 2.4 and 2.6 drivers is probably rather small.
[ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ]
Support network namespaces introduced in the current net-2.6.24 GIT tree:
David Miller's 2.6.24 networking tree
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.24.git;a=summary
[NET]: Make /proc/net per network namespace
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.24.git;a=commitdiff;h=39954fef318243ead56486775160c65f92ec092f
Changed procfs handling to depend from proc_net directory.
It looks like there is no 'nice' solution to get the broadcast managers
procfs entries under /proc/net/can/bcm/* as we would need to publish the
/proc/net/can directory reference to all CAN protocol modules.
Therefore the BCM entries are attached to /proc/net/can-bcm/* for now.
Support network namespaces introduced in the current net-2.6.24 GIT tree:
David Miller's 2.6.24 networking tree
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.24.git;a=summary
[NET]: Make the device list and device lookups per namespace.
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.24.git;a=commitdiff;h=19dcccd778b49378287317c6c31ee763ebe08bd0
[NET]: Make socket creation namespace safe.
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.24.git;a=commitdiff;h=07fee2eb642a99726ba71111bcad7180ba5479f0
[NET]: Make packet reception network namespace safe
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.24.git;a=commitdiff;h=6de5b5062e26475050ebd88b33d3c056faa72c3f
Updated the canplayer to accept logfile timestamps in the future (which
is very nice when you don't have a RTC and your systemtime is somewhere
in the 1970's :)
Added a new commandline option to skip timestamp jumps greater than x
seconds to allow to concatenate different logfiles that replay
constantly and not waiting for the absolute timestamp offsets.
hartkopp [Fri, 3 Aug 2007 07:32:55 +0000 (07:32 +0000)]
Added module parameter for irq_mode to force the driver to use
non-shared interrupt handling and to let the Linux Kernel disable local
interrupts when processing the irq handler.
Fixed irqflags defines that have been changed from 2.6.17 to 2.6.18 and
not (like the irq handler) from 2.6.18 to 2.6.19.
hartkopp [Thu, 2 Aug 2007 11:28:16 +0000 (11:28 +0000)]
Reduced the comments for the loopback parameter of the vcan driver to point
out the 'testing' use-case and to reduce the confusion which may come up
the known 'loopback' interface in Linux.
Removed the CCAN driver from the default targets analogue to the mscan
driver. As these drivers only compile on special ARCHs they should not
compile by default after SVN checkout.
- added a new kernel module for Bosch CCAN based CAN hardware
- added a new kernel module for the Hynix/Magnachip H7202 chip using the CCAN module
the following TODOs are still pending:
- ccan_set_mode() and it's usage is incomplete and bogus.
- ccan_set_bit_time() can be called when the device is active.
- You already handle the state changes via interrupts. The common
variable priv->can.state should be set accordingly. ccan_get_state()
may then just return that value.
- You already handle error interrupts. You should fill an error frame
and send it like a normal frame with the CAN_ERR_FLAG set. Have a look
to the mscan driver or http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/drivers/can/sja1000/rtcan_sja1000.c#156.
Fixed in-kerneltree compilation with a generated patch.
As Marc Klein-Budde stated the "hal" should move to platform drivers - but
until then the generated patches work so far.