typedef void\r
(*al_pfn_cep_cb_t)(\r
IN const ib_al_handle_t h_al,\r
- IN ib_cep_t* const p_cep );\r
+ IN const net32_t cid );\r
/* PARAMETERS\r
* h_al\r
* [in] Handle to the AL instance to pass into the al_cep_poll call.\r
*\r
-* p_cep\r
-* [in] Pointer to an ib_cep_t structure containing the CID and context\r
-* for the CEP on which the event occured. The CID should be passed\r
-* into the al_cep_poll call.\r
+* cid\r
+* [in] CID of the CEP on which the event occurred. The CID should\r
+* be passed into the al_cep_poll call.\r
*\r
* RETURN VALUES:\r
* This function does not return a value.\r
al_create_cep(\r
IN ib_al_handle_t h_al,\r
IN al_pfn_cep_cb_t pfn_cb,\r
- IN void *context,\r
+ IN void* __ptr64 context,\r
OUT net32_t* const p_cid );\r
/*\r
* NOTES\r
IN net32_t cid,\r
IN ib_pfn_destroy_cb_t pfn_destroy_cb );\r
/*\r
-* NOTES\r
-* Destruction is synchronous.\r
-* Clients must not invoke this function from a CEP callback, but should\r
-* instead return IB_CANCELLED or other appropriate value.\r
-*\r
-* The reason parameter is passed as input to KeWaitForSingleObject.\r
-* The user-mode proxy sets this to UserRequest. Kernel clients should set\r
-* this to Executive.\r
*********/\r
\r
ib_api_status_t\r
al_cep_pre_rep(\r
IN ib_al_handle_t h_al,\r
IN net32_t cid,\r
- IN void *context,\r
+ IN void* __ptr64 context,\r
IN const ib_cm_rep_t* const p_cm_rep,\r
OUT ib_qp_mod_t* const p_init );\r
\r
al_cep_poll(\r
IN ib_al_handle_t h_al,\r
IN net32_t cid,\r
- IN OUT ib_cep_t* const p_new_cep,\r
+ OUT void* __ptr64 * p_context,\r
+ OUT net32_t* const p_new_cid,\r
OUT ib_mad_element_t** const pp_mad );\r
\r
\r
{\r
cl_async_proc_item_t item;\r
ib_al_handle_t h_al;\r
- ib_cep_t cep;\r
+ net32_t cid;\r
\r
} cep_async_mad_t;\r
\r
static void\r
__listen_req(\r
IN al_listen_t* const p_listen,\r
- IN const ib_cep_t* const p_new_cep,\r
+ IN const net32_t new_cid,\r
IN const mad_cm_req_t* const p_req )\r
{\r
ib_cm_req_rec_t req_rec;\r
AL_ENTER( AL_DBG_CM );\r
\r
CL_ASSERT( p_listen );\r
- CL_ASSERT( p_new_cep );\r
+ CL_ASSERT( new_cid != AL_INVALID_CID );\r
CL_ASSERT( p_req );\r
\r
/* Format the callback record. */\r
/* update listen based rec */\r
req_rec.context = p_listen->obj.context;\r
\r
- req_rec.h_cm_req.cid = p_new_cep->cid;\r
+ req_rec.h_cm_req.cid = new_cid;\r
req_rec.h_cm_req.h_al = p_listen->obj.h_al;\r
- req_rec.h_cm_req.h_qp = p_new_cep->context;\r
+ req_rec.h_cm_req.h_qp = NULL;\r
\r
req_rec.h_cm_listen = p_listen;\r
\r
static void\r
__proc_listen(\r
IN al_listen_t* const p_listen,\r
- IN ib_cep_t* const p_new_cep,\r
+ IN const net32_t new_cid,\r
IN const ib_mad_t* const p_mad )\r
{\r
AL_ENTER( AL_DBG_CM );\r
{\r
case CM_REQ_ATTR_ID:\r
__listen_req(\r
- p_listen, p_new_cep, (mad_cm_req_t*)p_mad );\r
+ p_listen, new_cid, (mad_cm_req_t*)p_mad );\r
break;\r
\r
case CM_SIDR_REQ_ATTR_ID:\r
CL_ASSERT( p_mad->attr_id == CM_REQ_ATTR_ID ||\r
p_mad->attr_id == CM_SIDR_REQ_ATTR_ID );\r
/* Destroy the new CEP as it won't ever be reported to the user. */\r
- al_destroy_cep( p_listen->obj.h_al, p_new_cep->cid, NULL );\r
+ al_destroy_cep( p_listen->obj.h_al, new_cid, NULL );\r
}\r
\r
AL_EXIT( AL_DBG_CM );\r
switch( p_mad->attr_id )\r
{\r
case CM_REQ_ATTR_ID:\r
+ CL_ASSERT( ((al_conn_qp_t*)p_cm->h_qp)->cid == (int32_t)p_cm->cid ||\r
+ ((al_conn_qp_t*)p_cm->h_qp)->cid == AL_INVALID_CID );\r
__proc_peer_req( p_cm, (mad_cm_req_t*)p_mad );\r
break;\r
\r
case CM_MRA_ATTR_ID:\r
+ CL_ASSERT( ((al_conn_qp_t*)p_cm->h_qp)->cid == (int32_t)p_cm->cid ||\r
+ ((al_conn_qp_t*)p_cm->h_qp)->cid == AL_INVALID_CID );\r
__proc_mra( p_cm, (mad_cm_mra_t*)p_mad );\r
break;\r
\r
break;\r
\r
case CM_REP_ATTR_ID:\r
+ CL_ASSERT( ((al_conn_qp_t*)p_cm->h_qp)->cid == (int32_t)p_cm->cid ||\r
+ ((al_conn_qp_t*)p_cm->h_qp)->cid == AL_INVALID_CID );\r
__proc_rep( p_cm, (mad_cm_rep_t*)p_mad );\r
break;\r
\r
case CM_RTU_ATTR_ID:\r
+ CL_ASSERT( ((al_conn_qp_t*)p_cm->h_qp)->cid == (int32_t)p_cm->cid ||\r
+ ((al_conn_qp_t*)p_cm->h_qp)->cid == AL_INVALID_CID );\r
__proc_rtu( p_cm, (mad_cm_rtu_t*)p_mad );\r
break;\r
\r
case CM_DREQ_ATTR_ID:\r
+ CL_ASSERT( ((al_conn_qp_t*)p_cm->h_qp)->cid == (int32_t)p_cm->cid ||\r
+ ((al_conn_qp_t*)p_cm->h_qp)->cid == AL_INVALID_CID );\r
__proc_dreq( p_cm, (mad_cm_dreq_t*)p_mad );\r
break;\r
\r
case CM_DREP_ATTR_ID:\r
+ CL_ASSERT( ((al_conn_qp_t*)p_cm->h_qp)->cid == (int32_t)p_cm->cid ||\r
+ ((al_conn_qp_t*)p_cm->h_qp)->cid == AL_INVALID_CID );\r
__proc_drep( p_cm, (mad_cm_drep_t*)p_mad );\r
break;\r
\r
case CM_LAP_ATTR_ID:\r
+ CL_ASSERT( ((al_conn_qp_t*)p_cm->h_qp)->cid == (int32_t)p_cm->cid ||\r
+ ((al_conn_qp_t*)p_cm->h_qp)->cid == AL_INVALID_CID );\r
__proc_lap( p_cm, (mad_cm_lap_t*)p_mad );\r
break;\r
\r
case CM_APR_ATTR_ID:\r
+ CL_ASSERT( ((al_conn_qp_t*)p_cm->h_qp)->cid == (int32_t)p_cm->cid ||\r
+ ((al_conn_qp_t*)p_cm->h_qp)->cid == AL_INVALID_CID );\r
__proc_apr( p_cm, (mad_cm_apr_t*)p_mad );\r
break;\r
\r
__cm_handler(\r
#endif\r
IN const ib_al_handle_t h_al,\r
- IN ib_cep_t* const p_cep )\r
+ IN const net32_t cid )\r
{\r
ib_api_status_t status;\r
- ib_cep_t new_cep;\r
+ void* __ptr64 context;\r
+ net32_t new_cid;\r
ib_mad_element_t *p_mad;\r
ib_cm_handle_t h_cm;\r
\r
AL_ENTER( AL_DBG_CM );\r
\r
- for( status = al_cep_poll( h_al, p_cep->cid, &new_cep, &p_mad );\r
+ for( status = al_cep_poll( h_al, cid, &context, &new_cid, &p_mad );\r
status == IB_SUCCESS;\r
- status = al_cep_poll( h_al, p_cep->cid, &new_cep, &p_mad ) )\r
+ status = al_cep_poll( h_al, cid, &context, &new_cid, &p_mad ) )\r
{\r
/* Something to do - WOOT!!! */\r
- if( new_cep.cid != AL_INVALID_CID )\r
+ if( new_cid != AL_INVALID_CID )\r
{\r
- __proc_listen( (al_listen_t*)p_cep->context,\r
- &new_cep, ib_get_mad_buf( p_mad ) );\r
+ __proc_listen( (al_listen_t* __ptr64)context,\r
+ new_cid, ib_get_mad_buf( p_mad ) );\r
}\r
else if( p_mad->status != IB_SUCCESS )\r
{\r
/* Context is a QP handle, and a sent MAD timed out. */\r
__proc_failed_send(\r
- (ib_qp_handle_t)p_cep->context, ib_get_mad_buf( p_mad ) );\r
+ (ib_qp_handle_t)context, ib_get_mad_buf( p_mad ) );\r
}\r
else\r
{\r
h_cm.h_al = h_al;\r
- h_cm.cid = p_cep->cid;\r
- h_cm.h_qp = (ib_qp_handle_t)p_cep->context;\r
+ h_cm.cid = cid;\r
+ h_cm.h_qp = (ib_qp_handle_t)context;\r
__proc_conn( &h_cm, ib_get_mad_buf( p_mad ) );\r
}\r
ib_put_mad( p_mad );\r
\r
p_async_mad = PARENT_STRUCT( p_item, cep_async_mad_t, item );\r
\r
- __process_cep_cb( p_async_mad->h_al, &p_async_mad->cep );\r
+ __process_cep_cb( p_async_mad->h_al, p_async_mad->cid );\r
\r
cl_free( p_async_mad );\r
\r
static void\r
__cm_handler(\r
IN const ib_al_handle_t h_al,\r
- IN ib_cep_t* const p_cep )\r
+ IN const net32_t cid )\r
{\r
cep_async_mad_t *p_async_mad;\r
\r
}\r
\r
p_async_mad->h_al = h_al;\r
- p_async_mad->cep = *p_cep;\r
+ p_async_mad->cid = cid;\r
p_async_mad->item.pfn_callback = __process_cep_async;\r
\r
/* Queue the MAD for asynchronous processing. */\r
static ib_api_status_t\r
__cep_pre_rep(\r
IN const ib_cm_handle_t h_cm,\r
+ IN ib_qp_mod_t* const p_qp_mod,\r
IN const ib_cm_rep_t* const p_cm_rep )\r
{\r
ib_api_status_t status;\r
- al_conn_qp_t *p_qp;\r
- ib_qp_mod_t qp_mod;\r
\r
AL_ENTER( AL_DBG_CM );\r
\r
- p_qp = (al_conn_qp_t*)p_cm_rep->h_qp;\r
-\r
- status = al_cep_pre_rep(\r
- h_cm.h_al, h_cm.cid, p_cm_rep->h_qp, p_cm_rep, &qp_mod );\r
- if( status != IB_SUCCESS )\r
- {\r
- AL_TRACE_EXIT( AL_DBG_ERROR,\r
- ("al_cep_pre_rep returned %s.\n", ib_get_err_str( status )) );\r
- return status;\r
- }\r
-\r
/* Transition the QP to the INIT state. */\r
- qp_mod.state.init.access_ctrl = p_cm_rep->access_ctrl;\r
- status = __cep_init_qp( p_cm_rep->h_qp, &qp_mod );\r
+ p_qp_mod->state.init.access_ctrl = p_cm_rep->access_ctrl;\r
+ status = __cep_init_qp( p_cm_rep->h_qp, p_qp_mod );\r
if( status != IB_SUCCESS )\r
{\r
AL_TRACE_EXIT( AL_DBG_ERROR,\r
{\r
ib_api_status_t status;\r
net32_t cid;\r
+ ib_qp_mod_t qp_mod;\r
+ boolean_t qp_linked = FALSE;\r
\r
AL_ENTER( AL_DBG_CM );\r
\r
((al_conn_qp_t*)p_cm_rep->h_qp)->pfn_cm_lap_cb = p_cm_rep->pfn_cm_lap_cb;\r
((al_conn_qp_t*)p_cm_rep->h_qp)->pfn_cm_dreq_cb = p_cm_rep->pfn_cm_dreq_cb;\r
\r
+ status = al_cep_pre_rep(\r
+ h_cm.h_al, h_cm.cid, p_cm_rep->h_qp, p_cm_rep, &qp_mod );\r
+ if( status != IB_SUCCESS )\r
+ {\r
+ AL_TRACE_EXIT( AL_DBG_ERROR,\r
+ ("al_cep_pre_rep returned %s.\n", ib_get_err_str( status )) );\r
+ goto err;\r
+ }\r
+\r
+ /* The QP has been set as the context for the CEP. */\r
+ qp_linked = TRUE;\r
+\r
/* Transition QP through state machine */\r
- status = __cep_pre_rep( h_cm, p_cm_rep );\r
+ status = __cep_pre_rep( h_cm, &qp_mod, p_cm_rep );\r
if( status != IB_SUCCESS )\r
{\r
AL_TRACE_EXIT( AL_DBG_ERROR,\r
cl_atomic_xchg(\r
&((al_conn_qp_t*)p_cm_rep->h_qp)->cid, AL_INVALID_CID );\r
\r
- ref_al_obj( &p_cm_rep->h_qp->obj );\r
-\r
/* Reject and abort the connection. */\r
al_cep_rej( h_cm.h_al, h_cm.cid, IB_REJ_INSUF_QP, NULL, 0, NULL, 0 );\r
\r
- if( al_destroy_cep( h_cm.h_al, h_cm.cid, deref_al_obj ) != IB_SUCCESS )\r
- deref_al_obj( &p_cm_rep->h_qp->obj );\r
+ if( qp_linked )\r
+ {\r
+ ref_al_obj( &p_cm_rep->h_qp->obj );\r
+\r
+ if( al_destroy_cep( h_cm.h_al, h_cm.cid, deref_al_obj ) != IB_SUCCESS )\r
+ deref_al_obj( &p_cm_rep->h_qp->obj );\r
+ }\r
+ else\r
+ {\r
+ al_destroy_cep( h_cm.h_al, h_cm.cid, NULL );\r
+ }\r
}\r
\r
AL_EXIT( AL_DBG_CM );\r
AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
status = IB_INVALID_QP_HANDLE;\r
}\r
- if( p_cm_rep->h_qp->obj.h_al != h_cm_req.h_al )\r
+ else if( p_cm_rep->h_qp->obj.h_al != h_cm_req.h_al )\r
{\r
AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
status = IB_INVALID_QP_HANDLE;\r
\r
typedef struct _al_kcep\r
{\r
- ib_cep_t cep;\r
+ net32_t cid;\r
+ void* context;\r
\r
struct _cep_cid *p_cid;\r
\r
IN kcep_t* const p_cep,\r
IN ib_al_handle_t h_al,\r
IN al_pfn_cep_cb_t pfn_cb,\r
- IN void *context );\r
+ IN void* __ptr64 context );\r
\r
static inline void\r
__unbind_cep(\r
\r
done:\r
pfn_destroy_cb = p_cep->pfn_destroy_cb;\r
- cep_context = p_cep->cep.context;\r
+ cep_context = p_cep->context;\r
\r
if( !cl_atomic_dec( &p_cep->ref_cnt ) && pfn_destroy_cb )\r
pfn_destroy_cb( cep_context );\r
/* Mask off the counter bits so we get the index in our vector. */\r
idx = cid & CEP_MAX_CID_MASK;\r
\r
- /*\r
- * Remove the CEP from the CID vector - no further API calls\r
- * will succeed for it.\r
- */\r
- if( idx > cl_vector_get_size( &gp_cep_mgr->cid_vector ) )\r
+ if( idx >= cl_vector_get_size( &gp_cep_mgr->cid_vector ) )\r
return NULL;\r
\r
p_cid = (cep_cid_t*)cl_vector_get_ptr( &gp_cep_mgr->cid_vector, idx );\r
\r
/* Signal to the user there are callback waiting. */\r
if( p_cep->pfn_cb )\r
- p_cep->pfn_cb( p_cep->p_cid->h_al, &p_cep->cep );\r
+ p_cep->pfn_cb( p_cep->p_cid->h_al, p_cep->cid );\r
else\r
__cep_complete_irp( p_cep, STATUS_SUCCESS, IO_NETWORK_INCREMENT );\r
\r
pfn_destroy_cb = p_cep->pfn_destroy_cb;\r
- context = p_cep->cep.context;\r
+ context = p_cep->context;\r
\r
/*\r
* Release the reference for the callback and invoke the destroy\r
p_cep->signalled = FALSE;\r
\r
/* Find a free entry in the CID vector. */\r
- p_cep->p_cid = __get_lcid( &p_cep->cep.cid );\r
+ p_cep->p_cid = __get_lcid( &p_cep->cid );\r
\r
if( !p_cep->p_cid )\r
{\r
* We don't ever want a modifier of zero for the CID at index zero\r
* since it would result in a total CID of zero.\r
*/\r
- if( !p_cep->cep.cid && !p_cep->p_cid->modifier )\r
+ if( !p_cep->cid && !p_cep->p_cid->modifier )\r
p_cep->p_cid->modifier++;\r
\r
- p_cep->local_comm_id = p_cep->cep.cid | (p_cep->p_cid->modifier << 24);\r
+ p_cep->local_comm_id = p_cep->cid | (p_cep->p_cid->modifier << 24);\r
p_cep->tid = p_cep->local_comm_id;\r
\r
p_cep->p_cid->p_cep = p_cep;\r
IN kcep_t* const p_cep,\r
IN ib_al_handle_t h_al,\r
IN al_pfn_cep_cb_t pfn_cb,\r
- IN void *context )\r
+ IN void* __ptr64 context )\r
{\r
CL_ASSERT( p_cep );\r
CL_ASSERT( p_cep->p_cid );\r
\r
p_cep->p_cid->h_al = h_al;\r
p_cep->pfn_cb = pfn_cb;\r
- p_cep->cep.context = context;\r
+ p_cep->context = context;\r
\r
/* Track the CEP in its owning AL instance. */\r
cl_spinlock_acquire( &h_al->obj.lock );\r
AL_ENTER( AL_DBG_CM );\r
\r
CL_ASSERT(\r
- p_cep->cep.cid < cl_vector_get_size( &gp_cep_mgr->cid_vector ) );\r
+ p_cep->cid < cl_vector_get_size( &gp_cep_mgr->cid_vector ) );\r
\r
CL_ASSERT( p_cep->p_cid == (cep_cid_t*)cl_vector_get_ptr(\r
- &gp_cep_mgr->cid_vector, p_cep->cep.cid ) );\r
+ &gp_cep_mgr->cid_vector, p_cep->cid ) );\r
\r
/* Free the CID. */\r
p_cep->p_cid->p_cep = (kcep_t*)(uintn_t)gp_cep_mgr->free_cid;\r
p_cep->p_cid->h_al = NULL;\r
- gp_cep_mgr->free_cid = p_cep->cep.cid;\r
+ gp_cep_mgr->free_cid = p_cep->cid;\r
\r
KeCancelTimer( &p_cep->timewait_timer );\r
\r
al_create_cep(\r
IN ib_al_handle_t h_al,\r
IN al_pfn_cep_cb_t pfn_cb,\r
- IN void *context,\r
+ IN void* __ptr64 context,\r
OUT net32_t* const p_cid )\r
{\r
kcep_t *p_cep;\r
\r
__bind_cep( p_cep, h_al, pfn_cb, context );\r
\r
- *p_cid = p_cep->cep.cid;\r
+ *p_cid = p_cep->cid;\r
\r
AL_EXIT( AL_DBG_CM );\r
return IB_SUCCESS;\r
return IB_INVALID_PARAMETER;\r
}\r
\r
- context = p_cep->cep.context;\r
+ context = p_cep->context;\r
p_cep->pfn_destroy_cb = pfn_destroy_cb;\r
\r
/* Cancel any queued IRP */\r
* We don't ever want a modifier of zero for the CID at index zero\r
* since it would result in a total CID of zero.\r
*/\r
- if( !p_cep->cep.cid && !p_cep->p_cid->modifier )\r
+ if( !p_cep->cid && !p_cep->p_cid->modifier )\r
p_cep->p_cid->modifier++;\r
\r
/* Store pertinent information in the connection. */\r
- p_cep->local_comm_id = p_cep->cep.cid | (p_cep->p_cid->modifier << 24);\r
+ p_cep->local_comm_id = p_cep->cid | (p_cep->p_cid->modifier << 24);\r
p_cep->remote_comm_id = 0;\r
\r
/* Cache the local QPN. */\r
al_cep_pre_rep(\r
IN ib_al_handle_t h_al,\r
IN net32_t cid,\r
- IN void *context,\r
+ IN void* __ptr64 context,\r
IN const ib_cm_rep_t* const p_cm_rep,\r
OUT ib_qp_mod_t* const p_init )\r
{\r
p_cep->av[p_cep->idx_primary].pkey_index;\r
p_init->state.init.access_ctrl = IB_AC_LOCAL_WRITE;\r
\r
- p_cep->cep.context = context;\r
+ p_cep->context = context;\r
\r
/* Just OR in the PREP bit into the state. */\r
p_cep->state |= CEP_STATE_PREP;\r
al_cep_poll(\r
IN ib_al_handle_t h_al,\r
IN net32_t cid,\r
- IN OUT ib_cep_t* const p_new_cep,\r
+ OUT void* __ptr64 * p_context,\r
+ OUT net32_t* const p_new_cid,\r
OUT ib_mad_element_t** const pp_mad )\r
{\r
ib_api_status_t status;\r
AL_ENTER( AL_DBG_CM );\r
\r
CL_ASSERT( h_al );\r
- CL_ASSERT( p_new_cep );\r
+ CL_ASSERT( p_new_cid );\r
CL_ASSERT( pp_mad );\r
\r
KeAcquireInStackQueuedSpinLock( &gp_cep_mgr->lock, &hdl );\r
return IB_INVALID_HANDLE;\r
}\r
\r
+ *p_context = p_cep->context;\r
+\r
if( !p_cep->p_mad_head )\r
{\r
p_cep->signalled = FALSE;\r
/* We're done with the input CEP. Reuse the variable */\r
p_cep = (kcep_t* __ptr64)(*pp_mad)->send_context1;\r
if( p_cep )\r
- {\r
- *p_new_cep = p_cep->cep;\r
- }\r
+ *p_new_cid = p_cep->cid;\r
else\r
- {\r
- p_new_cep->context = NULL;\r
- p_new_cep->cid = AL_INVALID_CID;\r
- }\r
+ *p_new_cid = AL_INVALID_CID;\r
\r
status = IB_SUCCESS;\r
\r
* remove it from the list, allowing the next CEP to be cleaned up\r
* in the next pass through.\r
*/\r
- cid = PARENT_STRUCT( p_item, kcep_t, al_item )->cep.cid;\r
+ cid = PARENT_STRUCT( p_item, kcep_t, al_item )->cid;\r
cl_spinlock_release( &h_al->obj.lock );\r
al_destroy_cep( h_al, cid, NULL );\r
cl_spinlock_acquire( &h_al->obj.lock );\r
OUT size_t *p_ret_bytes )\r
{\r
al_dev_open_context_t *p_context;\r
+ void* __ptr64 * p_user_context;\r
ual_create_cep_ioctl_t *p_ioctl;\r
\r
AL_ENTER( AL_DBG_CM );\r
p_ioctl = (ual_create_cep_ioctl_t*)cl_ioctl_out_buf( h_ioctl );\r
\r
/* Validate user parameters. */\r
- if( cl_ioctl_out_size( h_ioctl ) != sizeof(ual_create_cep_ioctl_t) )\r
+ if( cl_ioctl_in_size( h_ioctl ) != sizeof(void* __ptr64) ||\r
+ cl_ioctl_out_size( h_ioctl ) != sizeof(ual_create_cep_ioctl_t) )\r
{\r
AL_EXIT( AL_DBG_CM );\r
return CL_INVALID_PARAMETER;\r
}\r
\r
+ p_user_context = cl_ioctl_in_buf( h_ioctl );\r
+\r
/* We use IRPs as notification mechanism so the callback is NULL. */\r
p_ioctl->status = al_create_cep( p_context->h_al, NULL,\r
- p_context, &p_ioctl->cid );\r
+ *p_user_context, &p_ioctl->cid );\r
\r
*p_ret_bytes = sizeof(ual_create_cep_ioctl_t);\r
\r
p_ioctl->in.cm_rep.h_qp = h_qp;\r
\r
p_ioctl->out.status = al_cep_pre_rep( p_context->h_al, p_ioctl->in.cid,\r
- p_context, &p_ioctl->in.cm_rep, &p_ioctl->out.init );\r
+ p_ioctl->in.context, &p_ioctl->in.cm_rep, &p_ioctl->out.init );\r
\r
deref_al_obj( &h_qp->obj );\r
\r
*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 ), &p_ioctl->new_cep, &p_mad );\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
{\r
else\r
{\r
cl_memclr( &p_ioctl->mad_buf, sizeof(MAD_BLOCK_SIZE) );\r
- cl_memclr( &p_ioctl->new_cep, sizeof(ib_cep_t) );\r
+ p_ioctl->new_cid = AL_INVALID_CID;\r
}\r
\r
AL_EXIT( AL_DBG_CM );\r
\r
typedef struct _al_ucep\r
{\r
- ib_cep_t cep;\r
al_pfn_cep_cb_t pfn_cb;\r
ib_al_handle_t h_al;\r
cl_list_item_t al_item;\r
\r
ib_pfn_destroy_cb_t pfn_destroy_cb;\r
+ void* destroy_context;\r
+ net32_t cid;\r
\r
OVERLAPPED ov;\r
atomic32_t ref_cnt;\r
* remove it from the list, allowing the next CEP to be cleaned up\r
* in the next pass through.\r
*/\r
- cid = PARENT_STRUCT( p_item, ucep_t, al_item )->cep.cid;\r
+ cid = PARENT_STRUCT( p_item, ucep_t, al_item )->cid;\r
cl_spinlock_release( &h_al->obj.lock );\r
al_destroy_cep( h_al, cid, NULL );\r
cl_spinlock_acquire( &h_al->obj.lock );\r
IN ucep_t* const p_cep )\r
{\r
if( p_cep->pfn_destroy_cb )\r
- p_cep->pfn_destroy_cb( p_cep->cep.context );\r
+ p_cep->pfn_destroy_cb( p_cep->destroy_context );\r
cl_free( p_cep );\r
}\r
\r
IN ib_al_handle_t h_al,\r
IN net32_t cid,\r
IN al_pfn_cep_cb_t pfn_cb,\r
- IN void *context,\r
+ IN void* __ptr64 context,\r
OUT net32_t* const p_cid )\r
{\r
ucep_t *p_cep;\r
\r
/* Store user parameters. */\r
p_cep->pfn_cb = pfn_cb;\r
- p_cep->cep.context = context;\r
+ p_cep->destroy_context = context;\r
\r
/* Create a kernel CEP only if we don't already have a CID. */\r
if( cid == AL_INVALID_CID )\r
{\r
- if( !DeviceIoControl( g_al_device, UAL_CREATE_CEP, NULL, 0,\r
- &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
return ioctl.status;\r
}\r
\r
- p_cep->cep.cid = ioctl.cid;\r
+ p_cep->cid = ioctl.cid;\r
}\r
else\r
{\r
- p_cep->cep.cid = cid;\r
+ p_cep->cid = cid;\r
}\r
\r
/* Track the CEP before we issue any further IOCTLs on it. */\r
cl_spinlock_acquire( &gp_cep_mgr->obj.lock );\r
- cl_ptr_vector_set_min_size( &gp_cep_mgr->cep_vector, p_cep->cep.cid + 1 );\r
- CL_ASSERT( !cl_ptr_vector_get( &gp_cep_mgr->cep_vector, p_cep->cep.cid ) );\r
- cl_ptr_vector_set( &gp_cep_mgr->cep_vector, p_cep->cep.cid, p_cep );\r
+ cl_ptr_vector_set_min_size( &gp_cep_mgr->cep_vector, p_cep->cid + 1 );\r
+ CL_ASSERT( !cl_ptr_vector_get( &gp_cep_mgr->cep_vector, p_cep->cid ) );\r
+ cl_ptr_vector_set( &gp_cep_mgr->cep_vector, p_cep->cid, p_cep );\r
cl_spinlock_release( &gp_cep_mgr->obj.lock );\r
\r
/* Now issue a poll request. This request is async. */\r
if( DeviceIoControl( gp_cep_mgr->h_file, UAL_CEP_GET_EVENT,\r
- &p_cep->cep.cid, sizeof(p_cep->cep.cid),\r
+ &p_cep->cid, sizeof(p_cep->cid),\r
NULL, 0, NULL, &p_cep->ov ) ||\r
GetLastError() != ERROR_IO_PENDING )\r
{\r
AL_TRACE( AL_DBG_ERROR, ("Failed to issue CEP poll IOCTL.\n") );\r
cl_spinlock_acquire( &gp_cep_mgr->obj.lock );\r
- cl_ptr_vector_set( &gp_cep_mgr->cep_vector, p_cep->cep.cid, NULL );\r
+ cl_ptr_vector_set( &gp_cep_mgr->cep_vector, p_cep->cid, NULL );\r
cl_spinlock_release( &gp_cep_mgr->obj.lock );\r
\r
- DeviceIoControl( g_al_device, UAL_DESTROY_CEP, &p_cep->cep.cid,\r
- sizeof(p_cep->cep.cid), NULL, 0, &bytes_ret, NULL );\r
+ DeviceIoControl( g_al_device, UAL_DESTROY_CEP, &p_cep->cid,\r
+ sizeof(p_cep->cid), NULL, 0, &bytes_ret, NULL );\r
\r
__destroy_ucep( p_cep );\r
AL_EXIT( AL_DBG_CM );\r
cl_spinlock_release( &h_al->obj.lock );\r
\r
if( p_cid )\r
- *p_cid = p_cep->cep.cid;\r
+ *p_cid = p_cep->cid;\r
\r
AL_EXIT( AL_DBG_CM );\r
return IB_SUCCESS;\r
al_create_cep(\r
IN ib_al_handle_t h_al,\r
IN al_pfn_cep_cb_t pfn_cb,\r
- IN void *context,\r
+ IN void* __ptr64 context,\r
OUT net32_t* const p_cid )\r
{\r
ib_api_status_t status;\r
cl_spinlock_release( &h_al->obj.lock );\r
\r
/* Destroy the kernel CEP right away. */\r
- DeviceIoControl( g_al_device, UAL_DESTROY_CEP, &p_cep->cep.cid,\r
- sizeof(p_cep->cep.cid), NULL, 0, &bytes_ret, NULL );\r
+ DeviceIoControl( g_al_device, UAL_DESTROY_CEP, &p_cep->cid,\r
+ sizeof(p_cep->cid), NULL, 0, &bytes_ret, NULL );\r
\r
if( !cl_atomic_dec( &p_cep->ref_cnt ) )\r
{\r
al_cep_pre_rep(\r
IN ib_al_handle_t h_al,\r
IN net32_t cid,\r
- IN void *context,\r
+ IN void* __ptr64 context,\r
IN const ib_cm_rep_t* const p_cm_rep,\r
OUT ib_qp_mod_t* const p_init )\r
{\r
AL_EXIT( AL_DBG_ERROR );\r
return IB_INVALID_PARAMETER;\r
}\r
- p_cep->cep.context = context;\r
+ p_cep->destroy_context = context;\r
cl_spinlock_release( &gp_cep_mgr->obj.lock );\r
\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 = (ib_qp_handle_t)p_cm_rep->h_qp->obj.hdl;\r
al_cep_poll(\r
IN ib_al_handle_t h_al,\r
IN net32_t cid,\r
- IN OUT ib_cep_t* const p_new_cep,\r
+ OUT void* __ptr64 * p_context,\r
+ OUT net32_t* const p_new_cid,\r
OUT ib_mad_element_t** const pp_mad )\r
{\r
ucep_t *p_cep;\r
return IB_INVALID_HANDLE;\r
}\r
\r
- if( !p_new_cep || !pp_mad )\r
+ if( !p_new_cid || !pp_mad )\r
{\r
AL_EXIT( AL_DBG_CM );\r
return IB_INVALID_PARAMETER;\r
\r
if( ioctl.status == IB_SUCCESS )\r
{\r
- if( ioctl.new_cep.cid != AL_INVALID_CID )\r
+ if( ioctl.new_cid != AL_INVALID_CID )\r
{\r
/* Need to create a new CEP for user-mode. */\r
- status = __create_ucep( p_cep->h_al, ioctl.new_cep.cid,\r
- p_cep->pfn_cb, ioctl.new_cep.context, NULL );\r
+ status = __create_ucep( p_cep->h_al, ioctl.new_cid,\r
+ p_cep->pfn_cb, NULL, NULL );\r
if( status != IB_SUCCESS )\r
{\r
DeviceIoControl( g_al_device, UAL_DESTROY_CEP,\r
- &ioctl.new_cep.cid, sizeof(ioctl.new_cep.cid),\r
+ &ioctl.new_cid, sizeof(ioctl.new_cid),\r
NULL, 0, &bytes_ret, NULL );\r
goto err;\r
}\r
\r
cl_memcpy( p_mad->p_mad_buf, ioctl.mad_buf, MAD_BLOCK_SIZE );\r
\r
- *p_new_cep = ioctl.new_cep;\r
+ *p_context = ioctl.context;\r
+ *p_new_cid = ioctl.new_cid;\r
*pp_mad = p_mad;\r
}\r
else\r
\r
if( !error_code )\r
{\r
- p_cep->pfn_cb( p_cep->h_al, &p_cep->cep );\r
+ p_cep->pfn_cb( p_cep->h_al, p_cep->cid );\r
\r
if( !DeviceIoControl( gp_cep_mgr->h_file, UAL_CEP_GET_EVENT,\r
- &p_cep->cep.cid, sizeof(p_cep->cep.cid), NULL, 0,\r
+ &p_cep->cid, sizeof(p_cep->cid), NULL, 0,\r
NULL, &p_cep->ov ) && GetLastError() == ERROR_IO_PENDING )\r
{\r
AL_EXIT( AL_DBG_CM );\r
*****/\r
\r
\r
-typedef struct _ib_cep\r
-{\r
- void *context;\r
- net32_t cid;\r
-\r
-} ib_cep_t;\r
-\r
-\r
/****s* Access Layer/ib_cep_listen_t\r
* NAME\r
* ib_cep_listen_t\r
{\r
struct _ual_cep_rep_ioctl_in\r
{\r
+ void* __ptr64 context;\r
net32_t cid;\r
ib_cm_rep_t cm_rep;\r
uint8_t pdata[IB_REP_PDATA_SIZE];\r
typedef struct _ual_cep_poll_ioctl\r
{\r
ib_api_status_t status;\r
- ib_cep_t new_cep;\r
+ void* __ptr64 context;\r
+ net32_t new_cid;\r
ib_mad_element_t element;\r
ib_grh_t grh;\r
uint8_t mad_buf[MAD_BLOCK_SIZE];\r