]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
capabilities have been dropped in 2.6.33
authorhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Tue, 30 Nov 2010 19:27:36 +0000 (19:27 +0000)
committerhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Tue, 30 Nov 2010 19:27:36 +0000 (19:27 +0000)
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.33.y.git;a=commitdiff;h=13f18aa05f5abe135f47b6417537ae2b2fedc18c

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

kernel/2.6/include/socketcan/can/core.h
kernel/2.6/net/can/af_can.c
kernel/2.6/net/can/bcm.c
kernel/2.6/net/can/isotp.c
kernel/2.6/net/can/raw.c

index 23ce1c9cabef28c1c1dcedb10b554534caed333d..b8a17b126c5761a85ea2cdf8a744e0304985b9e4 100644 (file)
@@ -41,7 +41,9 @@
 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;
index 4d8479d744886778bae125a73b6d472a784a24ce..e3f7b3ccc94f3e57a9e970ff27662d2c12f9d1f5 100644 (file)
@@ -198,11 +198,12 @@ static int can_create(struct socket *sock, int protocol)
                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)
index 9ffad22ae5d8d8eabd95e164929dfbd74caea2d3..0764968b28b814eb4ec151b22b603325c5d62ecd 100644 (file)
@@ -1729,7 +1729,9 @@ static struct proto bcm_proto __read_mostly = {
 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,
 };
index 6c1f25c5abfee79631c3d6e52394d8f623b1394c..b8249845002d4fa819afa1372678998299205df3 100644 (file)
@@ -1156,7 +1156,9 @@ static struct proto isotp_proto __read_mostly = {
 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,
 };
index 4503c3f2bb804f62263ed55f8995ca0924e49c6f..440989dcd4884b6d356d31ef8d661acd9c06349a 100644 (file)
@@ -791,7 +791,22 @@ static struct proto_ops raw_ops __read_mostly = {
        .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,