__declspec(dllexport)\r
int rdma_listen(struct rdma_cm_id *id, int backlog);\r
\r
+__declspec(dllexport)\r
+int rdma_get_request(struct rdma_cm_id *listen, struct rdma_cm_id **id);\r
+\r
/**\r
* rdma_accept - Called to accept a connection request.\r
* @id: Connection identifier associated with the request.\r
return 0;\r
}\r
\r
+__declspec(dllexport)\r
+int rdma_get_request(struct rdma_cm_id *listen, struct rdma_cm_id **id)\r
+{\r
+ struct cma_id_private *id_priv;\r
+ struct rdma_cm_event *event;\r
+ int ret;\r
+\r
+ id_priv = CONTAINING_RECORD(listen, struct cma_id_private, id);\r
+ if (!id_priv->sync) {\r
+ return rdma_seterrno(EINVAL);\r
+ }\r
+\r
+ if (listen->event) {\r
+ rdma_ack_cm_event(listen->event);\r
+ listen->event = NULL;\r
+ }\r
+\r
+ ret = rdma_get_cm_event(listen->channel, &event);\r
+ if (ret)\r
+ return ret;\r
+\r
+ if (event->status) {\r
+ ret = rdma_seterrno(event->status);\r
+ goto err;\r
+ }\r
+ \r
+ if (event->event != RDMA_CM_EVENT_CONNECT_REQUEST) {\r
+ ret = rdma_seterrno(EINVAL);\r
+ goto err;\r
+ }\r
+\r
+ *id = event->id;\r
+ (*id)->event = event;\r
+ return 0;\r
+\r
+err:\r
+ listen->event = event;\r
+ return ret;\r
+}\r
+\r
__declspec(dllexport)\r
int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)\r
{\r