struct can_proto {
int type;
int protocol;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
int capability;
+#endif
struct proto_ops *ops;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
struct proto *prot;
goto errout;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
if (cp->capability >= 0 && !capable(cp->capability)) {
err = -EPERM;
goto errout;
}
-
+#endif
sock->ops = cp->ops;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
static struct can_proto bcm_can_proto __read_mostly = {
.type = SOCK_DGRAM,
.protocol = CAN_BCM,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
.capability = -1,
+#endif
.ops = &bcm_ops,
.prot = &bcm_proto,
};
static struct can_proto isotp_can_proto __read_mostly = {
.type = SOCK_DGRAM,
.protocol = CAN_ISOTP,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
.capability = -1,
+#endif
.ops = &isotp_ops,
.prot = &isotp_proto,
};
.sendpage = sock_no_sendpage,
};
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
+static struct proto raw_proto __read_mostly = {
+ .name = "CAN_RAW",
+ .owner = THIS_MODULE,
+ .obj_size = sizeof(struct raw_sock),
+ .init = raw_init,
+};
+
+static struct can_proto raw_can_proto __read_mostly = {
+ .type = SOCK_RAW,
+ .protocol = CAN_RAW,
+ .ops = &raw_ops,
+ .prot = &raw_proto,
+};
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
static struct proto raw_proto __read_mostly = {
.name = "CAN_RAW",
.owner = THIS_MODULE,