[WSD] Make QP destruction asynchronous to speed up socket closure.
[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(\r
35         OUT                             LPINT                                           lpErrno );\r
36 \r
37 void AL_API\r
38 deref_socket_info(\r
39         IN                              struct ibsp_socket_info         *p_socket );\r
40 \r
41 /* protos from extension.c */\r
42 HANDLE WSPAPI\r
43 IBSPRegisterMemory(\r
44         IN                              SOCKET                                          s,\r
45         IN                              PVOID                                           lpBuffer,\r
46         IN                              DWORD                                           dwBufferLength,\r
47         IN                              DWORD                                           dwFlags,\r
48                 OUT                     LPINT                                           lpErrno );\r
49 \r
50 int WSPAPI\r
51 IBSPDeregisterMemory(\r
52         IN                              SOCKET                                          s,\r
53         IN                              HANDLE                                          handle,\r
54                 OUT                     LPINT                                           lpErrno );\r
55 \r
56 int WSPAPI\r
57 IBSPRegisterRdmaMemory(\r
58         IN                              SOCKET                                          s,\r
59         IN                              PVOID                                           lpBuffer,\r
60         IN                              DWORD                                           dwBufferLength,\r
61         IN                              DWORD                                           dwFlags,\r
62                 OUT                     LPVOID                                          lpRdmaBufferDescriptor,\r
63         IN      OUT                     LPDWORD                                         lpdwDescriptorLength,\r
64                 OUT                     LPINT                                           lpErrno );\r
65 \r
66 int WSPAPI\r
67 IBSPDeregisterRdmaMemory(\r
68         IN                              SOCKET                                          s,\r
69         IN                              LPVOID                                          lpRdmaBufferDescriptor,\r
70         IN                              DWORD                                           dwDescriptorLength,\r
71                 OUT                     LPINT                                           lpErrno );\r
72 \r
73 int WSPAPI\r
74 IBSPRdmaWrite(\r
75         IN                              SOCKET                                          s,\r
76         IN                              LPWSABUFEX                                      lpBuffers,\r
77         IN                              DWORD                                           dwBufferCount,\r
78         IN                              LPVOID                                          lpTargetBufferDescriptor,\r
79         IN                              DWORD                                           dwTargetDescriptorLength,\r
80         IN                              DWORD                                           dwTargetBufferOffset,\r
81                 OUT                     LPDWORD                                         lpdwNumberOfBytesWritten,\r
82         IN                              DWORD                                           dwFlags,\r
83         IN                              LPWSAOVERLAPPED                         lpOverlapped,\r
84         IN                              LPWSAOVERLAPPED_COMPLETION_ROUTINE      lpCompletionRoutine,\r
85         IN                              LPWSATHREADID                           lpThreadId,\r
86                 OUT                     LPINT                                           lpErrno );\r
87 \r
88 int WSPAPI\r
89 IBSPRdmaRead(\r
90         IN                              SOCKET                                          s,\r
91         IN                              LPWSABUFEX                                      lpBuffers,\r
92         IN                              DWORD                                           dwBufferCount,\r
93         IN                              LPVOID                                          lpTargetBufferDescriptor,\r
94         IN                              DWORD                                           dwTargetDescriptorLength,\r
95         IN                              DWORD                                           dwTargetBufferOffset,\r
96                 OUT                     LPDWORD                                         lpdwNumberOfBytesRead,\r
97         IN                              DWORD                                           dwFlags,\r
98         IN                              LPWSAOVERLAPPED                         lpOverlapped,\r
99         IN                              LPWSAOVERLAPPED_COMPLETION_ROUTINE      lpCompletionRoutine,\r
100         IN                              LPWSATHREADID                           lpThreadId,\r
101                 OUT                     LPINT                                           lpErrno );\r
102 \r
103 int WSPAPI\r
104 IBSPMemoryRegistrationCacheCallback(\r
105         IN                              LPVOID                                          lpvAddress,\r
106         IN                              SIZE_T                                          Size,\r
107                 OUT                     LPINT                                           lpErrno );\r
108 \r
109 /* Protos from ibsp_iblow.c */\r
110 extern void\r
111 ib_release( void );\r
112 \r
113 extern int\r
114 ibsp_initialize( void );\r
115 \r
116 void\r
117 ib_release_cq_tinfo(\r
118                                         struct cq_thread_info           *cq_tinfo );\r
119 \r
120 void\r
121 ib_destroy_cq_tinfo(\r
122                                         struct cq_thread_info           *cq_tinfo );\r
123 \r
124 int\r
125 ib_create_socket(\r
126         IN      OUT                     struct ibsp_socket_info         *socket_info );\r
127 \r
128 void\r
129 ib_destroy_socket(\r
130         IN      OUT                     struct ibsp_socket_info         *socket_info );\r
131 \r
132 void\r
133 shutdown_and_destroy_socket_info(\r
134         IN      OUT                     struct ibsp_socket_info         *socket_info );\r
135 \r
136 void\r
137 ib_cq_comp(\r
138                                         void                                            *cq_context );\r
139 \r
140 void\r
141 wait_cq_drain(\r
142         IN      OUT                     struct ibsp_socket_info         *socket_info );\r
143 \r
144 void\r
145 ibsp_dup_overlap_abort(\r
146         IN      OUT                     struct ibsp_socket_info         *socket_info );\r
147 \r
148 /* Protos from misc.c */\r
149 extern int\r
150 ibal_to_wsa_error(\r
151         IN                              const ib_api_status_t           status );\r
152 \r
153 /* Protos from ibsp_ip.c */\r
154 void\r
155 update_all_ip_addrs(void);\r
156 \r
157 intn_t CL_API\r
158 ip_cmp(\r
159         IN      const void* const               p_key1,\r
160         IN      const void*     const           p_key2 );\r
161 \r
162 int\r
163 query_guid_address(\r
164         IN                              struct ibsp_port                        *port,\r
165         IN                              ib_net32_t                                      ip_addr,\r
166                 OUT                     ib_net64_t                                      *port_guid );\r
167 \r
168 int\r
169 query_pr(\r
170         IN                              struct ibsp_port                        *port,\r
171         IN                              ib_net64_t                                      dest_port_guid,\r
172                 OUT                     ib_path_rec_t                           *path_rec );\r
173 \r
174 int\r
175 build_ip_list(\r
176         IN      OUT                     LPSOCKET_ADDRESS_LIST           ip_list,\r
177         IN      OUT                     LPDWORD                                         ip_list_size,\r
178                 OUT                     LPINT                                           lpErrno );\r
179 \r
180 struct ibsp_port*\r
181 get_port_from_ip_address(\r
182         IN              const   struct in_addr                          sin_addr );\r
183 \r
184 /* Protos from ibsp_cm.c */\r
185 extern int\r
186 ib_listen(\r
187         IN                              struct ibsp_socket_info         *socket_info );\r
188 \r
189 void\r
190 ib_listen_cancel(\r
191         IN                              struct ibsp_socket_info         *socket_info );\r
192 \r
193 void\r
194 ib_reject(\r
195         IN              const   ib_cm_handle_t                          h_cm,\r
196         IN              const   ib_rej_status_t                         rej_status );\r
197 \r
198 int\r
199 ib_accept(\r
200         IN                              struct ibsp_socket_info         *socket_info,\r
201         IN                              ib_cm_req_rec_t                         *cm_req_received );\r
202 \r
203 int\r
204 ib_connect(\r
205         IN                              struct ibsp_socket_info         *socket_info,\r
206         IN                              ib_path_rec_t                           *path_rec );\r
207 \r
208 void\r
209 ib_disconnect(\r
210         IN                              struct ibsp_socket_info         *socket_info,\r
211         IN                              struct disconnect_reason        *reason );\r
212 \r
213 void\r
214 ib_listen_backlog(\r
215         IN                              struct ibsp_socket_info         *socket_info,\r
216         IN                              int                                                     backlog );\r
217 \r
218 /* ibsp_pnp.h */\r
219 ib_api_status_t\r
220 register_pnp( void );\r
221 \r
222 void\r
223 unregister_pnp( void );\r
224 \r
225 void\r
226 pnp_ca_remove(\r
227                                         struct ibsp_hca                         *hca);\r
228 \r
229 /* ibsp_duplicate.c */\r
230 int\r
231 setup_duplicate_socket(\r
232         IN                              struct ibsp_socket_info         *socket_info,\r
233         IN                              DWORD                                           identifier );\r
234 \r
235 int\r
236 prepare_duplicate_socket(\r
237         IN                              struct ibsp_socket_info         *socket_info,\r
238         IN                              DWORD                                           dwProcessId );\r
239 \r
240 /* ibsp_mem.c */\r
241 struct memory_node *\r
242 lookup_partial_mr(\r
243         IN                              struct mr_list                          *mem_list,\r
244         IN                              ib_access_t                                     acl_mask,\r
245         IN                              void                                            *start,\r
246         IN                              size_t                                          len );\r
247 \r
248 struct memory_node *\r
249 ib_register_memory(\r
250         IN                              struct mr_list                          *mem_list,\r
251         IN                              ib_pd_handle_t                          pd,\r
252         IN                              void                                            *start,\r
253         IN                              size_t                                          len,\r
254         IN                              ib_access_t                                     access_ctrl,\r
255                 OUT                     LPINT                                           lpErrno );\r
256 \r
257 int\r
258 ib_deregister_memory(\r
259         IN                              struct mr_list                          *mem_list,\r
260         IN                              struct memory_node                      *node,\r
261                 OUT                     LPINT                                           lpErrno );\r
262 \r
263 void\r
264 ib_deregister_all_mr(\r
265         IN                              struct mr_list                          *mem_list );\r
266 \r
267 int\r
268 ibsp_conn_insert(\r
269         IN                              struct ibsp_socket_info         *socket_info );\r
270 \r
271 void\r
272 ibsp_conn_remove(\r
273         IN                              struct ibsp_socket_info         *socket_info );\r
274 \r
275 void\r
276 ibsp_post_select_event(\r
277                                         struct ibsp_socket_info         *socket_info,\r
278                                         int                                                     event,\r
279                                         int                                                     error );\r
280 \r
281 /* ibspdll.c */\r
282 extern int\r
283 init_globals( void );\r
284 \r
285 extern void\r
286 release_globals( void );\r