Module: xenomai-head
Branch: master
Commit: 4e7b26292587856f81be66ada0556999b988874a
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=4e7b26292587856f81be66ada0556999b988874a

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Sep  9 17:44:55 2009 +0200

rtipc: make RTIPC_IOV_MAX a common limit to all protocols

---

 ksrc/drivers/ipc/iddp.c     |   10 ++++------
 ksrc/drivers/ipc/internal.h |    2 ++
 ksrc/drivers/ipc/xddp.c     |   10 ++++------
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/ksrc/drivers/ipc/iddp.c b/ksrc/drivers/ipc/iddp.c
index 3bfd677..d247029 100644
--- a/ksrc/drivers/ipc/iddp.c
+++ b/ksrc/drivers/ipc/iddp.c
@@ -78,8 +78,6 @@ static rtdm_event_t poolevt;
 
 static int poolwait;
 
-#define MAX_IOV_NUMBER  64
-
 #define _IDDP_BINDING  0
 #define _IDDP_BOUND    1
 
@@ -324,7 +322,7 @@ static ssize_t iddp_recvmsg(struct rtipc_private *priv,
                            rtdm_user_info_t *user_info,
                            struct msghdr *msg, int flags)
 {
-       struct iovec iov[MAX_IOV_NUMBER];
+       struct iovec iov[RTIPC_IOV_MAX];
        struct sockaddr_ipc saddr;
        ssize_t ret;
 
@@ -337,7 +335,7 @@ static ssize_t iddp_recvmsg(struct rtipc_private *priv,
        } else if (msg->msg_namelen != 0)
                return -EINVAL;
 
-       if (msg->msg_iovlen >= MAX_IOV_NUMBER)
+       if (msg->msg_iovlen >= RTIPC_IOV_MAX)
                return -EINVAL;
 
        /* Copy I/O vector in */
@@ -468,7 +466,7 @@ static ssize_t iddp_sendmsg(struct rtipc_private *priv,
                            const struct msghdr *msg, int flags)
 {
        struct iddp_socket *sk = priv->state;
-       struct iovec iov[MAX_IOV_NUMBER];
+       struct iovec iov[RTIPC_IOV_MAX];
        struct sockaddr_ipc daddr;
        ssize_t ret;
 
@@ -495,7 +493,7 @@ static ssize_t iddp_sendmsg(struct rtipc_private *priv,
                        return -ENOTCONN;
        }
 
-       if (msg->msg_iovlen >= MAX_IOV_NUMBER)
+       if (msg->msg_iovlen >= RTIPC_IOV_MAX)
                return -EINVAL;
 
        /* Copy I/O vector in */
diff --git a/ksrc/drivers/ipc/internal.h b/ksrc/drivers/ipc/internal.h
index b12b3c9..57c675f 100644
--- a/ksrc/drivers/ipc/internal.h
+++ b/ksrc/drivers/ipc/internal.h
@@ -25,6 +25,8 @@
 #include <rtdm/rtdm.h>
 #include <rtdm/rtdm_driver.h>
 
+#define RTIPC_IOV_MAX  64
+
 struct rtipc_protocol;
 
 struct rtipc_private {
diff --git a/ksrc/drivers/ipc/xddp.c b/ksrc/drivers/ipc/xddp.c
index b9a69ce..58ca073 100644
--- a/ksrc/drivers/ipc/xddp.c
+++ b/ksrc/drivers/ipc/xddp.c
@@ -66,8 +66,6 @@ static struct sockaddr_ipc nullsa = {
 
 static struct xddp_socket *portmap[CONFIG_XENO_OPT_PIPE_NRDEV];
 
-#define MAX_IOV_NUMBER  64
-
 #define _XDDP_SYNCWAIT  0
 #define _XDDP_ATOMIC    1
 #define _XDDP_BINDING   2
@@ -348,7 +346,7 @@ static ssize_t xddp_recvmsg(struct rtipc_private *priv,
                            rtdm_user_info_t *user_info,
                            struct msghdr *msg, int flags)
 {
-       struct iovec iov[MAX_IOV_NUMBER];
+       struct iovec iov[RTIPC_IOV_MAX];
        struct sockaddr_ipc saddr;
        ssize_t ret;
 
@@ -361,7 +359,7 @@ static ssize_t xddp_recvmsg(struct rtipc_private *priv,
        } else if (msg->msg_namelen != 0)
                return -EINVAL;
 
-       if (msg->msg_iovlen >= MAX_IOV_NUMBER)
+       if (msg->msg_iovlen >= RTIPC_IOV_MAX)
                return -EINVAL;
 
        /* Copy I/O vector in */
@@ -607,7 +605,7 @@ static ssize_t xddp_sendmsg(struct rtipc_private *priv,
                            const struct msghdr *msg, int flags)
 {
        struct xddp_socket *sk = priv->state;
-       struct iovec iov[MAX_IOV_NUMBER];
+       struct iovec iov[RTIPC_IOV_MAX];
        struct sockaddr_ipc daddr;
        ssize_t ret;
 
@@ -646,7 +644,7 @@ static ssize_t xddp_sendmsg(struct rtipc_private *priv,
                        return -ENOTCONN;
        }
 
-       if (msg->msg_iovlen >= MAX_IOV_NUMBER)
+       if (msg->msg_iovlen >= RTIPC_IOV_MAX)
                return -EINVAL;
 
        /* Copy I/O vector in */


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to