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
/* insert new receiver (dev,canid,mask) -> (func,data) */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+ if (dev && dev->type != ARPHRD_CAN)
+ return -ENODEV;
+#endif
+
r = kmem_cache_alloc(rcv_cache, GFP_KERNEL);
if (!r)
return -ENOMEM;
struct hlist_node *next;
struct dev_rcv_lists *d;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+ if (dev && dev->type != ARPHRD_CAN)
+ return;
+#endif
+
spin_lock(&can_rcvlists_lock);
d = find_dev_rcv_lists(dev);