]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/atm/svc.c
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[mv-sheeva.git] / net / atm / svc.c
index 8fb54dc870b393d61373e308dfa8bec722d591a5..c7395070ee780715d7181cbad05f8762a01555dd 100644 (file)
@@ -25,7 +25,7 @@
 #include "signaling.h"
 #include "addr.h"
 
-static int svc_create(struct net *net, struct socket *sock,int protocol);
+static int svc_create(struct net *net, struct socket *sock, int protocol, int kern);
 
 /*
  * Note: since all this is still nicely synchronized with the signaling demon,
@@ -330,7 +330,7 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags)
 
        lock_sock(sk);
 
-       error = svc_create(sock_net(sk), newsock,0);
+       error = svc_create(sock_net(sk), newsock, 0, 0);
        if (error)
                goto out;
 
@@ -446,7 +446,7 @@ int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos)
 
 
 static int svc_setsockopt(struct socket *sock, int level, int optname,
-                         char __user *optval, int optlen)
+                         char __user *optval, unsigned int optlen)
 {
        struct sock *sk = sock->sk;
        struct atm_vcc *vcc = ATM_SD(sock);
@@ -608,6 +608,22 @@ static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
        return error;
 }
 
+#ifdef CONFIG_COMPAT
+static int svc_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
+{
+       /* The definition of ATM_ADDPARTY uses the size of struct atm_iobuf.
+          But actually it takes a struct sockaddr_atmsvc, which doesn't need
+          compat handling. So all we have to do is fix up cmd... */
+       if (cmd == COMPAT_ATM_ADDPARTY)
+               cmd = ATM_ADDPARTY;
+
+       if (cmd == ATM_ADDPARTY || cmd == ATM_DROPPARTY)
+               return svc_ioctl(sock, cmd, arg);
+       else
+               return vcc_compat_ioctl(sock, cmd, arg);
+}
+#endif /* CONFIG_COMPAT */
+
 static const struct proto_ops svc_proto_ops = {
        .family =       PF_ATMSVC,
        .owner =        THIS_MODULE,
@@ -620,6 +636,9 @@ static const struct proto_ops svc_proto_ops = {
        .getname =      svc_getname,
        .poll =         vcc_poll,
        .ioctl =        svc_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl = svc_compat_ioctl,
+#endif
        .listen =       svc_listen,
        .shutdown =     svc_shutdown,
        .setsockopt =   svc_setsockopt,
@@ -631,7 +650,8 @@ static const struct proto_ops svc_proto_ops = {
 };
 
 
-static int svc_create(struct net *net, struct socket *sock,int protocol)
+static int svc_create(struct net *net, struct socket *sock, int protocol,
+                     int kern)
 {
        int error;
 
@@ -647,7 +667,7 @@ static int svc_create(struct net *net, struct socket *sock,int protocol)
 }
 
 
-static struct net_proto_family svc_family_ops = {
+static const struct net_proto_family svc_family_ops = {
        .family = PF_ATMSVC,
        .create = svc_create,
        .owner = THIS_MODULE,