winverbs/nd: map completion status to ND values
[mirror/winof/.git] / ulp / libibverbs / include / infiniband / verbs.h
index c849d75..780f938 100644 (file)
@@ -37,6 +37,8 @@
 \r
 #include <windows.h>\r
 #include <rdma\winverbs.h>\r
 \r
 #include <windows.h>\r
 #include <rdma\winverbs.h>\r
+#include <errno.h>\r
+#include <comp_channel.h>\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
@@ -51,6 +53,18 @@ typedef unsigned __int16     uint16_t;
 typedef unsigned __int32       uint32_t;\r
 typedef unsigned __int64       uint64_t;\r
 \r
 typedef unsigned __int32       uint32_t;\r
 typedef unsigned __int64       uint64_t;\r
 \r
+#define EOVERFLOW              WV_BUFFER_OVERFLOW\r
+#define EISCONN                        WV_CONNECTION_ACTIVE\r
+#define ECONNREFUSED   WV_CONNECTION_REFUSED\r
+#define ETIMEDOUT              WV_TIMEOUT\r
+#define ENETUNREACH            WV_HOST_UNREACHABLE\r
+#define EADDRINUSE             WV_ADDRESS_ALREADY_EXISTS\r
+#define EALREADY               WV_IO_PENDING\r
+#define EAFNOSUPPORT   WV_INVALID_ADDRESS\r
+#define EWOULDBLOCK            WV_DEVICE_BUSY\r
+\r
+#define ECONNRESET             WSAECONNRESET\r
+\r
 union ibv_gid\r
 {\r
        uint8_t                 raw[16];\r
 union ibv_gid\r
 {\r
        uint8_t                 raw[16];\r
@@ -228,28 +242,29 @@ struct ibv_async_event
 \r
 enum ibv_wc_status\r
 {\r
 \r
 enum ibv_wc_status\r
 {\r
-       IBV_WC_SUCCESS,\r
-       IBV_WC_LOC_LEN_ERR,\r
-       IBV_WC_LOC_QP_OP_ERR,\r
-       IBV_WC_LOC_PROT_ERR,\r
-       IBV_WC_WR_FLUSH_ERR,\r
-       IBV_WC_MW_BIND_ERR,\r
-       IBV_WC_REM_ACCESS_ERR,\r
-       IBV_WC_REM_OP_ERR,\r
-       IBV_WC_RNR_RETRY_EXC_ERR,\r
-       IBV_WC_RESP_TIMEOUT_ERR,\r
-       IBV_WC_REM_INV_REQ_ERR,\r
-       IBV_WC_BAD_RESP_ERR,\r
-       IBV_WC_LOC_ACCESS_ERR,\r
-       IBV_WC_GENERAL_ERR,\r
-       IBV_WC_FATAL_ERR,\r
-       IBV_WC_RETRY_EXC_ERR,\r
-       IBV_WC_REM_ABORT_ERR,\r
-       IBV_WC_LOC_EEC_OP_ERR,\r
-       IBV_WC_LOC_RDD_VIOL_ERR,\r
-       IBV_WC_REM_INV_RD_REQ_ERR,\r
-       IBV_WC_INV_EECN_ERR,\r
-       IBV_WC_INV_EEC_STATE_ERR\r
+       IBV_WC_SUCCESS                          = WvWcSuccess,\r
+       IBV_WC_LOC_LEN_ERR                      = WvWcLocalLengthError,\r
+       IBV_WC_LOC_QP_OP_ERR            = WvWcLocalOpError,\r
+       IBV_WC_LOC_PROT_ERR                     = WvWcLocalProtectionError,\r
+       IBV_WC_WR_FLUSH_ERR                     = WvWcFlushed,\r
+       IBV_WC_MW_BIND_ERR                      = WvWcMwBindError,\r
+       IBV_WC_REM_ACCESS_ERR           = WvWcRemoteAccessError,\r
+       IBV_WC_REM_OP_ERR                       = WvWcRemoteOpError,\r
+       IBV_WC_RNR_RETRY_EXC_ERR        = WvWcRnrRetryError,\r
+       IBV_WC_RESP_TIMEOUT_ERR         = WvWcTimeoutRetryError,\r
+       IBV_WC_REM_INV_REQ_ERR          = WvWcRemoteInvalidRequest,\r
+       IBV_WC_BAD_RESP_ERR                     = WvWcBadResponse,\r
+       IBV_WC_LOC_ACCESS_ERR           = WvWcLocalAccessError,\r
+       IBV_WC_GENERAL_ERR                      = WvWcError,\r
+       IBV_WC_FATAL_ERR                        = WvWcError,\r
+       IBV_WC_RETRY_EXC_ERR            = WvWcError,\r
+       IBV_WC_REM_ABORT_ERR            = WvWcError,\r
+       IBV_WC_LOC_EEC_OP_ERR           = WvWcError,\r
+       IBV_WC_LOC_RDD_VIOL_ERR         = WvWcError,\r
+       IBV_WC_REM_INV_RD_REQ_ERR       = WvWcError,\r
+       IBV_WC_INV_EECN_ERR                     = WvWcError,\r
+       IBV_WC_INV_EEC_STATE_ERR        = WvWcError\r
+\r
 };\r
 \r
 __declspec(dllexport)\r
 };\r
 \r
 __declspec(dllexport)\r
@@ -636,8 +651,8 @@ struct ibv_qp
 \r
 struct ibv_comp_channel\r
 {\r
 \r
 struct ibv_comp_channel\r
 {\r
-       struct ibv_context     *context;\r
-       uint32_t                                timeout;\r
+       struct ibv_context              *context;\r
+       COMP_CHANNEL                    comp_channel;\r
 };\r
 \r
 struct ibv_cq\r
 };\r
 \r
 struct ibv_cq\r
@@ -646,9 +661,10 @@ struct ibv_cq
        struct ibv_comp_channel *channel;\r
        void                                    *cq_context;\r
        IWVCompletionQueue              *handle;\r
        struct ibv_comp_channel *channel;\r
        void                                    *cq_context;\r
        IWVCompletionQueue              *handle;\r
-       OVERLAPPED                              overlap;\r
        int                                             cqe;\r
        int                                             cqe;\r
-       uint32_t                                comp_events_completed;\r
+       COMP_ENTRY                              comp_entry;\r
+       LONG volatile                   notify_cnt;\r
+       LONG volatile                   ack_cnt;\r
 };\r
 \r
 struct ibv_ah\r
 };\r
 \r
 struct ibv_ah\r
@@ -678,7 +694,7 @@ struct ibv_context
 {\r
        struct ibv_device               *device;\r
        IWVDevice                               *cmd_if;\r
 {\r
        struct ibv_device               *device;\r
        IWVDevice                               *cmd_if;\r
-       uint32_t                                timeout;\r
+       COMP_CHANNEL                    channel;\r
 };\r
 \r
 /**\r
 };\r
 \r
 /**\r
@@ -1103,6 +1119,23 @@ const char *ibv_port_state_str(enum ibv_port_state port_state);
 __declspec(dllexport)\r
 const char *ibv_event_type_str(enum ibv_event_type event);\r
 \r
 __declspec(dllexport)\r
 const char *ibv_event_type_str(enum ibv_event_type event);\r
 \r
+/*\r
+ * Windows specific structures and interfaces\r
+ */\r
+struct ibvw_windata\r
+{\r
+       IWVProvider             *prov;\r
+       COMP_MANAGER    *comp_mgr;\r
+};\r
+\r
+#define IBVW_WINDATA_VERSION 1\r
+\r
+__declspec(dllexport)\r
+int ibvw_get_windata(struct ibvw_windata *windata, int version);\r
+\r
+__declspec(dllexport)\r
+void ibvw_release_windata(struct ibvw_windata *windata, int version);\r
+\r
 #ifdef __cplusplus\r
 }\r
 #endif\r
 #ifdef __cplusplus\r
 }\r
 #endif\r