[WSD] Update to CM interaction. Added tracking of connections by
[mirror/winof/.git] / ulp / wsd / user / ibspproto.h
1 /*\r
2  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
3  *\r
4  * This software is available to you under the OpenIB.org BSD license\r
5  * below:\r
6  *\r
7  *     Redistribution and use in source and binary forms, with or\r
8  *     without modification, are permitted provided that the following\r
9  *     conditions are met:\r
10  *\r
11  *      - Redistributions of source code must retain the above\r
12  *        copyright notice, this list of conditions and the following\r
13  *        disclaimer.\r
14  *\r
15  *      - Redistributions in binary form must reproduce the above\r
16  *        copyright notice, this list of conditions and the following\r
17  *        disclaimer in the documentation and/or other materials\r
18  *        provided with the distribution.\r
19  *\r
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
23  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
24  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
25  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
26  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
27  * SOFTWARE.\r
28  *\r
29  * $Id$\r
30  */\r
31 \r
32 /* protos from socketinfo.c */\r
33 struct ibsp_socket_info *\r
34 create_socket_info( void );\r
35 \r
36 void\r
37 free_socket_info(\r
38         struct ibsp_socket_info *socket_info );\r
39 \r
40 /* protos from extension.c */\r
41 HANDLE WSPAPI\r
42 IBSPRegisterMemory(\r
43         IN                              SOCKET                                          s,\r
44         IN                              PVOID                                           lpBuffer,\r
45         IN                              DWORD                                           dwBufferLength,\r
46         IN                              DWORD                                           dwFlags,\r
47                 OUT                     LPINT                                           lpErrno );\r
48 \r
49 int WSPAPI\r
50 IBSPDeregisterMemory(\r
51         IN                              SOCKET                                          s,\r
52         IN                              HANDLE                                          handle,\r
53                 OUT                     LPINT                                           lpErrno );\r
54 \r
55 int WSPAPI\r
56 IBSPRegisterRdmaMemory(\r
57         IN                              SOCKET                                          s,\r
58         IN                              PVOID                                           lpBuffer,\r
59         IN                              DWORD                                           dwBufferLength,\r
60         IN                              DWORD                                           dwFlags,\r
61                 OUT                     LPVOID                                          lpRdmaBufferDescriptor,\r
62         IN      OUT                     LPDWORD                                         lpdwDescriptorLength,\r
63                 OUT                     LPINT                                           lpErrno );\r
64 \r
65 int WSPAPI\r
66 IBSPDeregisterRdmaMemory(\r
67         IN                              SOCKET                                          s,\r
68         IN                              LPVOID                                          lpRdmaBufferDescriptor,\r
69         IN                              DWORD                                           dwDescriptorLength,\r
70                 OUT                     LPINT                                           lpErrno );\r
71 \r
72 int WSPAPI\r
73 IBSPRdmaWrite(\r
74         IN                              SOCKET                                          s,\r
75         IN                              LPWSABUFEX                                      lpBuffers,\r
76         IN                              DWORD                                           dwBufferCount,\r
77         IN                              LPVOID                                          lpTargetBufferDescriptor,\r
78         IN                              DWORD                                           dwTargetDescriptorLength,\r
79         IN                              DWORD                                           dwTargetBufferOffset,\r
80                 OUT                     LPDWORD                                         lpdwNumberOfBytesWritten,\r
81         IN                              DWORD                                           dwFlags,\r
82         IN                              LPWSAOVERLAPPED                         lpOverlapped,\r
83         IN                              LPWSAOVERLAPPED_COMPLETION_ROUTINE      lpCompletionRoutine,\r
84         IN                              LPWSATHREADID                           lpThreadId,\r
85                 OUT                     LPINT                                           lpErrno );\r
86 \r
87 int WSPAPI\r
88 IBSPRdmaRead(\r
89         IN                              SOCKET                                          s,\r
90         IN                              LPWSABUFEX                                      lpBuffers,\r
91         IN                              DWORD                                           dwBufferCount,\r
92         IN                              LPVOID                                          lpTargetBufferDescriptor,\r
93         IN                              DWORD                                           dwTargetDescriptorLength,\r
94         IN                              DWORD                                           dwTargetBufferOffset,\r
95                 OUT                     LPDWORD                                         lpdwNumberOfBytesRead,\r
96         IN                              DWORD                                           dwFlags,\r
97         IN                              LPWSAOVERLAPPED                         lpOverlapped,\r
98         IN                              LPWSAOVERLAPPED_COMPLETION_ROUTINE      lpCompletionRoutine,\r
99         IN                              LPWSATHREADID                           lpThreadId,\r
100                 OUT                     LPINT                                           lpErrno );\r
101 \r
102 int WSPAPI\r
103 IBSPMemoryRegistrationCacheCallback(\r
104         IN                              LPVOID                                          lpvAddress,\r
105         IN                              SIZE_T                                          Size,\r
106                 OUT                     LPINT                                           lpErrno );\r
107 \r
108 /* Protos from ibsp_iblow.c */\r
109 extern void\r
110 ib_release( void );\r
111 \r
112 extern int\r
113 ibsp_initialize( void );\r
114 \r
115 int\r
116 ib_create_socket(\r
117         IN      OUT                     struct ibsp_socket_info         *socket_info );\r
118 \r
119 void\r
120 ib_destroy_socket(\r
121         IN      OUT                     struct ibsp_socket_info         *socket_info );\r
122 \r
123 void\r
124 shutdown_and_destroy_socket_info(\r
125         IN      OUT                     struct ibsp_socket_info         *socket_info,\r
126         IN                              int                                                     old_state );\r
127 \r
128 void\r
129 destroy_qp_and_release_ressources(\r
130         IN      OUT                     struct ibsp_socket_info         *socket_info );\r
131 \r
132 void\r
133 ib_cq_comp(\r
134                                         void                                            *cq_context );\r
135 \r
136 void\r
137 wait_cq_drain(\r
138         IN      OUT                     struct ibsp_socket_info         *socket_info );\r
139 \r
140 void\r
141 ibsp_dup_overlap_abort(\r
142         IN      OUT                     struct ibsp_socket_info         *socket_info );\r
143 \r
144 /* Protos from misc.c */\r
145 extern int\r
146 ibal_to_wsa_error(\r
147         IN                              const ib_api_status_t           status );\r
148 \r
149 /* Protos from ibsp_ip.c */\r
150 void\r
151 update_all_ip_addrs(void);\r
152 \r
153 intn_t CL_API\r
154 ip_cmp(\r
155         IN      const void* const               p_key1,\r
156         IN      const void*     const           p_key2 );\r
157 \r
158 int\r
159 query_guid_address(\r
160         IN                              struct ibsp_port                        *port,\r
161         IN                              ib_net32_t                                      ip_addr,\r
162                 OUT                     ib_net64_t                                      *port_guid );\r
163 \r
164 int\r
165 query_pr(\r
166         IN                              struct ibsp_port                        *port,\r
167         IN                              ib_net64_t                                      dest_port_guid,\r
168                 OUT                     ib_path_rec_t                           *path_rec );\r
169 \r
170 int\r
171 build_ip_list(\r
172         IN      OUT                     LPSOCKET_ADDRESS_LIST           ip_list,\r
173         IN      OUT                     LPDWORD                                         ip_list_size,\r
174                 OUT                     LPINT                                           lpErrno );\r
175 \r
176 struct ibsp_port*\r
177 get_port_from_ip_address(\r
178         IN              const   struct in_addr                          sin_addr );\r
179 \r
180 /* Protos from ibsp_cm.c */\r
181 extern int\r
182 ib_listen(\r
183         IN                              struct ibsp_socket_info         *socket_info,\r
184                 OUT                     LPINT                                           lpErrno );\r
185 \r
186 void\r
187 ib_listen_cancel(\r
188         IN                              struct ibsp_socket_info         *socket_info );\r
189 \r
190 void\r
191 ib_reject(\r
192         IN              const   ib_cm_handle_t                          h_cm,\r
193         IN              const   ib_rej_status_t                         rej_status );\r
194 \r
195 int\r
196 ib_accept(\r
197         IN                              struct ibsp_socket_info         *socket_info,\r
198         IN                              ib_cm_req_rec_t                         *cm_req_received );\r
199 \r
200 int\r
201 ib_connect(\r
202         IN                              struct ibsp_socket_info         *socket_info,\r
203         IN                              ib_path_rec_t                           *path_rec );\r
204 \r
205 void\r
206 ib_disconnect(\r
207         IN                              struct ibsp_socket_info         *socket_info,\r
208         IN                              struct disconnect_reason        *reason );\r
209 \r
210 void\r
211 ib_listen_backlog(\r
212         IN                              struct ibsp_socket_info         *socket_info,\r
213         IN                              int                                                     backlog );\r
214 \r
215 /* ibsp_pnp.h */\r
216 ib_api_status_t\r
217 register_pnp( void );\r
218 \r
219 void\r
220 unregister_pnp( void );\r
221 \r
222 void\r
223 pnp_ca_remove(\r
224                                         struct ibsp_hca                         *hca);\r
225 \r
226 /* ibsp_duplicate.c */\r
227 int\r
228 setup_duplicate_socket(\r
229         IN                              struct ibsp_socket_info         *socket_info,\r
230         IN                              DWORD                                           identifier );\r
231 \r
232 int\r
233 prepare_duplicate_socket(\r
234         IN                              struct ibsp_socket_info         *socket_info,\r
235         IN                              DWORD                                           dwProcessId );\r
236 \r
237 /* ibsp_mem.c */\r
238 struct memory_node *\r
239 lookup_partial_mr(\r
240         IN                              struct mr_list                          *mem_list,\r
241         IN                              ib_access_t                                     acl_mask,\r
242         IN                              void                                            *start,\r
243         IN                              size_t                                          len );\r
244 \r
245 struct memory_node *\r
246 ib_register_memory(\r
247         IN                              struct mr_list                          *mem_list,\r
248         IN                              ib_pd_handle_t                          pd,\r
249         IN                              void                                            *start,\r
250         IN                              size_t                                          len,\r
251         IN                              ib_access_t                                     access_ctrl,\r
252                 OUT                     LPINT                                           lpErrno );\r
253 \r
254 int\r
255 ib_deregister_memory(\r
256         IN                              struct mr_list                          *mem_list,\r
257         IN                              struct memory_node                      *node,\r
258                 OUT                     LPINT                                           lpErrno );\r
259 \r
260 void\r
261 ib_deregister_all_mr(\r
262         IN                              struct mr_list                          *mem_list );\r
263 \r
264 int\r
265 ibsp_conn_insert(\r
266         IN                              struct ibsp_socket_info         *socket_info );\r
267 \r
268 void\r
269 ibsp_conn_remove(\r
270         IN                              struct ibsp_socket_info         *socket_info );\r
271 \r
272 void\r
273 ibsp_post_select_event(\r
274                                         struct ibsp_socket_info         *socket_info,\r
275                                         int                                                     event,\r
276                                         int                                                     error );\r
277 \r
278 /* ibspdll.c */\r
279 extern int\r
280 init_globals( void );\r
281 \r
282 extern void\r
283 release_globals( void );\r