| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (c) 2005 Topspin Communications.  All rights reserved. | 
| Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 3 | * Copyright (c) 2005 Intel Corporation.  All rights reserved. | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 4 | * | 
|  | 5 | * This software is available to you under a choice of one of two | 
|  | 6 | * licenses.  You may choose to be licensed under the terms of the GNU | 
|  | 7 | * General Public License (GPL) Version 2, available from the file | 
|  | 8 | * COPYING in the main directory of this source tree, or the | 
|  | 9 | * OpenIB.org BSD license below: | 
|  | 10 | * | 
|  | 11 | *     Redistribution and use in source and binary forms, with or | 
|  | 12 | *     without modification, are permitted provided that the following | 
|  | 13 | *     conditions are met: | 
|  | 14 | * | 
|  | 15 | *      - Redistributions of source code must retain the above | 
|  | 16 | *        copyright notice, this list of conditions and the following | 
|  | 17 | *        disclaimer. | 
|  | 18 | * | 
|  | 19 | *      - Redistributions in binary form must reproduce the above | 
|  | 20 | *        copyright notice, this list of conditions and the following | 
|  | 21 | *        disclaimer in the documentation and/or other materials | 
|  | 22 | *        provided with the distribution. | 
|  | 23 | * | 
|  | 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | 
|  | 25 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | 
|  | 26 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | 
|  | 27 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | 
|  | 28 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | 
|  | 29 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | 
|  | 30 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 
|  | 31 | * SOFTWARE. | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 32 | */ | 
|  | 33 |  | 
|  | 34 | #ifndef IB_USER_CM_H | 
|  | 35 | #define IB_USER_CM_H | 
|  | 36 |  | 
| Sean Hefty | 6a9af2e | 2006-06-17 20:37:27 -0700 | [diff] [blame] | 37 | #include <rdma/ib_user_sa.h> | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 38 |  | 
| Sean Hefty | e1444b5 | 2006-11-28 14:57:13 -0800 | [diff] [blame] | 39 | #define IB_USER_CM_ABI_VERSION 5 | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 40 |  | 
|  | 41 | enum { | 
|  | 42 | IB_USER_CM_CMD_CREATE_ID, | 
|  | 43 | IB_USER_CM_CMD_DESTROY_ID, | 
|  | 44 | IB_USER_CM_CMD_ATTR_ID, | 
|  | 45 |  | 
|  | 46 | IB_USER_CM_CMD_LISTEN, | 
| Sean Hefty | e1444b5 | 2006-11-28 14:57:13 -0800 | [diff] [blame] | 47 | IB_USER_CM_CMD_NOTIFY, | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 48 |  | 
|  | 49 | IB_USER_CM_CMD_SEND_REQ, | 
|  | 50 | IB_USER_CM_CMD_SEND_REP, | 
|  | 51 | IB_USER_CM_CMD_SEND_RTU, | 
|  | 52 | IB_USER_CM_CMD_SEND_DREQ, | 
|  | 53 | IB_USER_CM_CMD_SEND_DREP, | 
|  | 54 | IB_USER_CM_CMD_SEND_REJ, | 
|  | 55 | IB_USER_CM_CMD_SEND_MRA, | 
|  | 56 | IB_USER_CM_CMD_SEND_LAP, | 
|  | 57 | IB_USER_CM_CMD_SEND_APR, | 
|  | 58 | IB_USER_CM_CMD_SEND_SIDR_REQ, | 
|  | 59 | IB_USER_CM_CMD_SEND_SIDR_REP, | 
|  | 60 |  | 
|  | 61 | IB_USER_CM_CMD_EVENT, | 
| Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 62 | IB_USER_CM_CMD_INIT_QP_ATTR, | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 63 | }; | 
|  | 64 | /* | 
|  | 65 | * command ABI structures. | 
|  | 66 | */ | 
|  | 67 | struct ib_ucm_cmd_hdr { | 
|  | 68 | __u32 cmd; | 
|  | 69 | __u16 in; | 
|  | 70 | __u16 out; | 
|  | 71 | }; | 
|  | 72 |  | 
|  | 73 | struct ib_ucm_create_id { | 
| Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 74 | __u64 uid; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 75 | __u64 response; | 
|  | 76 | }; | 
|  | 77 |  | 
|  | 78 | struct ib_ucm_create_id_resp { | 
|  | 79 | __u32 id; | 
|  | 80 | }; | 
|  | 81 |  | 
|  | 82 | struct ib_ucm_destroy_id { | 
| Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 83 | __u64 response; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 84 | __u32 id; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 85 | __u32 reserved; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 86 | }; | 
|  | 87 |  | 
| Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 88 | struct ib_ucm_destroy_id_resp { | 
|  | 89 | __u32 events_reported; | 
|  | 90 | }; | 
|  | 91 |  | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 92 | struct ib_ucm_attr_id { | 
|  | 93 | __u64 response; | 
|  | 94 | __u32 id; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 95 | __u32 reserved; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 96 | }; | 
|  | 97 |  | 
|  | 98 | struct ib_ucm_attr_id_resp { | 
| Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 99 | __be64 service_id; | 
|  | 100 | __be64 service_mask; | 
|  | 101 | __be32 local_id; | 
|  | 102 | __be32 remote_id; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 103 | }; | 
|  | 104 |  | 
| Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 105 | struct ib_ucm_init_qp_attr { | 
|  | 106 | __u64 response; | 
|  | 107 | __u32 id; | 
|  | 108 | __u32 qp_state; | 
|  | 109 | }; | 
|  | 110 |  | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 111 | struct ib_ucm_listen { | 
| Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 112 | __be64 service_id; | 
|  | 113 | __be64 service_mask; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 114 | __u32 id; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 115 | __u32 reserved; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 116 | }; | 
|  | 117 |  | 
| Sean Hefty | e1444b5 | 2006-11-28 14:57:13 -0800 | [diff] [blame] | 118 | struct ib_ucm_notify { | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 119 | __u32 id; | 
| Sean Hefty | e1444b5 | 2006-11-28 14:57:13 -0800 | [diff] [blame] | 120 | __u32 event; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 121 | }; | 
|  | 122 |  | 
|  | 123 | struct ib_ucm_private_data { | 
|  | 124 | __u64 data; | 
|  | 125 | __u32 id; | 
|  | 126 | __u8  len; | 
|  | 127 | __u8  reserved[3]; | 
|  | 128 | }; | 
|  | 129 |  | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 130 | struct ib_ucm_req { | 
|  | 131 | __u32 id; | 
|  | 132 | __u32 qpn; | 
|  | 133 | __u32 qp_type; | 
|  | 134 | __u32 psn; | 
| Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 135 | __be64 sid; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 136 | __u64 data; | 
|  | 137 | __u64 primary_path; | 
|  | 138 | __u64 alternate_path; | 
|  | 139 | __u8  len; | 
|  | 140 | __u8  peer_to_peer; | 
|  | 141 | __u8  responder_resources; | 
|  | 142 | __u8  initiator_depth; | 
|  | 143 | __u8  remote_cm_response_timeout; | 
|  | 144 | __u8  flow_control; | 
|  | 145 | __u8  local_cm_response_timeout; | 
|  | 146 | __u8  retry_count; | 
|  | 147 | __u8  rnr_retry_count; | 
|  | 148 | __u8  max_cm_retries; | 
|  | 149 | __u8  srq; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 150 | __u8  reserved[5]; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 151 | }; | 
|  | 152 |  | 
|  | 153 | struct ib_ucm_rep { | 
| Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 154 | __u64 uid; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 155 | __u64 data; | 
|  | 156 | __u32 id; | 
|  | 157 | __u32 qpn; | 
|  | 158 | __u32 psn; | 
|  | 159 | __u8  len; | 
|  | 160 | __u8  responder_resources; | 
|  | 161 | __u8  initiator_depth; | 
|  | 162 | __u8  target_ack_delay; | 
|  | 163 | __u8  failover_accepted; | 
|  | 164 | __u8  flow_control; | 
|  | 165 | __u8  rnr_retry_count; | 
|  | 166 | __u8  srq; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 167 | __u8  reserved[4]; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 168 | }; | 
|  | 169 |  | 
|  | 170 | struct ib_ucm_info { | 
|  | 171 | __u32 id; | 
|  | 172 | __u32 status; | 
|  | 173 | __u64 info; | 
|  | 174 | __u64 data; | 
|  | 175 | __u8  info_len; | 
|  | 176 | __u8  data_len; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 177 | __u8  reserved[6]; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 178 | }; | 
|  | 179 |  | 
|  | 180 | struct ib_ucm_mra { | 
|  | 181 | __u64 data; | 
|  | 182 | __u32 id; | 
|  | 183 | __u8  len; | 
|  | 184 | __u8  timeout; | 
|  | 185 | __u8  reserved[2]; | 
|  | 186 | }; | 
|  | 187 |  | 
|  | 188 | struct ib_ucm_lap { | 
|  | 189 | __u64 path; | 
|  | 190 | __u64 data; | 
|  | 191 | __u32 id; | 
|  | 192 | __u8  len; | 
|  | 193 | __u8  reserved[3]; | 
|  | 194 | }; | 
|  | 195 |  | 
|  | 196 | struct ib_ucm_sidr_req { | 
|  | 197 | __u32 id; | 
|  | 198 | __u32 timeout; | 
| Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 199 | __be64 sid; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 200 | __u64 data; | 
|  | 201 | __u64 path; | 
| Sean Hefty | 75af908 | 2006-06-17 20:37:39 -0700 | [diff] [blame] | 202 | __u16 reserved_pkey; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 203 | __u8  len; | 
|  | 204 | __u8  max_cm_retries; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 205 | __u8  reserved[4]; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 206 | }; | 
|  | 207 |  | 
|  | 208 | struct ib_ucm_sidr_rep { | 
|  | 209 | __u32 id; | 
|  | 210 | __u32 qpn; | 
|  | 211 | __u32 qkey; | 
|  | 212 | __u32 status; | 
|  | 213 | __u64 info; | 
|  | 214 | __u64 data; | 
|  | 215 | __u8  info_len; | 
|  | 216 | __u8  data_len; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 217 | __u8  reserved[6]; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 218 | }; | 
|  | 219 | /* | 
|  | 220 | * event notification ABI structures. | 
|  | 221 | */ | 
|  | 222 | struct ib_ucm_event_get { | 
|  | 223 | __u64 response; | 
|  | 224 | __u64 data; | 
|  | 225 | __u64 info; | 
|  | 226 | __u8  data_len; | 
|  | 227 | __u8  info_len; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 228 | __u8  reserved[6]; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 229 | }; | 
|  | 230 |  | 
|  | 231 | struct ib_ucm_req_event_resp { | 
| Sean Hefty | 6a9af2e | 2006-06-17 20:37:27 -0700 | [diff] [blame] | 232 | struct ib_user_path_rec primary_path; | 
|  | 233 | struct ib_user_path_rec alternate_path; | 
| Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 234 | __be64                 remote_ca_guid; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 235 | __u32                  remote_qkey; | 
|  | 236 | __u32                  remote_qpn; | 
|  | 237 | __u32                  qp_type; | 
|  | 238 | __u32                  starting_psn; | 
|  | 239 | __u8  responder_resources; | 
|  | 240 | __u8  initiator_depth; | 
|  | 241 | __u8  local_cm_response_timeout; | 
|  | 242 | __u8  flow_control; | 
|  | 243 | __u8  remote_cm_response_timeout; | 
|  | 244 | __u8  retry_count; | 
|  | 245 | __u8  rnr_retry_count; | 
|  | 246 | __u8  srq; | 
| Sean Hefty | 07d357d | 2005-10-17 15:37:43 -0700 | [diff] [blame] | 247 | __u8  port; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 248 | __u8  reserved[7]; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 249 | }; | 
|  | 250 |  | 
|  | 251 | struct ib_ucm_rep_event_resp { | 
| Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 252 | __be64 remote_ca_guid; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 253 | __u32 remote_qkey; | 
|  | 254 | __u32 remote_qpn; | 
|  | 255 | __u32 starting_psn; | 
|  | 256 | __u8  responder_resources; | 
|  | 257 | __u8  initiator_depth; | 
|  | 258 | __u8  target_ack_delay; | 
|  | 259 | __u8  failover_accepted; | 
|  | 260 | __u8  flow_control; | 
|  | 261 | __u8  rnr_retry_count; | 
|  | 262 | __u8  srq; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 263 | __u8  reserved[5]; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 264 | }; | 
|  | 265 |  | 
|  | 266 | struct ib_ucm_rej_event_resp { | 
|  | 267 | __u32 reason; | 
|  | 268 | /* ari in ib_ucm_event_get info field. */ | 
|  | 269 | }; | 
|  | 270 |  | 
|  | 271 | struct ib_ucm_mra_event_resp { | 
|  | 272 | __u8  timeout; | 
|  | 273 | __u8  reserved[3]; | 
|  | 274 | }; | 
|  | 275 |  | 
|  | 276 | struct ib_ucm_lap_event_resp { | 
| Sean Hefty | 6a9af2e | 2006-06-17 20:37:27 -0700 | [diff] [blame] | 277 | struct ib_user_path_rec path; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 278 | }; | 
|  | 279 |  | 
|  | 280 | struct ib_ucm_apr_event_resp { | 
|  | 281 | __u32 status; | 
|  | 282 | /* apr info in ib_ucm_event_get info field. */ | 
|  | 283 | }; | 
|  | 284 |  | 
|  | 285 | struct ib_ucm_sidr_req_event_resp { | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 286 | __u16 pkey; | 
| Sean Hefty | 07d357d | 2005-10-17 15:37:43 -0700 | [diff] [blame] | 287 | __u8  port; | 
|  | 288 | __u8  reserved; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 289 | }; | 
|  | 290 |  | 
|  | 291 | struct ib_ucm_sidr_rep_event_resp { | 
|  | 292 | __u32 status; | 
|  | 293 | __u32 qkey; | 
|  | 294 | __u32 qpn; | 
|  | 295 | /* info in ib_ucm_event_get info field. */ | 
|  | 296 | }; | 
|  | 297 |  | 
|  | 298 | #define IB_UCM_PRES_DATA      0x01 | 
|  | 299 | #define IB_UCM_PRES_INFO      0x02 | 
|  | 300 | #define IB_UCM_PRES_PRIMARY   0x04 | 
|  | 301 | #define IB_UCM_PRES_ALTERNATE 0x08 | 
|  | 302 |  | 
|  | 303 | struct ib_ucm_event_resp { | 
| Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 304 | __u64 uid; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 305 | __u32 id; | 
|  | 306 | __u32 event; | 
|  | 307 | __u32 present; | 
| Sean Hefty | 7b28b0d | 2005-11-01 13:18:54 -0800 | [diff] [blame] | 308 | __u32 reserved; | 
| Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 309 | union { | 
|  | 310 | struct ib_ucm_req_event_resp req_resp; | 
|  | 311 | struct ib_ucm_rep_event_resp rep_resp; | 
|  | 312 | struct ib_ucm_rej_event_resp rej_resp; | 
|  | 313 | struct ib_ucm_mra_event_resp mra_resp; | 
|  | 314 | struct ib_ucm_lap_event_resp lap_resp; | 
|  | 315 | struct ib_ucm_apr_event_resp apr_resp; | 
|  | 316 |  | 
|  | 317 | struct ib_ucm_sidr_req_event_resp sidr_req_resp; | 
|  | 318 | struct ib_ucm_sidr_rep_event_resp sidr_rep_resp; | 
|  | 319 |  | 
|  | 320 | __u32                             send_status; | 
|  | 321 | } u; | 
|  | 322 | }; | 
|  | 323 |  | 
|  | 324 | #endif /* IB_USER_CM_H */ |