diff options
author | Ursula Braun <ursula.braun@de.ibm.com> | 2011-08-07 21:33:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-13 04:10:16 -0400 |
commit | 3881ac441f642d56503818123446f7298442236b (patch) | |
tree | 79dfd48212f559c18e70ed5d142101ce37897152 /include/net/iucv | |
parent | 4dc83dfd3efa015628ebaa7245d342c8d5ca0298 (diff) |
af_iucv: add HiperSockets transport
The current transport mechanism for af_iucv is the z/VM offered
communications facility IUCV. To provide equivalent support when
running Linux in an LPAR, HiperSockets transport is added to the
AF_IUCV address family. It requires explicit binding of an AF_IUCV
socket to a HiperSockets device. A new packet_type ETH_P_AF_IUCV
is announced. An af_iucv specific transport header is defined
preceding the skb data. A small protocol is implemented for
connecting and for flow control/congestion management.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/iucv')
-rw-r--r-- | include/net/iucv/af_iucv.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h index f82a1e877372..f2419cf44cef 100644 --- a/include/net/iucv/af_iucv.h +++ b/include/net/iucv/af_iucv.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
15 | #include <linux/poll.h> | 15 | #include <linux/poll.h> |
16 | #include <linux/socket.h> | 16 | #include <linux/socket.h> |
17 | #include <net/iucv/iucv.h> | ||
17 | 18 | ||
18 | #ifndef AF_IUCV | 19 | #ifndef AF_IUCV |
19 | #define AF_IUCV 32 | 20 | #define AF_IUCV 32 |
@@ -33,6 +34,7 @@ enum { | |||
33 | }; | 34 | }; |
34 | 35 | ||
35 | #define IUCV_QUEUELEN_DEFAULT 65535 | 36 | #define IUCV_QUEUELEN_DEFAULT 65535 |
37 | #define IUCV_HIPER_MSGLIM_DEFAULT 128 | ||
36 | #define IUCV_CONN_TIMEOUT (HZ * 40) | 38 | #define IUCV_CONN_TIMEOUT (HZ * 40) |
37 | #define IUCV_DISCONN_TIMEOUT (HZ * 2) | 39 | #define IUCV_DISCONN_TIMEOUT (HZ * 2) |
38 | #define IUCV_CONN_IDLE_TIMEOUT (HZ * 60) | 40 | #define IUCV_CONN_IDLE_TIMEOUT (HZ * 60) |
@@ -57,8 +59,51 @@ struct sock_msg_q { | |||
57 | spinlock_t lock; | 59 | spinlock_t lock; |
58 | }; | 60 | }; |
59 | 61 | ||
62 | #define AF_IUCV_FLAG_ACK 0x1 | ||
63 | #define AF_IUCV_FLAG_SYN 0x2 | ||
64 | #define AF_IUCV_FLAG_FIN 0x4 | ||
65 | #define AF_IUCV_FLAG_WIN 0x8 | ||
66 | |||
67 | struct af_iucv_trans_hdr { | ||
68 | u16 magic; | ||
69 | u8 version; | ||
70 | u8 flags; | ||
71 | u16 window; | ||
72 | char destNodeID[8]; | ||
73 | char destUserID[8]; | ||
74 | char destAppName[16]; | ||
75 | char srcNodeID[8]; | ||
76 | char srcUserID[8]; | ||
77 | char srcAppName[16]; /* => 70 bytes */ | ||
78 | struct iucv_message iucv_hdr; /* => 33 bytes */ | ||
79 | u8 pad; /* total 104 bytes */ | ||
80 | } __packed; | ||
81 | |||
82 | enum iucv_tx_notify { | ||
83 | /* transmission of skb is completed and was successful */ | ||
84 | TX_NOTIFY_OK = 0, | ||
85 | /* target is unreachable */ | ||
86 | TX_NOTIFY_UNREACHABLE = 1, | ||
87 | /* transfer pending queue full */ | ||
88 | TX_NOTIFY_TPQFULL = 2, | ||
89 | /* general error */ | ||
90 | TX_NOTIFY_GENERALERROR = 3, | ||
91 | /* transmission of skb is pending - may interleave | ||
92 | * with TX_NOTIFY_DELAYED_* */ | ||
93 | TX_NOTIFY_PENDING = 4, | ||
94 | /* transmission of skb was done successfully (delayed) */ | ||
95 | TX_NOTIFY_DELAYED_OK = 5, | ||
96 | /* target unreachable (detected delayed) */ | ||
97 | TX_NOTIFY_DELAYED_UNREACHABLE = 6, | ||
98 | /* general error (detected delayed) */ | ||
99 | TX_NOTIFY_DELAYED_GENERALERROR = 7, | ||
100 | }; | ||
101 | |||
60 | #define iucv_sk(__sk) ((struct iucv_sock *) __sk) | 102 | #define iucv_sk(__sk) ((struct iucv_sock *) __sk) |
61 | 103 | ||
104 | #define AF_IUCV_TRANS_IUCV 0 | ||
105 | #define AF_IUCV_TRANS_HIPER 1 | ||
106 | |||
62 | struct iucv_sock { | 107 | struct iucv_sock { |
63 | struct sock sk; | 108 | struct sock sk; |
64 | char src_user_id[8]; | 109 | char src_user_id[8]; |
@@ -75,6 +120,13 @@ struct iucv_sock { | |||
75 | unsigned int send_tag; | 120 | unsigned int send_tag; |
76 | u8 flags; | 121 | u8 flags; |
77 | u16 msglimit; | 122 | u16 msglimit; |
123 | u16 msglimit_peer; | ||
124 | atomic_t msg_sent; | ||
125 | atomic_t msg_recv; | ||
126 | atomic_t pendings; | ||
127 | int transport; | ||
128 | void (*sk_txnotify)(struct sk_buff *skb, | ||
129 | enum iucv_tx_notify n); | ||
78 | }; | 130 | }; |
79 | 131 | ||
80 | /* iucv socket options (SOL_IUCV) */ | 132 | /* iucv socket options (SOL_IUCV) */ |