[IBAL] revert two previous patches
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 13 Jul 2008 11:08:58 +0000 (11:08 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 13 Jul 2008 11:08:58 +0000 (11:08 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1388 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

25 files changed:
core/al/al_mad_pool.h
core/al/al_proxy_ioctl.h
core/al/kernel/al_ndi_cm.c
core/al/kernel/al_proxy.c
core/al/kernel/al_proxy_cep.c
core/al/kernel/al_proxy_ndi.c
core/al/kernel/al_proxy_subnet.c
core/al/kernel/al_proxy_verbs.c
core/al/kernel/al_smi.c
core/al/kernel/al_smi.h
core/al/user/ual_ca.c
core/al/user/ual_cm_cep.c
core/al/user/ual_cq.c
core/al/user/ual_mad.c
core/al/user/ual_mcast.c
core/al/user/ual_mgr.c
core/al/user/ual_mr.c
core/al/user/ual_mw.c
core/al/user/ual_pd.c
core/al/user/ual_pnp.c
core/al/user/ual_qp.c
core/al/user/ual_sa_req.c
core/al/user/ual_srq.c
inc/iba/ib_al_ioctl.h
inc/iba/ib_types.h

index cc08888..6acac50 100644 (file)
@@ -139,7 +139,7 @@ typedef struct _al_mad_element
        uint8_t                                 mad_buf[MAD_BLOCK_GRH_SIZE];\r
 #endif\r
 \r
-       uint64_t                                h_proxy_element; /* For user-mode support */\r
+       TO_LONG_PTR(ib_mad_element_t*, h_proxy_element) ; /* For user-mode support */\r
 \r
 }      al_mad_element_t;\r
 \r
index 07b27b4..4434cb3 100644 (file)
@@ -87,10 +87,10 @@ typedef union _misc_cb_ioctl_rec
        /* Multicast record */\r
        struct _mcast_cb_ioctl_rec\r
        {\r
-               uint64_t                                        mcast_context;\r
+               TO_LONG_PTR(const void* ,                       mcast_context) ;\r
                ib_api_status_t                         status;\r
                ib_net16_t                                      error_status;\r
-               uint64_t                                        h_mcast;\r
+TO_LONG_PTR(           ib_mcast_handle_t ,                     h_mcast) ; \r
                ib_member_rec_t                         member_rec;\r
 \r
        }       mcast_cb_ioctl_rec;\r
@@ -99,9 +99,9 @@ typedef union _misc_cb_ioctl_rec
        /* Mad send */\r
        struct _mad_send_cb_ioctl_rec\r
        {\r
-               uint64_t                                        p_um_mad;\r
+               TO_LONG_PTR(ib_mad_element_t* , p_um_mad) ;\r
                ib_wc_status_t                          wc_status;\r
-               uint64_t                                        mad_svc_context;\r
+               TO_LONG_PTR(void* ,                             mad_svc_context) ;\r
 \r
        }       mad_send_cb_ioctl_rec;\r
 \r
@@ -111,8 +111,8 @@ typedef union _misc_cb_ioctl_rec
        {\r
                uint64_t                                        h_mad;\r
                uint32_t                                        elem_size;\r
-               uint64_t                                        mad_svc_context;\r
-               uint64_t                                        p_send_mad;\r
+               TO_LONG_PTR(void* ,                             mad_svc_context) ;\r
+               TO_LONG_PTR(ib_mad_element_t* , p_send_mad) ;\r
 \r
        }       mad_recv_cb_ioctl_rec;\r
 \r
@@ -143,7 +143,7 @@ typedef union _misc_cb_ioctl_rec
 \r
 typedef struct _comp_cb_ioctl_info\r
 {\r
-       uint64_t                                                cq_context;\r
+       TO_LONG_PTR(void* ,                                     cq_context) ;\r
 \r
 }      comp_cb_ioctl_info_t;\r
 \r
index 6f9d7a7..36442b9 100644 (file)
@@ -643,7 +643,7 @@ __ndi_proc_dreq(
 static void\r
 __ndi_proc_rej(\r
        IN                              ib_qp_handle_t const            h_qp,\r
-       IN              const   mad_cm_rej_t* const                     p_rej )\r
+       IN              const   mad_cm_rej_t* const             p_rej )\r
 {\r
        KIRQL irql;\r
        IRP* p_irp;\r
@@ -1158,7 +1158,7 @@ exit:
        if( p_query_rec->p_result_mad )\r
                ib_put_mad( p_query_rec->p_result_mad );\r
 \r
-       deref_al_obj( &h_qp->obj );     /* release path query reference */\r
+       deref_al_obj( &h_qp->obj );     /* release path query reference */\r
        AL_EXIT( AL_DBG_NDI );\r
 }\r
 \r
@@ -1208,7 +1208,7 @@ __ndi_pr_query(
        {\r
                h_qp->p_irp_queue->state = NDI_CM_IDLE;\r
                AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("ib_query failed (%d)\n", status) );\r
-               deref_al_obj( &h_qp->obj );     /* release path query reference */\r
+               deref_al_obj( &h_qp->obj );     /* release path query reference */\r
                return ib_to_ntstatus( status );\r
        }\r
 \r
@@ -1437,7 +1437,7 @@ exit:
 static void\r
 __ndi_fill_cm_rep(\r
        IN              ib_qp_handle_t  const                           h_qp,\r
-       IN              ual_ndi_rep_cm_ioctl_in_t                       *p_rep,\r
+       IN              ual_ndi_rep_cm_ioctl_in_t                       *p_rep,\r
                OUT     ib_cm_rep_t                                                     *p_cm_rep)\r
 {\r
        AL_ENTER( AL_DBG_NDI );\r
@@ -1677,3 +1677,5 @@ ndi_dreq_cm(
        return status;\r
 }\r
 \r
+\r
+\r
index e8a471e..12809bb 100644 (file)
@@ -776,7 +776,7 @@ __proxy_pnp_cb(
                break;\r
        }\r
 \r
-       p_evt_rec->pnp.h_pnp_padding = p_pnp_rec->h_pnp->obj.hdl;\r
+       p_evt_rec->pnp.h_pnp = (ib_pnp_handle_t)HDL_TO_PTR(p_pnp_rec->h_pnp->obj.hdl);\r
        p_pnp_rec->h_pnp->obj.hdl_valid = TRUE;\r
 \r
        hdl =\r
@@ -912,8 +912,8 @@ proxy_reg_pnp(
        pnp_req.pnp_context = p_open_context;\r
        pnp_req.pfn_pnp_cb = __proxy_pnp_cb;\r
 \r
-       p_user_status = (ib_api_status_t*)(ULONG_PTR)p_ioctl->p_status;\r
-       p_user_hdl = (uint64_t*)(ULONG_PTR)p_ioctl->p_hdl;\r
+       p_user_status = p_ioctl->p_status;\r
+       p_user_hdl = p_ioctl->p_hdl;\r
 \r
        if( pnp_get_flag( p_ioctl->pnp_class ) & IB_PNP_FLAG_REG_SYNC )\r
        {\r
@@ -1087,7 +1087,7 @@ proxy_rearm_pnp(
                p_context->h_al, p_ioctl->last_evt_hdl, AL_OBJ_TYPE_H_PNP_EVENT );\r
        if( p_evt )\r
        {\r
-               p_evt->evt_context = (void*)(ULONG_PTR)p_ioctl->last_evt_context;\r
+               p_evt->evt_context = p_ioctl->last_evt_context;\r
                p_evt->evt_status = p_ioctl->last_evt_status;\r
                cl_event_signal( &p_evt->event );\r
        }\r
index 2ff44f0..8afbf30 100644 (file)
@@ -206,7 +206,7 @@ proxy_cep_pre_req(
 \r
        /* Get the kernel QP handle. */\r
        h_qp = (ib_qp_handle_t)al_hdl_ref(\r
-               p_context->h_al, p_ioctl->in.cm_req.h_qp_padding, AL_OBJ_TYPE_H_QP );\r
+               p_context->h_al, (uint64_t)p_ioctl->in.cm_req.h_qp, AL_OBJ_TYPE_H_QP );\r
        if( !h_qp )\r
        {\r
                p_ioctl->out.status = IB_INVALID_QP_HANDLE;\r
@@ -292,7 +292,7 @@ proxy_cep_pre_rep(
 \r
        /* Get the kernel QP handle. */\r
        h_qp = (ib_qp_handle_t)al_hdl_ref(\r
-               p_context->h_al, p_ioctl->in.cm_rep.h_qp_padding, AL_OBJ_TYPE_H_QP );\r
+               p_context->h_al, (uint64_t)p_ioctl->in.cm_rep.h_qp, AL_OBJ_TYPE_H_QP );\r
        if( !h_qp )\r
        {\r
                p_ioctl->out.status = IB_INVALID_QP_HANDLE;\r
@@ -303,8 +303,7 @@ proxy_cep_pre_rep(
 \r
        cid = AL_INVALID_CID;\r
        p_ioctl->out.status = al_cep_pre_rep( p_context->h_al, p_ioctl->in.cid,\r
-               (void*)(ULONG_PTR)p_ioctl->in.context, NULL, &p_ioctl->in.cm_rep,\r
-               &cid, &p_ioctl->out.init );\r
+               p_ioctl->in.context, NULL, &p_ioctl->in.cm_rep, &cid, &p_ioctl->out.init );\r
 \r
        deref_al_obj( &h_qp->obj );\r
 \r
@@ -553,7 +552,7 @@ proxy_cep_lap(
 \r
        /* Get the kernel QP handle. */\r
        h_qp = (ib_qp_handle_t)al_hdl_ref(\r
-               p_context->h_al, p_ioctl->cm_lap.h_qp_padding, AL_OBJ_TYPE_H_QP );\r
+               p_context->h_al, (uint64_t)p_ioctl->cm_lap.h_qp, AL_OBJ_TYPE_H_QP );\r
        if( !h_qp )\r
        {\r
                status = IB_INVALID_QP_HANDLE;\r
@@ -606,7 +605,7 @@ proxy_cep_pre_apr(
 \r
        /* Get the kernel QP handle. */\r
        h_qp = (ib_qp_handle_t)al_hdl_ref(\r
-               p_context->h_al, p_ioctl->in.cm_apr.h_qp_padding, AL_OBJ_TYPE_H_QP );\r
+               p_context->h_al, (uint64_t)p_ioctl->in.cm_apr.h_qp, AL_OBJ_TYPE_H_QP );\r
        if( !h_qp )\r
        {\r
                p_ioctl->out.status = IB_INVALID_QP_HANDLE;\r
@@ -787,8 +786,7 @@ proxy_cep_poll(
        *p_ret_bytes = sizeof(ual_cep_poll_ioctl_t);\r
 \r
        p_ioctl->status = al_cep_poll( p_context->h_al,\r
-               *(net32_t*)cl_ioctl_in_buf( h_ioctl ),\r
-               &(void*)(ULONG_PTR)p_ioctl->context,\r
+               *(net32_t*)cl_ioctl_in_buf( h_ioctl ), &p_ioctl->context,\r
                &p_ioctl->new_cid, &p_mad );\r
 \r
        if( p_ioctl->status == IB_SUCCESS )\r
index 382e829..4a94740 100644 (file)
@@ -111,8 +111,8 @@ __ndi_create_cq(
        if( status != IB_SUCCESS )\r
                goto proxy_create_cq_err2;\r
 \r
-       status = create_cq( h_ca, &cq_create,\r
-               (void*)(ULONG_PTR)p_ioctl->in.context, pfn_ev, &h_cq, p_umv_buf );\r
+       status = create_cq( h_ca, &cq_create, p_ioctl->in.context,\r
+               pfn_ev, &h_cq, p_umv_buf );\r
 \r
        if( status != IB_SUCCESS )\r
                goto proxy_create_cq_err2;\r
index 8e5b74e..3c05a35 100644 (file)
@@ -247,8 +247,8 @@ proxy_send_sa_req(
        CL_ASSERT( p_ioctl );\r
 \r
        /* Must save user's pointers in case req completes before call returns. */\r
-       p_usr_status = (ib_api_status_t*)(ULONG_PTR)p_ioctl->in.p_status;\r
-       p_usr_hdl = (uint64_t*)(ULONG_PTR)p_ioctl->in.ph_sa_req;\r
+       p_usr_status = p_ioctl->in.p_status;\r
+       p_usr_hdl = p_ioctl->in.ph_sa_req;\r
 \r
        if( p_ioctl->in.sa_req.attr_size > IB_SA_DATA_SIZE )\r
        {\r
@@ -445,8 +445,7 @@ proxy_send_mad(
 \r
        /* Now copy the mad element with all info */\r
        status = ib_convert_cl_status( cl_copy_from_user( p_mad_el,\r
-               (void*)(ULONG_PTR)p_ioctl->in.p_mad_element,\r
-               sizeof(ib_mad_element_t) ) );\r
+               p_ioctl->in.p_mad_element, sizeof(ib_mad_element_t) ) );\r
        if( status != IB_SUCCESS )\r
                goto proxy_send_mad_err2;\r
 \r
@@ -464,7 +463,7 @@ proxy_send_mad(
         * MAD receive completion could fail to be delivered to the app even though\r
         * the response was properly received in the kernel.\r
         */\r
-       p_mad_el->context1 = (void*)(ULONG_PTR)p_ioctl->in.p_mad_element;\r
+       p_mad_el->context1 = p_ioctl->in.p_mad_element;\r
 \r
        /* Set the kernel AV handle. This is either NULL or a valid KM handle. */\r
        p_mad_el->h_av = h_av;\r
@@ -486,8 +485,7 @@ proxy_send_mad(
 \r
        /* Copy the handle to UM to allow cancelling. */\r
        status = ib_convert_cl_status( cl_copy_to_user(\r
-               (void*)(ULONG_PTR)p_ioctl->in.ph_proxy,\r
-               &p_mad_el, sizeof(ib_mad_element_t*) ) );\r
+               p_ioctl->in.ph_proxy, p_mad_el, sizeof(ib_mad_element_t*) ) );\r
        if( status != IB_SUCCESS )\r
                goto proxy_send_mad_err2;\r
 \r
@@ -565,8 +563,7 @@ proxy_mad_comp(
         * for correcting all pointers.\r
         */\r
        status = ib_convert_cl_status( cl_copy_to_user(\r
-               (void*)(ULONG_PTR)p_ioctl->in.p_user_mad,\r
-               p_mad, sizeof(ib_mad_element_t) ) );\r
+               p_ioctl->in.p_user_mad, p_mad, sizeof(ib_mad_element_t) ) );\r
        if( status != IB_SUCCESS )\r
        {\r
                AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
@@ -576,7 +573,7 @@ proxy_mad_comp(
 \r
        /* Copy the MAD buffer. */\r
        status = ib_convert_cl_status( cl_copy_to_user(\r
-               (void*)(ULONG_PTR)p_ioctl->in.p_mad_buf, p_mad->p_mad_buf, p_mad->size ) );\r
+               p_ioctl->in.p_mad_buf, p_mad->p_mad_buf, p_mad->size ) );\r
        if( status != IB_SUCCESS )\r
        {\r
                AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
@@ -588,7 +585,7 @@ proxy_mad_comp(
        if( p_mad->grh_valid )\r
        {\r
                status = ib_convert_cl_status( cl_copy_to_user(\r
-                       (void*)(ULONG_PTR)p_ioctl->in.p_grh, p_mad->p_grh, sizeof(ib_grh_t) ) );\r
+                       p_ioctl->in.p_grh, p_mad->p_grh, sizeof(ib_grh_t) ) );\r
                if( status != IB_SUCCESS )\r
                {\r
                        AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
@@ -662,7 +659,7 @@ __proxy_mad_send_cb(
                cb_info.ioctl_rec.mad_send_cb_ioctl_rec.p_um_mad =\r
                        p_al_el->h_proxy_element;\r
                cb_info.ioctl_rec.mad_send_cb_ioctl_rec.mad_svc_context =\r
-                       (ULONG_PTR)mad_svc_context;\r
+                       mad_svc_context;\r
 \r
                /* Queue this mad completion notification for the user. */\r
                proxy_queue_cb_buf( UAL_GET_MISC_CB_INFO, p_context, &cb_info,\r
@@ -697,10 +694,10 @@ __proxy_mad_recv_cb(
 \r
        /* Set up context and callback record type appropriate for UAL */\r
        cb_info.rec_type = MAD_RECV_REC;\r
-       cb_info.ioctl_rec.mad_recv_cb_ioctl_rec.mad_svc_context = (ULONG_PTR)mad_svc_context;\r
+       cb_info.ioctl_rec.mad_recv_cb_ioctl_rec.mad_svc_context = mad_svc_context;\r
        cb_info.ioctl_rec.mad_recv_cb_ioctl_rec.elem_size = p_mad_element->size;\r
        cb_info.ioctl_rec.mad_recv_cb_ioctl_rec.p_send_mad =\r
-               (ULONG_PTR)p_mad_element->send_context1;\r
+               (ib_mad_element_t*)p_mad_element->send_context1;\r
 \r
        /*\r
         * If we're already closing the device - do not queue a callback, since\r
@@ -1018,8 +1015,8 @@ proxy_cancel_mad(
                return CL_SUCCESS;\r
        }\r
 \r
-       p_ioctl->out.status = ib_cancel_mad( h_mad_svc,\r
-               (ib_mad_element_t*)(ULONG_PTR)p_ioctl->in.h_proxy_element );\r
+       p_ioctl->out.status =\r
+               ib_cancel_mad( h_mad_svc, p_ioctl->in.h_proxy_element );\r
 \r
        /*\r
         * The clean up of resources allocated for the sent mad will\r
index 5b052e0..52a8cf5 100644 (file)
@@ -350,7 +350,7 @@ proxy_ca_err_cb(
        cb_info.rec_type = CA_ERROR_REC;\r
        /* Return the Proxy's open_ca handle and the user's context */\r
        cb_info.ioctl_rec.event_rec = *p_err_rec;\r
-       cb_info.ioctl_rec.event_rec.handle.h_ca_padding = h_ca->obj.hdl;\r
+       cb_info.ioctl_rec.event_rec.handle.h_ca = (ib_ca_handle_t)HDL_TO_PTR(h_ca->obj.hdl);\r
 \r
        /* The proxy handle must be valid now. */\r
        if( !h_ca->obj.hdl_valid )\r
@@ -401,7 +401,7 @@ proxy_open_ca(
                goto proxy_open_ca_err;\r
 \r
        status = open_ca( p_context->h_al, p_ioctl->in.guid, proxy_ca_err_cb,\r
-               (void*)(ULONG_PTR)p_ioctl->in.context, &h_ca, p_umv_buf );\r
+               p_ioctl->in.context, &h_ca, p_umv_buf );\r
        if( status != IB_SUCCESS )\r
                goto proxy_open_ca_err;\r
 \r
@@ -502,16 +502,14 @@ proxy_query_ca(
        {\r
                __try\r
                {\r
-                       ProbeForWrite( (void*)(ULONG_PTR)p_ioctl->in.p_ca_attr,\r
-                               byte_cnt, sizeof(void*) );\r
-                       ib_copy_ca_attr( (void*)(ULONG_PTR)p_ioctl->in.p_ca_attr,\r
-                               p_ca_attr );\r
+                       ProbeForWrite( p_ioctl->in.p_ca_attr, byte_cnt, sizeof(void*) );\r
+                       ib_copy_ca_attr( p_ioctl->in.p_ca_attr, p_ca_attr );\r
                }\r
                __except(EXCEPTION_EXECUTE_HANDLER)\r
                {\r
                        AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("Failed to copy CA attributes to user buffer %016I64x\n",\r
-                               p_ioctl->in.p_ca_attr) );\r
+                               (LONG64)p_ioctl->in.p_ca_attr) );\r
                        status = IB_INVALID_PERMISSION;\r
                }\r
        }\r
@@ -879,8 +877,8 @@ proxy_alloc_pd(
        if( status != IB_SUCCESS )\r
                goto proxy_alloc_pd_err;\r
 \r
-       status = alloc_pd( h_ca, p_ioctl->in.type,\r
-               (void*)(ULONG_PTR)p_ioctl->in.context, &h_pd, p_umv_buf );\r
+       status = alloc_pd( h_ca, p_ioctl->in.type, p_ioctl->in.context,\r
+               &h_pd, p_umv_buf );\r
 \r
        if( status != IB_SUCCESS )\r
                goto proxy_alloc_pd_err;\r
@@ -987,7 +985,7 @@ proxy_srq_err_cb(
        cb_info.rec_type = SRQ_ERROR_REC;\r
        /* Return the Proxy's SRQ handle and the user's context */\r
        cb_info.ioctl_rec.event_rec = *p_err_rec;\r
-       cb_info.ioctl_rec.event_rec.handle.h_srq_padding = h_srq->obj.hdl;\r
+       cb_info.ioctl_rec.event_rec.handle.h_srq = (ib_srq_handle_t) HDL_TO_PTR(h_srq->obj.hdl);\r
 \r
        /* The proxy handle must be valid now. */\r
        if( !h_srq->obj.hdl_valid )\r
@@ -1051,8 +1049,8 @@ proxy_create_srq(
        else\r
                pfn_ev = NULL;\r
 \r
-       status = create_srq( h_pd, &p_ioctl->in.srq_attr,\r
-               (void*)(ULONG_PTR)p_ioctl->in.context, pfn_ev, &h_srq, p_umv_buf );\r
+       status = create_srq( h_pd, &p_ioctl->in.srq_attr, p_ioctl->in.context,\r
+               pfn_ev, &h_srq, p_umv_buf );\r
        if( status != IB_SUCCESS )\r
                goto proxy_create_srq_err1;\r
 \r
@@ -1291,7 +1289,7 @@ proxy_qp_err_cb(
        cb_info.rec_type = QP_ERROR_REC;\r
        /* Return the Proxy's QP handle and the user's context */\r
        cb_info.ioctl_rec.event_rec = *p_err_rec;\r
-       cb_info.ioctl_rec.event_rec.handle.h_qp_padding = h_qp->obj.hdl;\r
+       cb_info.ioctl_rec.event_rec.handle.h_qp = (ib_qp_handle_t)HDL_TO_PTR(h_qp->obj.hdl);\r
 \r
        /* The proxy handle must be valid now. */\r
        if( !h_qp->obj.hdl_valid )\r
@@ -1345,12 +1343,12 @@ proxy_create_qp(
        h_pd = (ib_pd_handle_t)\r
                al_hdl_ref( p_context->h_al, p_ioctl->in.h_pd, AL_OBJ_TYPE_H_PD );\r
        h_sq_cq = (ib_cq_handle_t)al_hdl_ref( p_context->h_al,\r
-               p_ioctl->in.qp_create.h_sq_cq_padding, AL_OBJ_TYPE_H_CQ );\r
+               (uint64_t)p_ioctl->in.qp_create.h_sq_cq, AL_OBJ_TYPE_H_CQ );\r
        h_rq_cq = (ib_cq_handle_t)al_hdl_ref( p_context->h_al,\r
-               p_ioctl->in.qp_create.h_rq_cq_padding, AL_OBJ_TYPE_H_CQ );\r
+               (uint64_t)p_ioctl->in.qp_create.h_rq_cq, AL_OBJ_TYPE_H_CQ );\r
        if (p_ioctl->in.qp_create.h_srq) {\r
                h_srq = (ib_srq_handle_t)al_hdl_ref( p_context->h_al,\r
-                       p_ioctl->in.qp_create.h_srq_padding, AL_OBJ_TYPE_H_SRQ );\r
+                       (uint64_t)p_ioctl->in.qp_create.h_srq, AL_OBJ_TYPE_H_SRQ );\r
                if( !h_srq)\r
                {\r
                        status = IB_INVALID_SRQ_HANDLE;\r
@@ -1389,8 +1387,8 @@ proxy_create_qp(
        else\r
                pfn_ev = NULL;\r
 \r
-       status = create_qp( h_pd, &p_ioctl->in.qp_create,\r
-               (void*)(ULONG_PTR)p_ioctl->in.context, pfn_ev, &h_qp, p_umv_buf );\r
+       status = create_qp( h_pd, &p_ioctl->in.qp_create, p_ioctl->in.context,\r
+               pfn_ev, &h_qp, p_umv_buf );\r
        /* TODO: The create_qp call should return the attributes... */\r
        if( status != IB_SUCCESS )\r
                goto proxy_create_qp_err1;\r
@@ -1490,24 +1488,26 @@ proxy_query_qp(
        {\r
                if( p_ioctl->out.attr.h_pd )\r
                {\r
-                       p_ioctl->out.attr.h_pd_padding = p_ioctl->out.attr.h_pd->obj.hdl;\r
+                       p_ioctl->out.attr.h_pd =\r
+                               (ib_pd_handle_t)HDL_TO_PTR(p_ioctl->out.attr.h_pd->obj.hdl);\r
                }\r
 \r
                if( p_ioctl->out.attr.h_sq_cq )\r
                {\r
-                       p_ioctl->out.attr.h_sq_cq_padding =\r
-                               p_ioctl->out.attr.h_sq_cq->obj.hdl;\r
+                       p_ioctl->out.attr.h_sq_cq =\r
+                               (ib_cq_handle_t)HDL_TO_PTR(p_ioctl->out.attr.h_sq_cq->obj.hdl);\r
                }\r
 \r
                if( p_ioctl->out.attr.h_rq_cq )\r
                {\r
-                       p_ioctl->out.attr.h_rq_cq_padding =\r
-                               p_ioctl->out.attr.h_rq_cq->obj.hdl;\r
+                       p_ioctl->out.attr.h_rq_cq =\r
+                               (ib_cq_handle_t)HDL_TO_PTR(p_ioctl->out.attr.h_rq_cq->obj.hdl);\r
                }\r
 \r
                if( p_ioctl->out.attr.h_srq )\r
                {\r
-                       p_ioctl->out.attr.h_srq_padding = p_ioctl->out.attr.h_srq->obj.hdl;\r
+                       p_ioctl->out.attr.h_srq =\r
+                               (ib_srq_handle_t)HDL_TO_PTR(p_ioctl->out.attr.h_srq->obj.hdl);\r
                }\r
        }\r
        else\r
@@ -2003,7 +2003,7 @@ proxy_cq_comp_cb(
        }\r
 \r
        /* Set up context and callback record type appropriate for UAL */\r
-       cb_info.cq_context = (ULONG_PTR)cq_context;\r
+       cb_info.cq_context = cq_context;\r
 \r
        /* The proxy handle must be valid now. */\r
        if( !h_cq->obj.hdl_valid )\r
@@ -2042,7 +2042,7 @@ proxy_cq_err_cb(
        cb_info.rec_type = CQ_ERROR_REC;\r
        /* Return the Proxy's cq handle and the user's context */\r
        cb_info.ioctl_rec.event_rec = *p_err_rec;\r
-       cb_info.ioctl_rec.event_rec.handle.h_cq_padding = h_cq->obj.hdl;\r
+       cb_info.ioctl_rec.event_rec.handle.h_cq = (ib_cq_handle_t)HDL_TO_PTR(h_cq->obj.hdl);\r
 \r
        /* The proxy handle must be valid now. */\r
        if( !h_cq->obj.hdl_valid )\r
@@ -2123,8 +2123,8 @@ proxy_create_cq(
        else\r
                pfn_ev = NULL;\r
 \r
-       status = create_cq( h_ca, &cq_create,\r
-               (void*)(ULONG_PTR)p_ioctl->in.context, pfn_ev, &h_cq, p_umv_buf );\r
+       status = create_cq( h_ca, &cq_create, p_ioctl->in.context,\r
+               pfn_ev, &h_cq, p_umv_buf );\r
 \r
        if( status != IB_SUCCESS )\r
                goto proxy_create_cq_err2;\r
@@ -2356,7 +2356,7 @@ proxy_post_send(
                {\r
                        /* Validate the AV handle for UD */\r
                        h_av = (ib_av_handle_t)al_hdl_ref( p_context->h_al,\r
-                               p_wr[i].dgrm.ud.h_av_padding, AL_OBJ_TYPE_H_AV );\r
+                               (uint64_t)p_wr[i].dgrm.ud.h_av, AL_OBJ_TYPE_H_AV );\r
                        if( !h_av )\r
                        {\r
                                status = IB_INVALID_AV_HANDLE;\r
@@ -3037,7 +3037,8 @@ proxy_query_mr(
        if( status == IB_SUCCESS )\r
        {\r
                /* Replace the pd handle with proxy's handle */\r
-               p_ioctl->out.attr.h_pd_padding = p_ioctl->out.attr.h_pd->obj.hdl;\r
+               p_ioctl->out.attr.h_pd =\r
+                       (ib_pd_handle_t)HDL_TO_PTR(p_ioctl->out.attr.h_pd->obj.hdl);\r
        }\r
        else\r
        {\r
@@ -3481,7 +3482,7 @@ proxy_bind_mw(
 \r
        /* Validate MR handle */\r
        h_mr = (ib_mr_handle_t)al_hdl_ref( p_context->h_al,\r
-               p_ioctl->in.mw_bind.h_mr_padding, AL_OBJ_TYPE_H_MR );\r
+               (uint64_t)p_ioctl->in.mw_bind.h_mr, AL_OBJ_TYPE_H_MR );\r
        if( !h_mr )\r
        {\r
                status = IB_INVALID_MR_HANDLE;\r
@@ -3602,8 +3603,7 @@ proxy_get_spl_qp(
 \r
        /* We obtain the pool_key separately from the special QP. */\r
        status = get_spl_qp( h_pd, p_ioctl->in.port_guid,\r
-               &p_ioctl->in.qp_create, (void*)(ULONG_PTR)p_ioctl->in.context,\r
-               proxy_qp_err_cb, NULL, &h_qp, p_umv_buf );\r
+               &p_ioctl->in.qp_create, p_ioctl->in.context, proxy_qp_err_cb, NULL, &h_qp, p_umv_buf );\r
        if( status != IB_SUCCESS )\r
                goto proxy_get_spl_qp_err;\r
 \r
index 255c0c2..b3cc398 100644 (file)
@@ -140,22 +140,6 @@ spl_qp_send_comp_cb(
        IN              const   ib_cq_handle_t                          h_cq,\r
        IN                              void                                            *cq_context );\r
 \r
-void\r
-spl_qp_send_dpc_cb(\r
-    IN              KDPC                        *p_dpc,\r
-    IN              void                        *context,\r
-    IN              void                        *arg1,\r
-    IN              void                        *arg2\r
-    );\r
-\r
-void\r
-spl_qp_recv_dpc_cb(\r
-    IN              KDPC                        *p_dpc,\r
-    IN              void                        *context,\r
-    IN              void                        *arg1,\r
-    IN              void                        *arg2\r
-    );\r
-\r
 void\r
 spl_qp_recv_comp_cb(\r
        IN              const   ib_cq_handle_t                          h_cq,\r
@@ -570,17 +554,7 @@ create_spl_qp_svc(
        cl_qlist_init( &p_spl_qp_svc->send_queue );\r
        cl_qlist_init( &p_spl_qp_svc->recv_queue );\r
        cl_spinlock_init(&p_spl_qp_svc->cache_lock);\r
-\r
-    /* Initialize the DPCs. */\r
-    KeInitializeDpc( &p_spl_qp_svc->send_dpc, spl_qp_send_dpc_cb, p_spl_qp_svc );\r
-    KeInitializeDpc( &p_spl_qp_svc->recv_dpc, spl_qp_recv_dpc_cb, p_spl_qp_svc );\r
-\r
-    if( qp_type == IB_QPT_QP0 )\r
-    {\r
-        KeSetImportanceDpc( &p_spl_qp_svc->send_dpc, HighImportance );\r
-        KeSetImportanceDpc( &p_spl_qp_svc->recv_dpc, HighImportance );\r
-    }\r
-\r
+       \r
 #if defined( CL_USE_MUTEX )\r
        /* Initialize async callbacks and flags for send/receive processing. */\r
        p_spl_qp_svc->send_async_queued = FALSE;\r
@@ -2487,8 +2461,6 @@ spl_qp_send_comp_cb(
 \r
        AL_ENTER( AL_DBG_SMI );\r
 \r
-       UNREFERENCED_PARAMETER( h_cq );\r
-\r
        CL_ASSERT( cq_context );\r
        p_spl_qp_svc = cq_context;\r
 \r
@@ -2505,55 +2477,21 @@ spl_qp_send_comp_cb(
        cl_spinlock_release( &p_spl_qp_svc->obj.lock );\r
 \r
 #else\r
-    cl_spinlock_acquire( &p_spl_qp_svc->obj.lock );\r
-       if( p_spl_qp_svc->state != SPL_QP_ACTIVE )\r
-       {\r
-               cl_spinlock_release( &p_spl_qp_svc->obj.lock );\r
-        AL_EXIT( AL_DBG_SMI );\r
-               return;\r
-       }\r
-       cl_atomic_inc( &p_spl_qp_svc->in_use_cnt );\r
-       cl_spinlock_release( &p_spl_qp_svc->obj.lock );\r
 \r
-    /* Queue the DPC. */\r
+       /* Invoke the callback directly. */\r
        CL_ASSERT( h_cq == p_spl_qp_svc->h_send_cq );\r
-    KeInsertQueueDpc( &p_spl_qp_svc->send_dpc, NULL, NULL );\r
-#endif\r
-\r
-       AL_EXIT( AL_DBG_SMI );\r
-}\r
-\r
-\r
-void\r
-spl_qp_send_dpc_cb(\r
-    IN              KDPC                        *p_dpc,\r
-    IN              void                        *context,\r
-    IN              void                        *arg1,\r
-    IN              void                        *arg2\r
-    )\r
-{\r
-       spl_qp_svc_t*                   p_spl_qp_svc;\r
-\r
-       AL_ENTER( AL_DBG_SMI );\r
-\r
-       CL_ASSERT( context );\r
-       p_spl_qp_svc = context;\r
-\r
-    UNREFERENCED_PARAMETER( p_dpc );\r
-    UNREFERENCED_PARAMETER( arg1 );\r
-    UNREFERENCED_PARAMETER( arg2 );\r
-\r
-       spl_qp_comp( p_spl_qp_svc, p_spl_qp_svc->h_send_cq, IB_WC_SEND );\r
+       spl_qp_comp( p_spl_qp_svc, h_cq, IB_WC_SEND );\r
 \r
        /* Continue processing any queued MADs on the QP. */\r
        special_qp_resume_sends( p_spl_qp_svc->h_qp );\r
 \r
-    cl_atomic_dec( &p_spl_qp_svc->in_use_cnt );\r
+#endif\r
 \r
-    AL_EXIT( AL_DBG_SMI );\r
+       AL_EXIT( AL_DBG_SMI );\r
 }\r
 \r
 \r
+\r
 #if defined( CL_USE_MUTEX )\r
 void\r
 spl_qp_send_async_cb(\r
@@ -2598,8 +2536,6 @@ spl_qp_recv_comp_cb(
 \r
        AL_ENTER( AL_DBG_SMI );\r
 \r
-       UNREFERENCED_PARAMETER( h_cq );\r
-\r
        CL_ASSERT( cq_context );\r
        p_spl_qp_svc = cq_context;\r
 \r
@@ -2616,51 +2552,16 @@ spl_qp_recv_comp_cb(
        cl_spinlock_release( &p_spl_qp_svc->obj.lock );\r
 \r
 #else\r
-    cl_spinlock_acquire( &p_spl_qp_svc->obj.lock );\r
-       if( p_spl_qp_svc->state != SPL_QP_ACTIVE )\r
-       {\r
-               cl_spinlock_release( &p_spl_qp_svc->obj.lock );\r
-        AL_EXIT( AL_DBG_SMI );\r
-               return;\r
-       }\r
-       cl_atomic_inc( &p_spl_qp_svc->in_use_cnt );\r
-       cl_spinlock_release( &p_spl_qp_svc->obj.lock );\r
 \r
-    /* Queue the DPC. */\r
        CL_ASSERT( h_cq == p_spl_qp_svc->h_recv_cq );\r
-    KeInsertQueueDpc( &p_spl_qp_svc->recv_dpc, NULL, NULL );\r
+       spl_qp_comp( p_spl_qp_svc, h_cq, IB_WC_RECV );\r
+\r
 #endif\r
 \r
        AL_EXIT( AL_DBG_SMI );\r
 }\r
 \r
 \r
-void\r
-spl_qp_recv_dpc_cb(\r
-    IN              KDPC                        *p_dpc,\r
-    IN              void                        *context,\r
-    IN              void                        *arg1,\r
-    IN              void                        *arg2\r
-    )\r
-{\r
-       spl_qp_svc_t*                   p_spl_qp_svc;\r
-\r
-       AL_ENTER( AL_DBG_SMI );\r
-\r
-       CL_ASSERT( context );\r
-       p_spl_qp_svc = context;\r
-\r
-    UNREFERENCED_PARAMETER( p_dpc );\r
-    UNREFERENCED_PARAMETER( arg1 );\r
-    UNREFERENCED_PARAMETER( arg2 );\r
-\r
-       spl_qp_comp( p_spl_qp_svc, p_spl_qp_svc->h_recv_cq, IB_WC_RECV );\r
-\r
-    cl_atomic_dec( &p_spl_qp_svc->in_use_cnt );\r
-\r
-    AL_EXIT( AL_DBG_SMI );\r
-}\r
-\r
 \r
 #if defined( CL_USE_MUTEX )\r
 void\r
@@ -2688,7 +2589,7 @@ spl_qp_recv_async_cb(
 #endif\r
 \r
 \r
-#define SPL_QP_MAX_POLL 16\r
+\r
 /*\r
  * Special QP completion handler.\r
  */\r
@@ -2706,7 +2607,6 @@ spl_qp_comp(
        ib_mad_element_t*               p_mad_element;\r
        ib_smp_t*                               p_smp;\r
        ib_api_status_t                 status;\r
-    int                     max_poll = SPL_QP_MAX_POLL;\r
 \r
        AL_ENTER( AL_DBG_SMI_CB );\r
 \r
@@ -2725,7 +2625,7 @@ spl_qp_comp(
 \r
        wc.p_next = NULL;\r
        /* Process work completions. */\r
-       while( max_poll && ib_poll_cq( h_cq, &p_free_wc, &p_done_wc ) == IB_SUCCESS )\r
+       while( ib_poll_cq( h_cq, &p_free_wc, &p_done_wc ) == IB_SUCCESS )\r
        {\r
                /* Process completions one at a time. */\r
                CL_ASSERT( p_done_wc );\r
@@ -2813,25 +2713,13 @@ spl_qp_comp(
                        spl_qp_svc_reset( p_spl_qp_svc );\r
                }\r
                p_free_wc = &wc;\r
-        --max_poll;\r
-       }\r
-\r
-    if( max_poll == 0 )\r
-    {\r
-        /* We already have an in_use_cnt reference - use it to queue the DPC. */\r
-        if( wc_type == IB_WC_SEND )\r
-            KeInsertQueueDpc( &p_spl_qp_svc->send_dpc, NULL, NULL );\r
-        else\r
-            KeInsertQueueDpc( &p_spl_qp_svc->recv_dpc, NULL, NULL );\r
-    }\r
-    else\r
-    {\r
-           /* Rearm the CQ. */\r
-           status = ib_rearm_cq( h_cq, FALSE );\r
-           CL_ASSERT( status == IB_SUCCESS );\r
-\r
-           cl_atomic_dec( &p_spl_qp_svc->in_use_cnt );\r
-    }\r
+       }\r
+\r
+       /* Rearm the CQ. */\r
+       status = ib_rearm_cq( h_cq, FALSE );\r
+       CL_ASSERT( status == IB_SUCCESS );\r
+\r
+       cl_atomic_dec( &p_spl_qp_svc->in_use_cnt );\r
        AL_EXIT( AL_DBG_SMI_CB );\r
 }\r
 \r
index 62cb0fe..95b2718 100644 (file)
@@ -157,9 +157,6 @@ typedef struct _spl_qp_svc
        ib_pool_key_t                           pool_key;\r
        ib_mad_svc_handle_t                     h_mad_svc;\r
 \r
-    KDPC                        send_dpc;\r
-    KDPC                        recv_dpc;\r
-\r
 }      spl_qp_svc_t;\r
 \r
 \r
index b1a12cb..ec37f5c 100644 (file)
@@ -169,7 +169,7 @@ ual_open_ca(
        }\r
 \r
        ca_ioctl.in.guid = ca_guid;\r
-       ca_ioctl.in.context = (ULONG_PTR)p_ci_ca;\r
+       ca_ioctl.in.context = p_ci_ca;\r
 \r
        cl_status = do_al_dev_ioctl( UAL_OPEN_CA,\r
                &ca_ioctl.in, sizeof(ca_ioctl.in), &ca_ioctl.out, sizeof(ca_ioctl.out),\r
@@ -273,7 +273,7 @@ ual_query_ca(
        cl_memclr( &ca_ioctl, sizeof(ca_ioctl) );\r
 \r
        ca_ioctl.in.h_ca = h_ca->obj.p_ci_ca->obj.hdl;\r
-       ca_ioctl.in.p_ca_attr = (ULONG_PTR)p_ca_attr;\r
+       ca_ioctl.in.p_ca_attr = p_ca_attr;\r
        ca_ioctl.in.byte_cnt = *p_size;\r
 \r
        /* Call the uvp pre call if the vendor library provided a valid ca handle */\r
@@ -336,7 +336,7 @@ ual_modify_ca(
        uvp_interface_t                         uvp_intf = h_ca->obj.p_ci_ca->verbs.user_verbs;\r
 \r
        AL_ENTER( AL_DBG_CA );\r
-\r
+    cl_memclr(&ca_ioctl, sizeof(ca_ioctl));\r
        /* Call the uvp pre call if the vendor library provided a valid ca handle */\r
        if( h_ca->obj.p_ci_ca->h_ci_ca && uvp_intf.pre_modify_ca )\r
        {\r
index 280c2b2..07b14fe 100644 (file)
@@ -267,14 +267,13 @@ __create_ucep(
 \r
        /* Store user parameters. */\r
        p_cep->pfn_cb = pfn_cb;\r
-       p_cep->destroy_context = context;\r
+       p_cep->destroy_context = context; //TODO: context will no be longer __ptr64\r
 \r
        /* Create a kernel CEP only if we don't already have a CID. */\r
        if( cid == AL_INVALID_CID )\r
        {\r
-               uint64_t cep_context = (ULONG_PTR)context;\r
-               if( !DeviceIoControl( g_al_device, UAL_CREATE_CEP, &cep_context,\r
-                       sizeof(cep_context), &ioctl, sizeof(ioctl), &bytes_ret, NULL ) ||\r
+               if( !DeviceIoControl( g_al_device, UAL_CREATE_CEP, &context, \r
+                       sizeof(context), &ioctl, sizeof(ioctl), &bytes_ret, NULL ) ||\r
                        bytes_ret != sizeof(ioctl) )\r
                {\r
                        __destroy_ucep( p_cep );\r
@@ -449,7 +448,7 @@ al_cep_listen(
        DWORD                                   bytes_ret;\r
 \r
        AL_ENTER( AL_DBG_CM );\r
-\r
+    cl_memclr(&ioctl, sizeof(ioctl));\r
        if( !h_al )\r
        {\r
                AL_EXIT( AL_DBG_CM );\r
@@ -464,7 +463,6 @@ al_cep_listen(
 \r
        ioctl.cid = cid;\r
        ioctl.cep_listen = *p_listen_info;\r
-       ioctl.cep_listen.p_cmp_buf_padding = 0;\r
        if( p_listen_info->p_cmp_buf )\r
        {\r
                if( p_listen_info->cmp_len > IB_REQ_PDATA_SIZE )\r
@@ -474,7 +472,6 @@ al_cep_listen(
                        return IB_INVALID_SETTING;\r
                }\r
 \r
-               ioctl.cep_listen.p_cmp_buf_padding = 1;\r
                cl_memcpy( ioctl.compare, p_listen_info->p_cmp_buf,\r
                        p_listen_info->cmp_len );\r
        }\r
@@ -522,19 +519,14 @@ al_cep_pre_req(
                AL_EXIT( AL_DBG_ERROR );\r
                return IB_INVALID_PARAMETER;\r
        }\r
-\r
+    cl_memclr(&ioctl, sizeof(ioctl));\r
        ioctl.in.cid = cid;\r
        ioctl.in.cm_req = *p_cm_req;\r
-       ioctl.in.cm_req.h_qp_padding = p_cm_req->h_qp->obj.hdl;\r
+       ioctl.in.cm_req.h_qp = (ib_qp_handle_t) HDL_TO_PTR(p_cm_req->h_qp->obj.hdl);\r
        ioctl.in.paths[0] = *(p_cm_req->p_primary_path);\r
-       ioctl.in.cm_req.p_alt_path_padding = 0;\r
        if( p_cm_req->p_alt_path )\r
-       {\r
-               ioctl.in.cm_req.p_alt_path_padding = 1;\r
                ioctl.in.paths[1] = *(p_cm_req->p_alt_path);\r
-       }\r
        /* Copy private data, if any. */\r
-       ioctl.in.cm_req.p_req_pdata_padding = 0;\r
        if( p_cm_req->p_req_pdata )\r
        {\r
                if( p_cm_req->req_length > IB_REQ_PDATA_SIZE )\r
@@ -544,13 +536,11 @@ al_cep_pre_req(
                        return IB_INVALID_SETTING;\r
                }\r
 \r
-               ioctl.in.cm_req.p_req_pdata_padding = 1;\r
                cl_memcpy( ioctl.in.pdata, p_cm_req->p_req_pdata,\r
                        p_cm_req->req_length );\r
        }\r
 \r
        /* Copy compare data, if any. */\r
-       ioctl.in.cm_req.p_compare_buffer_padding = 0;\r
        if( p_cm_req->p_compare_buffer )\r
        {\r
                if( p_cm_req->compare_length > IB_REQ_PDATA_SIZE )\r
@@ -560,7 +550,6 @@ al_cep_pre_req(
                        return IB_INVALID_SETTING;\r
                }\r
 \r
-               ioctl.in.cm_req.p_compare_buffer_padding = 1;\r
                cl_memcpy( ioctl.in.compare, p_cm_req->p_compare_buffer,\r
                        p_cm_req->compare_length );\r
        }\r
@@ -645,6 +634,7 @@ al_cep_pre_rep(
                AL_EXIT( AL_DBG_ERROR );\r
                return IB_INVALID_PARAMETER;\r
        }\r
+    cl_memclr(&ioctl, sizeof (ioctl));\r
 \r
        /* Store the context for the CEP. */\r
        cl_spinlock_acquire( &gp_cep_mgr->obj.lock );\r
@@ -658,12 +648,11 @@ al_cep_pre_rep(
        p_cep->destroy_context = context;\r
        cl_spinlock_release( &gp_cep_mgr->obj.lock );\r
 \r
-       ioctl.in.context = (ULONG_PTR)context;\r
+       ioctl.in.context = context;\r
        ioctl.in.cid = cid;\r
        ioctl.in.cm_rep = *p_cm_rep;\r
-       ioctl.in.cm_rep.h_qp_padding = p_cm_rep->h_qp->obj.hdl;\r
+       ioctl.in.cm_rep.h_qp = (ib_qp_handle_t)HDL_TO_PTR(p_cm_rep->h_qp->obj.hdl);\r
        /* Copy private data, if any. */\r
-       ioctl.in.cm_rep.p_rep_pdata_padding = 0;\r
        if( p_cm_rep->p_rep_pdata )\r
        {\r
                if( p_cm_rep->rep_length > IB_REP_PDATA_SIZE )\r
@@ -673,7 +662,6 @@ al_cep_pre_rep(
                        return IB_INVALID_SETTING;\r
                }\r
 \r
-               ioctl.in.cm_rep.p_rep_pdata_padding = 1;\r
                cl_memcpy( ioctl.in.pdata, p_cm_rep->p_rep_pdata,\r
                        p_cm_rep->rep_length );\r
        }\r
@@ -834,7 +822,7 @@ al_cep_rtu(
                AL_EXIT( AL_DBG_CM );\r
                return IB_INVALID_HANDLE;\r
        }\r
-\r
+    cl_memclr(&ioctl, sizeof(ioctl));\r
        ioctl.cid = cid;\r
        /* Copy private data, if any. */\r
        if( p_pdata )\r
@@ -885,7 +873,7 @@ al_cep_rej(
                AL_EXIT( AL_DBG_CM );\r
                return IB_INVALID_HANDLE;\r
        }\r
-\r
+    cl_memclr(&ioctl, sizeof(ioctl));\r
        ioctl.cid = cid;\r
        ioctl.rej_status = rej_status;\r
        if( p_ari )\r
@@ -959,10 +947,9 @@ al_cep_mra(
                AL_EXIT( AL_DBG_CM );\r
                return IB_INVALID_HANDLE;\r
        }\r
-\r
+    cl_memclr(&ioctl, sizeof (ioctl));\r
        ioctl.cid = cid;\r
        ioctl.cm_mra = *p_cm_mra;\r
-       ioctl.cm_mra.p_mra_pdata_padding = 0;\r
        /* Copy private data, if any. */\r
        if( p_cm_mra->p_mra_pdata )\r
        {\r
@@ -973,7 +960,6 @@ al_cep_mra(
                        return IB_INVALID_SETTING;\r
                }\r
 \r
-               ioctl.cm_mra.p_mra_pdata_padding = 1;\r
                cl_memcpy(\r
                        ioctl.pdata, p_cm_mra->p_mra_pdata, p_cm_mra->mra_length );\r
        }\r
@@ -1021,13 +1007,12 @@ al_cep_lap(
                AL_EXIT( AL_DBG_CM );\r
                return IB_INVALID_HANDLE;\r
        }\r
-\r
+    cl_memclr(&ioctl,sizeof (ioctl));\r
        ioctl.cid = cid;\r
        ioctl.cm_lap = *p_cm_lap;\r
-       ioctl.cm_lap.h_qp_padding = p_cm_lap->h_qp->obj.hdl;\r
+       ioctl.cm_lap.h_qp = (ib_qp_handle_t) HDL_TO_PTR(p_cm_lap->h_qp->obj.hdl);\r
        ioctl.alt_path = *(p_cm_lap->p_alt_path);\r
        /* Copy private data, if any. */\r
-       ioctl.cm_lap.p_lap_pdata_padding = 0;\r
        if( p_cm_lap->p_lap_pdata )\r
        {\r
                if( p_cm_lap->lap_length > IB_LAP_PDATA_SIZE )\r
@@ -1037,7 +1022,6 @@ al_cep_lap(
                        return IB_INVALID_SETTING;\r
                }\r
 \r
-               ioctl.cm_lap.p_lap_pdata_padding = 1;\r
                cl_memcpy(\r
                        ioctl.pdata, p_cm_lap->p_lap_pdata, p_cm_lap->lap_length );\r
        }\r
@@ -1079,11 +1063,10 @@ al_cep_pre_apr(
                AL_EXIT( AL_DBG_CM );\r
                return IB_INVALID_PARAMETER;\r
        }\r
-\r
+    cl_memclr(&ioctl, sizeof (ioctl));\r
        ioctl.in.cid = cid;\r
        ioctl.in.cm_apr = *p_cm_apr;\r
-       ioctl.in.cm_apr.h_qp_padding = p_cm_apr->h_qp->obj.hdl;\r
-       ioctl.in.cm_apr.p_info_padding = 0;\r
+       ioctl.in.cm_apr.h_qp = (ib_qp_handle_t)HDL_TO_PTR(p_cm_apr->h_qp->obj.hdl);\r
        if( p_cm_apr->p_info )\r
        {\r
                if( p_cm_apr->info_length > IB_APR_INFO_SIZE )\r
@@ -1093,22 +1076,19 @@ al_cep_pre_apr(
                        return IB_INVALID_SETTING;\r
                }\r
 \r
-               ioctl.in.cm_apr.p_info_padding = 1;\r
                cl_memcpy(\r
                        ioctl.in.apr_info, p_cm_apr->p_info, p_cm_apr->info_length );\r
        }\r
        /* Copy private data, if any. */\r
-       ioctl.in.cm_apr.p_apr_pdata_padding = 0;\r
        if( p_cm_apr->p_apr_pdata )\r
        {\r
-               if( p_cm_apr->apr_length > IB_APR_PDATA_SIZE )\r
+               if( p_cm_apr->apr_length > IB_APR_PDATA_SIZE) //TODO ??????\r
                {\r
                        AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,\r
                                ("private data larger than APR private data.\n") );\r
                        return IB_INVALID_SETTING;\r
                }\r
 \r
-               ioctl.in.cm_apr.p_apr_pdata_padding = 1;\r
                cl_memcpy(\r
                        ioctl.in.pdata, p_cm_apr->p_apr_pdata, p_cm_apr->apr_length );\r
        }\r
@@ -1178,7 +1158,7 @@ al_cep_dreq(
                AL_EXIT( AL_DBG_CM );\r
                return IB_INVALID_HANDLE;\r
        }\r
-\r
+    cl_memclr(&ioctl, sizeof(ioctl));\r
        ioctl.cid = cid;\r
        /* Copy private data, if any. */\r
        if( p_pdata )\r
@@ -1404,7 +1384,7 @@ al_cep_poll(
                \r
                cl_memcpy( p_mad->p_mad_buf, ioctl.mad_buf, MAD_BLOCK_SIZE );\r
 \r
-               *p_context = (void*)(ULONG_PTR)ioctl.context;\r
+               *p_context = ioctl.context;\r
                *p_new_cid = ioctl.new_cid;\r
                *pp_mad = p_mad;\r
        }\r
index 46aea61..d71390b 100644 (file)
@@ -78,8 +78,8 @@ ual_create_cq(
 \r
        cq_ioctl.in.h_ca = p_ci_ca->obj.hdl;\r
        cq_ioctl.in.size = p_cq_create->size;\r
-       cq_ioctl.in.h_wait_obj = HandleToHandle64( p_cq_create->h_wait_obj );\r
-       cq_ioctl.in.context = (ULONG_PTR)h_cq;\r
+       cq_ioctl.in.h_wait_obj = p_cq_create->h_wait_obj;\r
+       cq_ioctl.in.context = h_cq;\r
        cq_ioctl.in.ev_notify = (h_cq->pfn_event_cb != NULL) ? TRUE : FALSE;\r
 \r
        cl_status = do_al_dev_ioctl( UAL_CREATE_CQ,\r
index e175ee5..9e454bd 100644 (file)
@@ -202,7 +202,7 @@ ual_send_one_mad(
        AL_ENTER( AL_DBG_MAD );\r
 \r
        CL_ASSERT( p_mad_element );\r
-\r
+    cl_memclr(&ioctl_buf, sizeof(ioctl_buf));\r
        p_al_element = PARENT_STRUCT(\r
                p_mad_element, al_mad_element_t, element );\r
 \r
@@ -223,9 +223,9 @@ ual_send_one_mad(
        else\r
                ioctl_buf.in.h_av = AL_INVALID_HANDLE;\r
 \r
-       ioctl_buf.in.p_mad_element = (ULONG_PTR)p_mad_element;\r
+       ioctl_buf.in.p_mad_element = p_mad_element;\r
        ioctl_buf.in.size = p_mad_element->size;\r
-       ioctl_buf.in.ph_proxy = (ULONG_PTR)&p_al_element->h_proxy_element;\r
+       ioctl_buf.in.ph_proxy = &p_al_element->h_proxy_element;\r
 \r
        cl_status = do_al_dev_ioctl( UAL_MAD_SEND,\r
                &ioctl_buf.in, sizeof(ioctl_buf.in),\r
@@ -439,7 +439,7 @@ ual_get_recv_mad(
         * Note that we issue the IOCTL regardless of failure of ib_get_mad.\r
         * This is done in order to release the kernel-mode MAD.\r
         */\r
-       ioctl_buf.in.p_user_mad = (ULONG_PTR)p_mad;\r
+       ioctl_buf.in.p_user_mad = p_mad;\r
 \r
        if( p_mad )\r
        {\r
@@ -447,8 +447,8 @@ ual_get_recv_mad(
                p_mad_buf = p_mad->p_mad_buf;\r
                p_grh = p_mad->p_grh;\r
 \r
-               ioctl_buf.in.p_mad_buf = (ULONG_PTR)p_mad_buf;\r
-               ioctl_buf.in.p_grh = (ULONG_PTR)p_grh;\r
+               ioctl_buf.in.p_mad_buf = p_mad_buf;\r
+               ioctl_buf.in.p_grh = p_grh;\r
        }\r
        ioctl_buf.in.h_mad = h_mad;\r
 \r
@@ -500,7 +500,7 @@ ual_local_mad(
        ib_api_status_t                         status = IB_SUCCESS;\r
 \r
        AL_ENTER( AL_DBG_CA );\r
-\r
+    cl_memclr(&local_mad_ioctl, sizeof (local_mad_ioctl));\r
        local_mad_ioctl.in.h_ca = h_ca->obj.p_ci_ca->obj.hdl;\r
        local_mad_ioctl.in.port_num = port_num;\r
        cl_memcpy( local_mad_ioctl.in.mad_in, p_mad_in,\r
index 7c17f07..01253bd 100644 (file)
@@ -99,7 +99,7 @@ ual_attach_mcast(
                status = ioctl_buf.out.status;\r
                if( status == IB_SUCCESS ){\r
                        h_mcast->obj.hdl = ioctl_buf.out.h_attach;\r
-                       h_mcast->h_ci_mcast = (ib_mcast_handle_t)(ULONG_PTR)ioctl_buf.out.h_attach;\r
+                       h_mcast->h_ci_mcast = (ib_mcast_handle_t) HDL_TO_PTR(ioctl_buf.out.h_attach);\r
                }\r
        }\r
 \r
index e92ac6b..e5f7c90 100644 (file)
@@ -162,11 +162,11 @@ ual_create_async_file(
        uintn_t                                 bytes_ret;\r
 \r
        AL_ENTER( AL_DBG_MGR );\r
-\r
+    cl_memclr(&ioctl, sizeof (ual_bind_file_ioctl_t));\r
        /* Create a file object on which to issue all SA requests. */\r
-       ioctl.h_file = HandleToHandle64( CreateFileW( L"\\\\.\\ibal",\r
+       ioctl.h_file = CreateFileW( L"\\\\.\\ibal",\r
                GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-               NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL ) );\r
+               NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL );\r
        if( ioctl.h_file == INVALID_HANDLE_VALUE )\r
        {\r
                AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,\r
@@ -646,12 +646,11 @@ __process_misc_cb(
                /* We got a send completion. */\r
                ib_mad_element_t                        *p_element;\r
 \r
-               ib_mad_svc_handle_t                     h_mad_svc = (ib_mad_svc_handle_t)(ULONG_PTR)\r
+               ib_mad_svc_handle_t                     h_mad_svc = (ib_mad_svc_handle_t)\r
                        p_misc_cb_info->ioctl_rec.mad_send_cb_ioctl_rec.mad_svc_context;\r
 \r
                /* Copy the data to the user's element. */\r
-               p_element = (ib_mad_element_t*)(ULONG_PTR)\r
-                       p_misc_cb_info->ioctl_rec.mad_send_cb_ioctl_rec.p_um_mad;\r
+               p_element = p_misc_cb_info->ioctl_rec.mad_send_cb_ioctl_rec.p_um_mad;\r
                /* Only update the status if a receive wasn't failed. */\r
                if( p_element->status != IB_WCS_TIMEOUT_RETRY_ERR )\r
                {\r
@@ -683,10 +682,10 @@ __process_misc_cb(
                ib_mad_t                                *p_mad_buf = NULL;\r
                ib_grh_t                                *p_grh = NULL;\r
 \r
-               h_mad_svc = (ib_mad_svc_handle_t)(ULONG_PTR)\r
+               h_mad_svc = (ib_mad_svc_handle_t)\r
                        p_misc_cb_info->ioctl_rec.mad_recv_cb_ioctl_rec.mad_svc_context;\r
 \r
-               p_send_mad = (ib_mad_element_t*)(ULONG_PTR)\r
+               p_send_mad =\r
                        p_misc_cb_info->ioctl_rec.mad_recv_cb_ioctl_rec.p_send_mad;\r
 \r
                cl_memclr( &ioctl_buf, sizeof(ioctl_buf) );\r
@@ -709,7 +708,7 @@ __process_misc_cb(
                else if( p_send_mad )\r
                        p_send_mad->status = IB_WCS_TIMEOUT_RETRY_ERR;\r
 \r
-               ioctl_buf.in.p_user_mad = (ULONG_PTR)p_mad;\r
+               ioctl_buf.in.p_user_mad = p_mad;\r
 \r
                if( p_mad )\r
                {\r
@@ -717,8 +716,8 @@ __process_misc_cb(
                        p_mad_buf = p_mad->p_mad_buf;\r
                        p_grh = p_mad->p_grh;\r
 \r
-                       ioctl_buf.in.p_mad_buf = (ULONG_PTR)p_mad_buf;\r
-                       ioctl_buf.in.p_grh = (ULONG_PTR)p_grh;\r
+                       ioctl_buf.in.p_mad_buf = p_mad_buf;\r
+                       ioctl_buf.in.p_grh = p_grh;\r
                }\r
                ioctl_buf.in.h_mad = p_misc_cb_info->ioctl_rec.mad_recv_cb_ioctl_rec.h_mad;\r
 \r
index 6ed3216..42f86a6 100644 (file)
@@ -65,9 +65,11 @@ ual_reg_mem(
 \r
        AL_ENTER( AL_DBG_MR );\r
 \r
+       /* Clear the mr_ioctl */\r
+       cl_memclr( &mr_ioctl, sizeof(mr_ioctl) );\r
+\r
        mr_ioctl.in.h_pd = h_pd->obj.hdl;\r
        mr_ioctl.in.mem_create = *p_mr_create;\r
-       mr_ioctl.in.mem_create.vaddr_padding = (ULONG_PTR)p_mr_create->vaddr;\r
 \r
        cl_status = do_al_dev_ioctl( UAL_REG_MR,\r
                &mr_ioctl.in, sizeof(mr_ioctl.in), &mr_ioctl.out, sizeof(mr_ioctl.out),\r
index 8e969d9..0d5dc23 100644 (file)
@@ -280,7 +280,7 @@ ual_bind_mw(
        mw_ioctl.in.h_mw = h_mw->obj.hdl;\r
        mw_ioctl.in.h_qp = h_qp->obj.hdl;\r
        mw_ioctl.in.mw_bind = *p_mw_bind;\r
-       mw_ioctl.in.mw_bind.h_mr_padding = p_mw_bind->h_mr->obj.hdl;\r
+       mw_ioctl.in.mw_bind.h_mr = (ib_mr_handle_t) HDL_TO_PTR(p_mw_bind->h_mr->obj.hdl);\r
 \r
        cl_status = do_al_dev_ioctl( UAL_BIND_MW,\r
                &mw_ioctl.in, sizeof(mw_ioctl.in), &mw_ioctl.out, sizeof(mw_ioctl.out),\r
index 3d58cd0..0274d2d 100644 (file)
@@ -80,7 +80,7 @@ ual_allocate_pd(
 \r
        pd_ioctl.in.h_ca = h_ca->obj.p_ci_ca->obj.hdl;\r
        pd_ioctl.in.type = pd_type;\r
-       pd_ioctl.in.context = (ULONG_PTR)h_pd;\r
+       pd_ioctl.in.context = h_pd;\r
 \r
        cl_status = do_al_dev_ioctl( UAL_ALLOC_PD,\r
                &pd_ioctl.in, sizeof(pd_ioctl.in), &pd_ioctl.out, sizeof(pd_ioctl.out),\r
index d0eb397..7c9366a 100644 (file)
@@ -321,14 +321,14 @@ ib_reg_pnp(
 \r
        /* Copy the request information. */\r
        p_reg->pfn_pnp_cb = p_pnp_req->pfn_pnp_cb;\r
-\r
+    cl_memclr(&in, sizeof(in));\r
        in.pnp_class = p_pnp_req->pnp_class;\r
-       in.p_status = (ULONG_PTR)&status;\r
-       in.p_hdl = (ULONG_PTR)&p_reg->obj.hdl;\r
+       in.p_status = &status;\r
+       in.p_hdl = &p_reg->obj.hdl;\r
 \r
        if( pnp_get_flag( p_pnp_req->pnp_class ) & IB_PNP_FLAG_REG_SYNC )\r
        {\r
-               in.sync_event = HandleToHandle64( CreateEvent( NULL, FALSE, FALSE, NULL ) );\r
+               in.sync_event = CreateEvent( NULL, FALSE, FALSE, NULL );\r
                if( !in.sync_event )\r
                {\r
                        p_reg->obj.pfn_destroy( &p_reg->obj, NULL );\r
@@ -458,10 +458,9 @@ __pnp_async_cb(
        AL_ENTER( AL_DBG_PNP );\r
 \r
        p_reg = PARENT_STRUCT( p_item, al_pnp_t, async_item );\r
-\r
+    cl_memclr(&in, sizeof(in));\r
        in.pnp_hdl = p_reg->obj.hdl;\r
        in.last_evt_hdl = p_reg->rearm.evt_hdl;\r
-       in.last_evt_context = 0;\r
 \r
        if( p_reg->rearm.evt_size )\r
        {\r
@@ -492,11 +491,12 @@ __pnp_async_cb(
                                }\r
                                p_pnp_rec->pnp_context = (void*)p_reg->obj.context;\r
                                in.last_evt_status = p_reg->pfn_pnp_cb( p_pnp_rec );\r
-                               in.last_evt_context = (ULONG_PTR)p_pnp_rec->context;\r
+                               in.last_evt_context = p_pnp_rec->context;\r
                        }\r
                        else\r
                        {\r
                                in.last_evt_status = IB_SUCCESS;\r
+                               in.last_evt_context = NULL;\r
                        }\r
 \r
                        if( p_pnp_rec )\r
@@ -505,11 +505,13 @@ __pnp_async_cb(
                else\r
                {\r
                        in.last_evt_status = IB_SUCCESS;\r
+                       in.last_evt_context = NULL;\r
                }\r
        }\r
        else\r
        {\r
                in.last_evt_status = IB_SUCCESS;\r
+               in.last_evt_context = NULL;\r
        }\r
 \r
        /* Request the next PnP event. */\r
index 0fc84ec..b7996b8 100644 (file)
@@ -115,14 +115,7 @@ ual_post_send(
        num_wr = 0;\r
        for( p_wr = p_send_wr; p_wr; p_wr = p_wr->p_next )\r
        {\r
-               /* pNext and pDs pointer is set by the kernel proxy. */\r
-               p_qp_ioctl->in.send_wr[num_wr] = *p_wr;\r
-               if( h_qp->type == IB_QPT_UNRELIABLE_DGRM )\r
-               {\r
-                       p_qp_ioctl->in.send_wr[num_wr].dgrm.ud.h_av_padding =\r
-                               p_wr->dgrm.ud.h_av->obj.hdl;\r
-               }\r
-               num_wr++;\r
+               p_qp_ioctl->in.send_wr[num_wr++] = *p_wr;\r
                cl_memcpy(\r
                        p_ds, p_wr->ds_array, sizeof(ib_local_ds_t) * p_wr->num_ds );\r
                p_ds += p_wr->num_ds;\r
@@ -229,7 +222,6 @@ ual_post_recv(
        num_wr = 0;\r
        for( p_wr = p_recv_wr; p_wr; p_wr = p_wr->p_next )\r
        {\r
-               /* pNext and pDs pointer is set by the kernel proxy. */\r
                p_qp_ioctl->in.recv_wr[num_wr++] = *p_wr;\r
                cl_memcpy(\r
                        p_ds, p_wr->ds_array, sizeof(ib_local_ds_t) * p_wr->num_ds );\r
@@ -321,13 +313,14 @@ ual_create_qp(
         */\r
        qp_ioctl.in.h_pd = h_pd->obj.hdl;\r
        qp_ioctl.in.qp_create = *p_qp_create;\r
-       qp_ioctl.in.qp_create.h_rq_cq_padding = p_qp_create->h_rq_cq->obj.hdl;\r
-       qp_ioctl.in.qp_create.h_sq_cq_padding = p_qp_create->h_sq_cq->obj.hdl;\r
+       qp_ioctl.in.qp_create.h_rq_cq =\r
+               (ib_cq_handle_t)HDL_TO_PTR(p_qp_create->h_rq_cq->obj.hdl);\r
+       qp_ioctl.in.qp_create.h_sq_cq =\r
+               (ib_cq_handle_t)HDL_TO_PTR(p_qp_create->h_sq_cq->obj.hdl);\r
        if (p_qp_create->h_srq)\r
-       {\r
-               qp_ioctl.in.qp_create.h_srq_padding = p_qp_create->h_srq->obj.hdl;\r
-       }\r
-       qp_ioctl.in.context = (ULONG_PTR)h_qp;\r
+               qp_ioctl.in.qp_create.h_srq =\r
+                       (ib_srq_handle_t)HDL_TO_PTR(p_qp_create->h_srq->obj.hdl);\r
+       qp_ioctl.in.context = h_qp;\r
        qp_ioctl.in.ev_notify = (h_qp->pfn_event_cb != NULL) ? TRUE : FALSE;\r
 \r
        cl_status = do_al_dev_ioctl( UAL_CREATE_QP,\r
@@ -627,7 +620,7 @@ ual_init_qp_alias(
                qp_ioctl.in.h_pd = h_pd->obj.hdl;\r
                qp_ioctl.in.port_guid = port_guid;\r
                qp_ioctl.in.qp_create = *p_qp_create;\r
-               qp_ioctl.in.context = (ULONG_PTR)&p_qp_alias->qp;\r
+               qp_ioctl.in.context = &p_qp_alias->qp;\r
 \r
                cl_status = do_al_dev_ioctl( UAL_GET_SPL_QP_ALIAS,\r
                        &qp_ioctl.in, sizeof(qp_ioctl.in),\r
index 5f1363c..a22222f 100644 (file)
@@ -198,8 +198,8 @@ al_send_sa_req(
        p_sa_req->ioctl.in.sa_req = *p_sa_req_data;\r
        cl_memcpy( p_sa_req->ioctl.in.attr,\r
                p_sa_req_data->p_attr, p_sa_req_data->attr_size );\r
-       p_sa_req->ioctl.in.ph_sa_req = (ULONG_PTR)&p_sa_req->hdl;\r
-       p_sa_req->ioctl.in.p_status = (ULONG_PTR)&p_sa_req->status;\r
+       p_sa_req->ioctl.in.ph_sa_req = &p_sa_req->hdl;\r
+       p_sa_req->ioctl.in.p_status = &p_sa_req->status;\r
 \r
        if( flags & IB_FLAGS_SYNC )\r
                h_dev = g_al_device;\r
@@ -299,7 +299,7 @@ al_cancel_sa_req(
        size_t                                          bytes_ret;\r
 \r
        AL_ENTER( AL_DBG_SA_REQ );\r
-\r
+    cl_memclr(&ioctl, sizeof(ioctl));\r
        ioctl.h_sa_req = p_sa_req->hdl;\r
 \r
        do_al_dev_ioctl(\r
index a9d0d1e..9327833 100644 (file)
@@ -200,7 +200,7 @@ ual_create_srq(
         */\r
        srq_ioctl.in.h_pd = h_pd->obj.hdl;\r
        srq_ioctl.in.srq_attr = *p_srq_attr;\r
-       srq_ioctl.in.context = (ULONG_PTR)h_srq;\r
+       srq_ioctl.in.context = h_srq;\r
        srq_ioctl.in.ev_notify = (h_srq->pfn_event_cb != NULL) ? TRUE : FALSE;\r
 \r
        cl_status = do_al_dev_ioctl( UAL_CREATE_SRQ,\r
index 0a67f0c..e62d8ae 100644 (file)
@@ -42,6 +42,7 @@
 #include <iba/ib_al.h>\r
 \r
 \r
+\r
 /*\r
 * Typedefs\r
 *\r
@@ -69,7 +70,7 @@
 */\r
 typedef struct _ual_bind_file_ioctl\r
 {\r
-       void* __ptr64                   h_file; /* __ptr64 is correct for HANDLE types. */\r
+       TO_LONG_PTR(void* ,                     h_file) ;\r
 \r
 }      ual_bind_file_ioctl_t;\r
 /*\r
@@ -145,7 +146,7 @@ typedef union _ual_open_ca_ioctl
        {\r
                ci_umv_buf_t                            umv_buf;\r
                ib_net64_t                                      guid;\r
-               uint64_t                                        context;\r
+               TO_LONG_PTR(void* ,                             context) ;\r
 \r
        }       in;\r
 \r
@@ -202,7 +203,7 @@ typedef union _ual_query_ca_ioctl
                ci_umv_buf_t                            umv_buf;\r
                uint64_t                                        h_ca;\r
                uint32_t                                        byte_cnt;\r
-               uint64_t                                        p_ca_attr;\r
+               TO_LONG_PTR(ib_ca_attr_t* ,             p_ca_attr) ;\r
 \r
        }       in;\r
        struct _ual_query_ca_ioctl_out\r
@@ -413,7 +414,7 @@ typedef union _ual_alloc_pd_ioctl
                ci_umv_buf_t                            umv_buf;\r
                uint64_t                                        h_ca;\r
                ib_pd_type_t                            type;\r
-               uint64_t                                        context;\r
+               TO_LONG_PTR(void* ,                             context) ;\r
 \r
        }       in;\r
        struct _ual_alloc_pd_ioctl_out\r
@@ -686,14 +687,14 @@ typedef union _ual_create_srq_ioctl
                ci_umv_buf_t                            umv_buf;\r
                uint64_t                                        h_pd;\r
                ib_srq_attr_t                           srq_attr;\r
-               uint64_t                                        context;\r
-               boolean_t                                       ev_notify;\r
+               TO_LONG_PTR(void* ,                             context) ;\r
+               boolean_t                               ev_notify;\r
 \r
        }       in;\r
        struct _ual_create_srq_ioctl_out\r
        {\r
                ci_umv_buf_t                            umv_buf;\r
-               ib_api_status_t                         status;\r
+               ib_api_status_t                 status;\r
                uint64_t                                        h_srq;\r
 \r
        }       out;\r
@@ -882,7 +883,7 @@ typedef union _ual_create_qp_ioctl
                ci_umv_buf_t                            umv_buf;\r
                uint64_t                                        h_pd;\r
                ib_qp_create_t                          qp_create;\r
-               uint64_t                                        context;\r
+               TO_LONG_PTR(void* ,                             context) ;\r
                boolean_t                                       ev_notify;\r
 \r
        }       in;\r
@@ -1085,8 +1086,8 @@ typedef union _ual_create_cq_ioctl
        {\r
                ci_umv_buf_t                            umv_buf;\r
                uint64_t                                        h_ca;\r
-               void* __ptr64                           h_wait_obj;     /* __ptr64 is correct for HANDLE types. */\r
-               uint64_t                                        context;\r
+               TO_LONG_PTR(void* ,                             h_wait_obj) ;\r
+               TO_LONG_PTR(void* ,                             context) ;\r
                uint32_t                                        size;\r
                boolean_t                                       ev_notify;\r
 \r
@@ -2287,9 +2288,9 @@ typedef union _ual_send_mad_ioctl
                uint64_t                                                h_mad_svc;\r
                uint64_t                                                pool_key;\r
                uint64_t                                                h_av;\r
-               uint64_t                                                p_mad_element;\r
+               TO_LONG_PTR(ib_mad_element_t* ,         p_mad_element) ;\r
                uint32_t                                                size;\r
-               uint64_t                                                ph_proxy;\r
+               TO_LONG_PTR(void* *, /*__ptr64*/                ph_proxy) ;\r
 \r
        }       in;\r
        struct _ual_send_mad_ioctl_out\r
@@ -2340,7 +2341,7 @@ typedef union _ual_cancel_mad_ioctl
        struct _ual_cancel_mad_ioctl_in\r
        {\r
                uint64_t                                        h_mad_svc;\r
-               uint64_t                                        h_proxy_element;\r
+               TO_LONG_PTR(void* ,                             h_proxy_element) ;\r
 \r
        }       in;\r
        struct _ual_cancel_mad_ioctl_out\r
@@ -2382,7 +2383,7 @@ typedef union _ual_spl_qp_ioctl
                uint64_t                                        h_pd;\r
                ib_net64_t                                      port_guid;\r
                ib_qp_create_t                          qp_create;\r
-               uint64_t                                        context;\r
+               TO_LONG_PTR(void* ,                             context) ;\r
 \r
        }       in;\r
        struct _ual_spl_qp_ioctl_out\r
@@ -2432,9 +2433,9 @@ typedef union _ual_mad_recv_ioctl
        struct _ual_mad_recv_comp_ioctl_in\r
        {\r
                uint64_t                                        h_mad;\r
-               uint64_t                                        p_user_mad;\r
-               uint64_t                                        p_mad_buf;\r
-               uint64_t                                        p_grh;\r
+               TO_LONG_PTR(ib_mad_element_t* , p_user_mad) ;\r
+               TO_LONG_PTR(ib_mad_t* ,                 p_mad_buf) ;\r
+               TO_LONG_PTR(ib_grh_t* ,                 p_grh) ;\r
 \r
        }       in;\r
        struct _ual_mad_recv_comp_ioctl_out\r
@@ -2480,13 +2481,13 @@ typedef union _ual_local_mad_ioctl
        {\r
                uint64_t                                        h_ca;\r
                __declspec(align(8)) uint8_t mad_in[MAD_BLOCK_SIZE];\r
-               uint8_t                                 port_num;\r
+               uint8_t                                         port_num;\r
                \r
                \r
        }       in;\r
        struct _ual_local_mad_ioctl_out\r
        {\r
-               ib_api_status_t                 status;\r
+               ib_api_status_t                         status;\r
                uint32_t                                        _pad; /* 8-byte alignment needed for ia64 */\r
                __declspec(align(8)) uint8_t mad_out[MAD_BLOCK_SIZE];\r
 \r
@@ -2536,6 +2537,29 @@ typedef struct _ual_create_cep_ioctl
 *              CID of the created CEP.\r
 *****/\r
 \r
+/****s* User-mode Access Layer/ual_create_cep_ioctl_in\r
+* NAME\r
+*      ual_create_cep_ioctl_in\r
+*\r
+* DESCRIPTION\r
+*      IOCTL structure containing the input parameters to\r
+*      create a CEP.\r
+*\r
+* SYNOPSIS\r
+*/\r
+\r
+typedef struct _ual_create_cep_ioctl_in\r
+{\r
+    TO_LONG_PTR(void* , context);\r
+} ual_create_cep_ioctl_in;\r
+\r
+/*\r
+* FIELDS\r
+*      context\r
+*              \r
+*              \r
+*****/\r
+\r
 \r
 /****s* User-mode Access Layer/ual_cep_listen_ioctl_t\r
 * NAME\r
@@ -2629,7 +2653,7 @@ typedef union _ual_cep_rep_ioctl
 {\r
        struct _ual_cep_rep_ioctl_in\r
        {\r
-               uint64_t                                        context;\r
+               TO_LONG_PTR(void* ,                             context) ;\r
                net32_t                                         cid;\r
                ib_cm_rep_t                                     cm_rep;\r
                uint8_t                                         pdata[IB_REP_PDATA_SIZE];\r
@@ -3053,7 +3077,7 @@ typedef struct _ual_cep_get_timewait_ioctl
 typedef struct _ual_cep_poll_ioctl\r
 {\r
        ib_api_status_t                         status;\r
-       uint64_t                                        context;\r
+       TO_LONG_PTR(void* ,                             context) ;\r
        net32_t                                         new_cid;\r
        ib_mad_element_t                        element;\r
        ib_grh_t                                        grh;\r
@@ -3205,8 +3229,8 @@ typedef union _ual_send_sa_req_ioctl
                uint32_t                                        retry_cnt;\r
                ib_user_query_t                         sa_req;\r
                uint8_t                                         attr[IB_SA_DATA_SIZE];\r
-               uint64_t                                        ph_sa_req;\r
-               uint64_t                                        p_status;\r
+               TO_LONG_PTR(uint64_t* ,                 ph_sa_req) ;\r
+               TO_LONG_PTR(ib_api_status_t* ,  p_status) ;\r
 \r
        }       in;\r
        struct _ual_send_sa_req_ioctl_out\r
@@ -3281,9 +3305,9 @@ typedef struct _ual_cancel_sa_req_ioctl
 typedef struct _ual_reg_pnp_ioctl_in\r
 {\r
        ib_pnp_class_t                          pnp_class;\r
-       void* __ptr64                           sync_event; /* __ptr64 is correct for HANDLE types. */\r
-       uint64_t                                        p_status;\r
-       uint64_t                                        p_hdl;\r
+       TO_LONG_PTR(void* ,                             sync_event) ;\r
+       TO_LONG_PTR(ib_api_status_t* ,  p_status) ;\r
+       TO_LONG_PTR(uint64_t* ,                 p_hdl) ;\r
 \r
 }      ual_reg_pnp_ioctl_in_t;\r
 /*\r
@@ -3357,7 +3381,7 @@ typedef struct _ual_rearm_pnp_ioctl_in
 {\r
        uint64_t                                        pnp_hdl;\r
        uint64_t                                        last_evt_hdl;\r
-       uint64_t                                        last_evt_context;\r
+       TO_LONG_PTR(void* ,                             last_evt_context) ;\r
        ib_api_status_t                         last_evt_status;\r
 \r
 }      ual_rearm_pnp_ioctl_in_t;\r
@@ -3484,7 +3508,6 @@ typedef struct _ual_ndi_req_cm_ioctl_in
        uint64_t                                        h_qp;\r
        net64_t                                         guid;\r
        uint16_t                                        dst_port;\r
-    uint16_t                    pkey;\r
     uint8_t                     resp_res;\r
     uint8_t                     init_depth;\r
        uint8_t                                         prot;\r
@@ -3506,9 +3529,6 @@ typedef struct _ual_ndi_req_cm_ioctl_in
 *      dst_port\r
 *              Destination port number.\r
 *\r
-*   pkey\r
-*       Partition key.\r
-*\r
 *   resp_res\r
 *       Responder resources for the QP.\r
 *\r
@@ -3563,7 +3583,7 @@ typedef struct _ual_ndi_rep_cm_ioctl_in
 *      resp_res\r
 *              The maximum number of RDMA read/atomic operations from the recipient.\r
 *\r
-*      pdata_size\r
+*      pdata_size\r
 *              The size of following private data\r
 *\r
 *      pdata\r
@@ -3596,7 +3616,7 @@ typedef struct _ual_ndi_rej_cm_ioctl_in
 *      cid\r
 *              Connection ID.\r
 *\r
-*      pdata_size\r
+*      pdata_size\r
 *              The size of following private data\r
 *\r
 *      pdata\r
index 72ea850..fb42388 100644 (file)
@@ -40,6 +40,7 @@
 #include <complib/cl_types.h>\r
 #include <complib/cl_byteswap.h>\r
 \r
+#define HDL_TO_PTR(hdl) Handle64ToHandle( (void * __ptr64) (hdl))\r
 \r
 #pragma warning( disable : 4201) //nameless union/structure\r
 \r