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