#include <linux/module.h>
#include <linux/version.h>
#include <linux/init.h>
+#include <linux/interrupt.h>
#include <linux/hrtimer.h>
#include <linux/list.h>
#include <linux/proc_fs.h>
struct bcm_sock *bo = bcm_sk(sk);
struct bcm_op *op;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
seq_printf(m, ">>> socket %p", sk->sk_socket);
seq_printf(m, " / sk %p", sk);
seq_printf(m, " / bo %p", bo);
+#else
+ seq_printf(m, ">>> socket %pK", sk->sk_socket);
+ seq_printf(m, " / sk %pK", sk);
+ seq_printf(m, " / bo %pK", bo);
+#endif
seq_printf(m, " / dropped %lu", bo->dropped_usr_msgs);
seq_printf(m, " / bound %s", bcm_proc_getifname(ifname, bo->ifindex));
seq_printf(m, " <<<\n");
struct sock *sk = sock->sk;
struct bcm_sock *bo = bcm_sk(sk);
+ if (len < sizeof(*addr))
+ return -EINVAL;
+
if (bo->bound)
return -EISCONN;
.init = bcm_init,
};
-static struct can_proto bcm_can_proto __read_mostly = {
+static const struct can_proto bcm_can_proto = {
.type = SOCK_DGRAM,
.protocol = CAN_BCM,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)