a9b11227ca5bdbeabfd074c320c5e5ddbdb6d37c
[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                 OUT                     LPINT                                           lpErrno );\r
200 \r
201 int\r
202 ib_connect(\r
203         IN                              struct ibsp_socket_info         *socket_info,\r
204         IN                              ib_path_rec_t                           *path_rec,\r
205                 OUT                     LPINT                                           lpErrno );\r
206 \r
207 void\r
208 ib_disconnect(\r
209         IN                              struct ibsp_socket_info         *socket_info,\r
210         IN                              struct disconnect_reason        *reason );\r
211 \r
212 /* ibsp_pnp.h */\r
213 ib_api_status_t\r
214 register_pnp( void );\r
215 \r
216 void\r
217 unregister_pnp( void );\r
218 \r
219 void\r
220 pnp_ca_remove(\r
221                                         struct ibsp_hca                         *hca);\r
222 \r
223 /* ibsp_duplicate.c */\r
224 int\r
225 setup_duplicate_socket(\r
226         IN                              struct ibsp_socket_info         *socket_info,\r
227         IN                              DWORD                                           identifier );\r
228 \r
229 int\r
230 prepare_duplicate_socket(\r
231         IN                              struct ibsp_socket_info         *socket_info,\r
232         IN                              DWORD                                           dwProcessId );\r
233 \r
234 /* ibsp_mem.c */\r
235 struct memory_node *\r
236 lookup_partial_mr(\r
237         IN                              struct mr_list                          *mem_list,\r
238         IN                              ib_access_t                                     acl_mask,\r
239         IN                              void                                            *start,\r
240         IN                              size_t                                          len );\r
241 \r
242 struct memory_node *\r
243 ib_register_memory(\r
244         IN                              struct mr_list                          *mem_list,\r
245         IN                              ib_pd_handle_t                          pd,\r
246         IN                              void                                            *start,\r
247         IN                              size_t                                          len,\r
248         IN                              ib_access_t                                     access_ctrl,\r
249                 OUT                     LPINT                                           lpErrno );\r
250 \r
251 int\r
252 ib_deregister_memory(\r
253         IN                              struct mr_list                          *mem_list,\r
254         IN                              struct memory_node                      *node,\r
255                 OUT                     LPINT                                           lpErrno );\r
256 \r
257 void\r
258 ib_deregister_all_mr(\r
259         IN                              struct mr_list                          *mem_list );\r
260 \r
261 void\r
262 ibsp_post_select_event(\r
263                                         struct ibsp_socket_info         *socket_info,\r
264                                         int                                                     event,\r
265                                         int                                                     error );\r
266 \r
267 /* ibspdll.c */\r
268 extern int\r
269 init_globals( void );\r
270 \r
271 extern void\r
272 release_globals( void );\r