[WSD] Properly size CQs and allow multiple QPs per CQ with HCA drivers that don't...
[mirror/winof/.git] / core / al / user / ual_cm.h
1 /*\r
2  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
3  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. \r
4  *\r
5  * This software is available to you under the OpenIB.org BSD license\r
6  * below:\r
7  *\r
8  *     Redistribution and use in source and binary forms, with or\r
9  *     without modification, are permitted provided that the following\r
10  *     conditions are met:\r
11  *\r
12  *      - Redistributions of source code must retain the above\r
13  *        copyright notice, this list of conditions and the following\r
14  *        disclaimer.\r
15  *\r
16  *      - Redistributions in binary form must reproduce the above\r
17  *        copyright notice, this list of conditions and the following\r
18  *        disclaimer in the documentation and/or other materials\r
19  *        provided with the distribution.\r
20  *\r
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
22  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
23  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
24  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
25  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
26  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
27  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
28  * SOFTWARE.\r
29  *\r
30  * $Id$\r
31  */\r
32 \r
33 #if !defined(__IB_UAL_CM_H__)\r
34 #define __IB_UAL_CM_H__\r
35 \r
36 #include "al_common.h"\r
37 \r
38 \r
39 \r
40 /*\r
41  * Used to store user's callback and other connection information.\r
42  */\r
43 typedef struct _al_listen\r
44 {\r
45         /* CM info is stored as a child to AL. */\r
46         al_obj_t                                        obj;    /* must be first */\r
47 \r
48         /* Callback information. */\r
49         ib_pfn_cm_req_cb_t                      pfn_cm_req_cb;\r
50         ib_pfn_cm_mra_cb_t                      pfn_cm_mra_cb;\r
51         ib_pfn_cm_rej_cb_t                      pfn_cm_rej_cb;\r
52 \r
53         ib_pfn_listen_err_cb_t          pfn_listen_err_cb;\r
54 \r
55         /* valid for ud qp_type only */\r
56         const void                                      *sidr_context;\r
57 \r
58 }       al_listen_t;\r
59 \r
60 \r
61 \r
62 /*\r
63  * Connection request information.  Used only during connection\r
64  * establishment.\r
65  */\r
66 typedef struct _conn_req_t\r
67 {\r
68         /* Path information needed to transiton the QP when connecting. */\r
69         ib_path_rec_t                           path_rec;\r
70         ib_path_rec_t                           alt_path_rec;\r
71 \r
72         /* QP modification parameters provided by the kernel CM. */\r
73         ib_qp_mod_t                                     qp_mod_rtr;\r
74         ib_qp_mod_t                                     qp_mod_rts;\r
75         uint32_t                                        timeout_ms;\r
76 \r
77         /* Callback information needed only when connecting. */\r
78         ib_pfn_cm_req_cb_t                      pfn_cm_req_cb;\r
79         ib_pfn_cm_rep_cb_t                      pfn_cm_rep_cb;\r
80         ib_pfn_cm_rtu_cb_t                      pfn_cm_rtu_cb;\r
81 \r
82 }       conn_req_t;\r
83 \r
84 \r
85 \r
86 /*\r
87  * Used to track connections.\r
88  */\r
89 typedef struct _al_conn\r
90 {\r
91         /* CM info is stored as a child to AL. */\r
92         al_obj_t                                        obj;    /* must be first */\r
93 \r
94         ib_al_handle_t                          h_al;\r
95         cl_list_item_t                          al_item;\r
96         ib_qp_handle_t                          h_qp;\r
97 \r
98         /* Information needed to establish the connection. */\r
99         conn_req_t                                      *p_conn_req;\r
100 \r
101         /* valid for ud qp_type only */\r
102         const void                                      *sidr_context;\r
103 \r
104         /* Callback information needed after sending the RTU. */\r
105         ib_pfn_cm_rej_cb_t                      pfn_cm_rej_cb;\r
106         ib_pfn_cm_mra_cb_t                      pfn_cm_mra_cb;\r
107 \r
108         ib_pfn_cm_lap_cb_t                      pfn_cm_lap_cb;\r
109         ib_pfn_cm_apr_cb_t                      pfn_cm_apr_cb;\r
110 \r
111         ib_pfn_cm_dreq_cb_t                     pfn_cm_dreq_cb;\r
112         ib_pfn_cm_drep_cb_t                     pfn_cm_drep_cb;\r
113 \r
114 }       al_conn_t;\r
115 \r
116 \r
117 \r
118 void\r
119 ual_cm_req_cb(\r
120         IN                              ib_cm_req_rec_t*                        p_cm_req_rec,\r
121         IN                              ib_qp_mod_t*                            p_qp_rtr,\r
122         IN                              ib_qp_mod_t*                            p_qp_rts,\r
123         IN                              uint32_t                                        timeout_ms );\r
124 \r
125 void\r
126 ual_cm_rep_cb(\r
127         IN                              ib_cm_rep_rec_t*                        p_cm_rep_rec,\r
128         IN                              ib_qp_mod_t*                            p_qp_rtr,\r
129         IN                              ib_qp_mod_t*                            p_qp_rts );\r
130 \r
131 void\r
132 ual_cm_rtu_cb(\r
133         IN                              ib_cm_rtu_rec_t*                        p_cm_rtu_rec );\r
134 \r
135 void\r
136 ual_cm_rej_cb(\r
137         IN                              ib_cm_rej_rec_t*                        p_cm_rej_rec );\r
138 \r
139 void\r
140 ual_cm_mra_cb(\r
141         IN                              ib_cm_mra_rec_t*                        p_cm_mra_rec );\r
142 \r
143 void\r
144 ual_cm_lap_cb(\r
145         IN                              ib_cm_lap_rec_t*                        p_cm_lap_rec );\r
146 \r
147 void\r
148 ual_cm_apr_cb(\r
149         IN                              ib_cm_apr_rec_t*                        p_cm_apr_rec );\r
150 \r
151 void\r
152 ual_cm_dreq_cb(\r
153         IN                              ib_cm_dreq_rec_t*                       p_cm_dreq_rec );\r
154 \r
155 void\r
156 ual_cm_drep_cb(\r
157         IN                              ib_cm_drep_rec_t*                       p_cm_drep_rec );\r
158 \r
159 void\r
160 ual_listen_err_cb(\r
161         IN                              ib_listen_err_rec_t                     *p_listen_err_rec );\r
162 \r
163 \r
164 #endif /* __IB_UAL_CM_H__ */\r