Re: [PATCH 7/7] [S390]: Add AF_IUCV socket support

2007-02-06 Thread Christoph Hellwig
 -#define NPROTO   32  /* should be enough for now..   
 */
 +#define NPROTO   33  /* should be enough for now..   
 */

You can't simply increase NPROTO, but there should be holes left.
Ask DaveM for a proper allocation.

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] [S390]: Add AF_IUCV socket support

2007-02-05 Thread Frank Pavlic
From: Jennifer Hunt[EMAIL PROTECTED]

This patch adds AF_IUCV socket support.

Signed-off-by: Frank Pavlic [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---

 arch/s390/defconfig|1 
 include/linux/net.h|2 
 include/linux/socket.h |4 
 include/net/iucv/af_iucv.h |  106 
 net/iucv/Kconfig   |8 
 net/iucv/Makefile  |1 
 net/iucv/af_iucv.c | 1077 
 7 files changed, 1197 insertions(+), 2 deletions(-)

diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 56fe005..11a8049 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -178,6 +178,7 @@ # CONFIG_XFRM_USER is not set
 # CONFIG_XFRM_SUB_POLICY is not set
 CONFIG_NET_KEY=y
 CONFIG_IUCV=m
+CONFIG_AFIUCV=m
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
diff --git a/include/linux/net.h b/include/linux/net.h
index f28d8a2..4db21e6 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -24,7 +24,7 @@ #include asm/socket.h
 struct poll_table_struct;
 struct inode;
 
-#define NPROTO 32  /* should be enough for now..   */
+#define NPROTO 33  /* should be enough for now..   */
 
 #define SYS_SOCKET 1   /* sys_socket(2)*/
 #define SYS_BIND   2   /* sys_bind(2)  */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 92cd38e..fcd35a2 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -187,7 +187,8 @@ #define AF_WANPIPE  25  /* Wanpipe API Soc
 #define AF_LLC 26  /* Linux LLC*/
 #define AF_TIPC30  /* TIPC sockets */
 #define AF_BLUETOOTH   31  /* Bluetooth sockets*/
-#define AF_MAX 32  /* For now.. */
+#define AF_IUCV32  /* IUCV sockets */
+#define AF_MAX 33  /* For now.. */
 
 /* Protocol families, same as address families. */
 #define PF_UNSPEC  AF_UNSPEC
@@ -220,6 +221,7 @@ #define PF_WANPIPE  AF_WANPIPE
 #define PF_LLC AF_LLC
 #define PF_TIPCAF_TIPC
 #define PF_BLUETOOTH   AF_BLUETOOTH
+#define PF_IUCVAF_IUCV
 #define PF_MAX AF_MAX
 
 /* Maximum queue length specifiable by listen.  */
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
new file mode 100644
index 000..04d1abb
--- /dev/null
+++ b/include/net/iucv/af_iucv.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2006 IBM Corporation
+ * IUCV protocol stack for Linux on zSeries
+ * Version 1.0
+ * Author(s): Jennifer Hunt [EMAIL PROTECTED]
+ *
+ */
+
+#ifndef __AFIUCV_H
+#define __AFIUCV_H
+
+#include asm/types.h
+#include asm/byteorder.h
+#include linux/list.h
+#include linux/poll.h
+#include linux/socket.h
+
+#ifndef AF_IUCV
+#define AF_IUCV32
+#define PF_IUCVAF_IUCV
+#endif
+
+/* Connection and socket states */
+enum {
+   IUCV_CONNECTED = 1,
+   IUCV_OPEN,
+   IUCV_BOUND,
+   IUCV_LISTEN,
+   IUCV_SEVERED,
+   IUCV_DISCONN,
+   IUCV_CLOSED
+};
+
+#define IUCV_QUEUELEN_DEFAULT  65535
+#define IUCV_CONN_TIMEOUT  (HZ * 40)
+#define IUCV_DISCONN_TIMEOUT   (HZ * 2)
+#define IUCV_CONN_IDLE_TIMEOUT (HZ * 60)
+#define IUCV_BUFSIZE_DEFAULT   32768
+
+/* IUCV socket address */
+struct sockaddr_iucv {
+   sa_family_t siucv_family;
+   unsigned short  siucv_port; /* Reserved */
+   unsigned intsiucv_addr; /* Reserved */
+   charsiucv_nodeid[8];/* Reserved */
+   charsiucv_user_id[8];   /* Guest User Id */
+   charsiucv_name[8];  /* Application Name */
+};
+
+
+/* Common socket structures and functions */
+
+#define iucv_sk(__sk) ((struct iucv_sock *) __sk)
+
+struct iucv_sock {
+   struct sock sk;
+   charsrc_user_id[8];
+   charsrc_name[8];
+   chardst_user_id[8];
+   chardst_name[8];
+   struct list_headaccept_q;
+   struct sock *parent;
+   struct iucv_path*path;
+   struct sk_buff_head send_skb_q;
+   unsigned intsend_tag;
+};
+
+struct iucv_sock_list {
+   struct hlist_head head;
+   rwlock_t  lock;
+   atomic_t  autobind_name;
+};
+
+static void iucv_sock_destruct(struct sock *sk);
+static void iucv_sock_cleanup_listen(struct sock *parent);
+static void iucv_sock_kill(struct sock *sk);
+static void iucv_sock_close(struct sock *sk);
+static int  iucv_sock_create(struct socket *sock, int proto);
+static int  iucv_sock_bind(struct socket *sock, struct sockaddr *addr,
+   int addr_len);
+static int  iucv_sock_connect(struct socket *sock, struct sockaddr *addr,
+ int alen, int 

[PATCH 7/7] [S390]: Add AF_IUCV socket support

2007-02-02 Thread Frank Pavlic
From: Jennifer Hunt[EMAIL PROTECTED]

This patch adds AF_IUCV socket support.

Signed-off-by: Frank Pavlic [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---

 arch/s390/defconfig|1 
 include/linux/net.h|2 
 include/linux/socket.h |4 
 include/net/iucv/af_iucv.h |  106 
 net/iucv/Kconfig   |8 
 net/iucv/Makefile  |1 
 net/iucv/af_iucv.c | 1077 
 7 files changed, 1197 insertions(+), 2 deletions(-)

diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 56fe005..11a8049 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -178,6 +178,7 @@ # CONFIG_XFRM_USER is not set
 # CONFIG_XFRM_SUB_POLICY is not set
 CONFIG_NET_KEY=y
 CONFIG_IUCV=m
+CONFIG_AFIUCV=m
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
diff --git a/include/linux/net.h b/include/linux/net.h
index f28d8a2..4db21e6 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -24,7 +24,7 @@ #include asm/socket.h
 struct poll_table_struct;
 struct inode;
 
-#define NPROTO 32  /* should be enough for now..   */
+#define NPROTO 33  /* should be enough for now..   */
 
 #define SYS_SOCKET 1   /* sys_socket(2)*/
 #define SYS_BIND   2   /* sys_bind(2)  */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 92cd38e..fcd35a2 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -187,7 +187,8 @@ #define AF_WANPIPE  25  /* Wanpipe API Soc
 #define AF_LLC 26  /* Linux LLC*/
 #define AF_TIPC30  /* TIPC sockets */
 #define AF_BLUETOOTH   31  /* Bluetooth sockets*/
-#define AF_MAX 32  /* For now.. */
+#define AF_IUCV32  /* IUCV sockets */
+#define AF_MAX 33  /* For now.. */
 
 /* Protocol families, same as address families. */
 #define PF_UNSPEC  AF_UNSPEC
@@ -220,6 +221,7 @@ #define PF_WANPIPE  AF_WANPIPE
 #define PF_LLC AF_LLC
 #define PF_TIPCAF_TIPC
 #define PF_BLUETOOTH   AF_BLUETOOTH
+#define PF_IUCVAF_IUCV
 #define PF_MAX AF_MAX
 
 /* Maximum queue length specifiable by listen.  */
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
new file mode 100644
index 000..04d1abb
--- /dev/null
+++ b/include/net/iucv/af_iucv.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2006 IBM Corporation
+ * IUCV protocol stack for Linux on zSeries
+ * Version 1.0
+ * Author(s): Jennifer Hunt [EMAIL PROTECTED]
+ *
+ */
+
+#ifndef __AFIUCV_H
+#define __AFIUCV_H
+
+#include asm/types.h
+#include asm/byteorder.h
+#include linux/list.h
+#include linux/poll.h
+#include linux/socket.h
+
+#ifndef AF_IUCV
+#define AF_IUCV32
+#define PF_IUCVAF_IUCV
+#endif
+
+/* Connection and socket states */
+enum {
+   IUCV_CONNECTED = 1,
+   IUCV_OPEN,
+   IUCV_BOUND,
+   IUCV_LISTEN,
+   IUCV_SEVERED,
+   IUCV_DISCONN,
+   IUCV_CLOSED
+};
+
+#define IUCV_QUEUELEN_DEFAULT  65535
+#define IUCV_CONN_TIMEOUT  (HZ * 40)
+#define IUCV_DISCONN_TIMEOUT   (HZ * 2)
+#define IUCV_CONN_IDLE_TIMEOUT (HZ * 60)
+#define IUCV_BUFSIZE_DEFAULT   32768
+
+/* IUCV socket address */
+struct sockaddr_iucv {
+   sa_family_t siucv_family;
+   unsigned short  siucv_port; /* Reserved */
+   unsigned intsiucv_addr; /* Reserved */
+   charsiucv_nodeid[8];/* Reserved */
+   charsiucv_user_id[8];   /* Guest User Id */
+   charsiucv_name[8];  /* Application Name */
+};
+
+
+/* Common socket structures and functions */
+
+#define iucv_sk(__sk) ((struct iucv_sock *) __sk)
+
+struct iucv_sock {
+   struct sock sk;
+   charsrc_user_id[8];
+   charsrc_name[8];
+   chardst_user_id[8];
+   chardst_name[8];
+   struct list_headaccept_q;
+   struct sock *parent;
+   struct iucv_path*path;
+   struct sk_buff_head send_skb_q;
+   unsigned intsend_tag;
+};
+
+struct iucv_sock_list {
+   struct hlist_head head;
+   rwlock_t  lock;
+   atomic_t  autobind_name;
+};
+
+static void iucv_sock_destruct(struct sock *sk);
+static void iucv_sock_cleanup_listen(struct sock *parent);
+static void iucv_sock_kill(struct sock *sk);
+static void iucv_sock_close(struct sock *sk);
+static int  iucv_sock_create(struct socket *sock, int proto);
+static int  iucv_sock_bind(struct socket *sock, struct sockaddr *addr,
+   int addr_len);
+static int  iucv_sock_connect(struct socket *sock, struct sockaddr *addr,
+ int alen, int