/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
* Copyright (c) 2006 Mellanox Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
\r
/* Format the send work request and post. */\r
send_wr.p_next = NULL;\r
- send_wr.wr_id = (uint64_t)(void* VOID_PTR64)wr;\r
+ send_wr.wr_id = (ULONG_PTR)wr;\r
send_wr.wr_type = wr_type;\r
send_wr.send_opt = 0;\r
send_wr.num_ds = dwBufferCount;\r
lpOverlapped->InternalHigh = 0;\r
for( ds_idx = 0; ds_idx < dwBufferCount; ds_idx++ )\r
{\r
- local_ds[ds_idx].vaddr = (uint64_t)(void* VOID_PTR64)lpBuffers[ds_idx].buf;\r
+ local_ds[ds_idx].vaddr = (ULONG_PTR)lpBuffers[ds_idx].buf;\r
local_ds[ds_idx].length = lpBuffers[ds_idx].len;\r
local_ds[ds_idx].lkey =\r
((struct memory_node*)lpBuffers[ds_idx].handle)->p_reg1->lkey;\r
/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
* Copyright (c) 2006 Mellanox Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
IN ib_cm_req_rec_t *p_cm_req_rec )\r
{\r
struct ibsp_socket_info *socket_info =\r
- (struct ibsp_socket_info * VOID_PTR64)p_cm_req_rec->context;\r
+ (struct ibsp_socket_info *)p_cm_req_rec->context;\r
struct listen_incoming *incoming;\r
\r
IBSP_ENTER( IBSP_DBG_CM );\r
IN ib_cm_rep_rec_t *p_cm_rep_rec )\r
{\r
struct ibsp_socket_info *socket_info =\r
- (struct ibsp_socket_info * VOID_PTR64)p_cm_rep_rec->qp_context;\r
+ (struct ibsp_socket_info *)p_cm_rep_rec->qp_context;\r
ib_cm_rtu_t cm_rtu;\r
ib_api_status_t status;\r
\r
IN ib_cm_rtu_rec_t *p_cm_rtu_rec )\r
{\r
struct ibsp_socket_info *socket_info =\r
- (struct ibsp_socket_info * VOID_PTR64)p_cm_rtu_rec->qp_context;\r
+ (struct ibsp_socket_info *)p_cm_rtu_rec->qp_context;\r
\r
IBSP_ENTER( IBSP_DBG_CM );\r
\r
wr = &socket_info->recv_wr[socket_info->recv_idx];\r
\r
/* Update the work request ID. */\r
- wr->recv.wr_id = (uint64_t)(void* VOID_PTR64)wr;\r
+ wr->recv.wr_id = (ULONG_PTR)wr;\r
\r
/*\r
* Increment the count before posting so it doesn't go\r
IN ib_cm_rej_rec_t *p_cm_rej_rec )\r
{\r
struct ibsp_socket_info *socket_info =\r
- (struct ibsp_socket_info * VOID_PTR64)p_cm_rej_rec->qp_context;\r
+ (struct ibsp_socket_info *)p_cm_rej_rec->qp_context;\r
\r
IBSP_ENTER( IBSP_DBG_CM );\r
\r
ib_cm_drep_t cm_drep;\r
struct disconnect_reason *reason;\r
struct ibsp_socket_info *socket_info =\r
- (struct ibsp_socket_info * VOID_PTR64)p_cm_dreq_rec->qp_context;\r
+ (struct ibsp_socket_info *)p_cm_dreq_rec->qp_context;\r
\r
IBSP_ENTER( IBSP_DBG_CM );\r
IBSP_PRINT(TRACE_LEVEL_INFORMATION, IBSP_DBG_CM,\r
("socket=%p state=%s\n",\r
socket_info, IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
\r
- reason = (struct disconnect_reason * VOID_PTR64)p_cm_dreq_rec->p_dreq_pdata;\r
+ reason = (struct disconnect_reason *)p_cm_dreq_rec->p_dreq_pdata;\r
\r
cl_spinlock_acquire( &socket_info->mutex1 );\r
\r
/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
* Copyright (c) 2006 Mellanox Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
\r
IBSP_ENTER( IBSP_DBG_IO );\r
\r
- wr = (struct _wr * VOID_PTR64)HDL_TO_PTR(wc->wr_id);\r
- p_recv_wr = (struct _recv_wr * VOID_PTR64)HDL_TO_PTR(wc->wr_id);\r
+ wr = (struct _wr *)(ULONG_PTR)wc->wr_id;\r
+ p_recv_wr = (struct _recv_wr *)(ULONG_PTR)wc->wr_id;\r
\r
CL_ASSERT( wr );\r
\r
#ifdef IBSP_LOGGING\r
cl_spinlock_acquire( &socket_info->recv_lock );\r
DataLogger_WriteData(&socket_info->RecvDataLogger,\r
- p_recv_wr->idx, (void * VOID_PTR64)p_recv_wr->ds_array[0].vaddr,\r
+ p_recv_wr->idx, (void *)p_recv_wr->ds_array[0].vaddr,\r
wc->length);\r
cl_spinlock_release( &socket_info->recv_lock );\r
#endif\r
// if( idx >= QP_ATTRIB_RQ_DEPTH )\r
// idx += QP_ATTRIB_RQ_DEPTH;\r
\r
- // CL_ASSERT( wc->wr_id == (uint64_t)(void* VOID_PTR64)&socket_info->recv_wr[idx] );\r
+ // CL_ASSERT( wc->wr_id == (ULONG_PTR)&socket_info->recv_wr[idx] );\r
// cl_atomic_dec( &socket_info->recv_cnt );\r
// cl_spinlock_release( &socket_info->recv_lock );\r
//}\r
if( wc->status == IB_SUCCESS && p_recv_wr->ds_array[0].length >= 40 )\r
{\r
debug_dump_buffer( IBSP_DBG_WQ, "RECV",\r
- (void * VOID_PTR64)p_recv_wr->ds_array[0].vaddr, 40 );\r
+ (void *)(ULONG_PTR)p_recv_wr->ds_array[0].vaddr, 40 );\r
}\r
\r
cl_atomic_dec( &g_ibsp.recv_count );\r
// idx = socket_info->send_idx - (uint8_t)socket_info->send_cnt;\r
// if( idx >= QP_ATTRIB_SQ_DEPTH )\r
// idx += QP_ATTRIB_SQ_DEPTH;\r
- // CL_ASSERT( wc->wr_id == (uint64_t)(void* VOID_PTR64)&socket_info->send_wr[idx] );\r
+ // CL_ASSERT( wc->wr_id == (ULONG_PTR)&socket_info->send_wr[idx] );\r
// cl_atomic_dec( &socket_info->send_cnt );\r
// cl_spinlock_release( &socket_info->send_lock );\r
//}\r
/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
* Copyright (c) 2006 Mellanox Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
ib_query_rec_t *p_query_rec )\r
{\r
struct query_guid_context *query_context =\r
- (struct query_guid_context * VOID_PTR64)p_query_rec->query_context;\r
+ (struct query_guid_context *)p_query_rec->query_context;\r
ib_service_record_t *service_record;\r
\r
IBSP_ENTER( IBSP_DBG_HW );\r
ib_user_query_t user_query;\r
struct query_guid_context query_context;\r
ib_service_record_t service_record;\r
- ib_query_handle_t VOID_PTR64 query_handle;\r
+ ib_query_handle_t query_handle;\r
ib_query_req_t query_req;\r
ib_api_status_t status;\r
\r
ib_query_rec_t *p_query_rec )\r
{\r
struct query_pr_context *query_context =\r
- (struct query_pr_context * VOID_PTR64)p_query_rec->query_context;\r
+ (struct query_pr_context *)p_query_rec->query_context;\r
ib_api_status_t status;\r
\r
IBSP_ENTER( IBSP_DBG_HW );\r
{\r
ib_gid_pair_t user_query;\r
struct query_pr_context query_context;\r
- ib_query_handle_t VOID_PTR64 query_handle;\r
+ ib_query_handle_t query_handle;\r
ib_query_req_t query_req;\r
ib_api_status_t status;\r
uint8_t pkt_life;\r
/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
* Copyright (c) 2006 Mellanox Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
{\r
return( (p_reg->type.access_ctrl & acl_mask) == acl_mask &&\r
start >= p_reg->type.vaddr &&\r
- ((uintn_t)start) + len <=\r
- ((uintn_t)(uint64_t)p_reg->type.vaddr) + p_reg->type.length );\r
+ ((ULONG_PTR)start) + len <=\r
+ ((ULONG_PTR)p_reg->type.vaddr) + p_reg->type.length );\r
}\r
\r
\r
struct memory_node *\r
ibsp_reg_mem(\r
IN struct ibsp_socket_info *s,\r
- IN ib_pd_handle_t FUNC_PTR64 pd,\r
+ IN ib_pd_handle_t pd,\r
IN void *start,\r
IN size_t len,\r
IN ib_access_t access_ctrl,\r
p_item = cl_qlist_next( p_item );\r
\r
if( lpvAddress > p_reg->type.vaddr ||\r
- ((uintn_t)lpvAddress) + Size <\r
- ((uintn_t)(uint64_t)p_reg->type.vaddr) + p_reg->type.length )\r
+ ((ULONG_PTR)lpvAddress) + Size <\r
+ ((ULONG_PTR)p_reg->type.vaddr) + p_reg->type.length )\r
{\r
continue;\r
}\r
/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
* Copyright (c) 2006 Mellanox Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
\r
struct _ibsp_pm_definition g_ibsp_pm_def; /* IB WSD performance object */\r
\r
+struct _pm_stat g_pm_stat;\r
\r
void\r
IBSPPmInit( void )\r
\r
IBSP_ENTER( IBSP_DBG_PERFMON );\r
\r
- p_mem = (pm_shmem_t * VOID_PTR64 )g_pm_stat.p_shmem;\r
+ p_mem = (pm_shmem_t *)g_pm_stat.p_shmem;\r
\r
if( p_mem == NULL )\r
{\r
/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
DWORD idx; /* slot index assigned for this process */\r
LONG64 fall_back_data[IBSP_PM_NUM_COUNTERS];\r
\r
-} g_pm_stat;\r
+};\r
+\r
+extern struct _pm_stat g_pm_stat;\r
\r
\r
void\r
/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
* Copyright (c) 2006 Mellanox Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
break;\r
\r
case IB_PNP_CA_REMOVE:\r
- pnp_ca_remove( (struct ibsp_hca* VOID_PTR64)pnp_rec->context );\r
+ pnp_ca_remove( (struct ibsp_hca*)pnp_rec->context );\r
break;\r
\r
/* Port events */\r
break;\r
\r
case IB_PNP_PORT_REMOVE:\r
- pnp_port_remove( (struct ibsp_port* VOID_PTR64)pnp_rec->context );\r
+ pnp_port_remove( (struct ibsp_port*)pnp_rec->context );\r
break;\r
\r
case IB_PNP_PKEY_CHANGE:\r
/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
* Copyright (c) 2006 Mellanox Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
\r
/* Looks good. Post the receive buffer. */\r
wr->recv.p_next = NULL;\r
- wr->recv.wr_id = (uint64_t)(void* VOID_PTR64)wr;\r
+ wr->recv.wr_id = (ULONG_PTR)wr;\r
wr->recv.num_ds = dwBufferCount;\r
wr->recv.ds_array = wr->ds_array;\r
\r
}\r
\r
wr->ds_array[ds_idx].vaddr =\r
- (uint64_t)(void* VOID_PTR64)lpBuffers[ds_idx].buf;\r
+ (ULONG_PTR)lpBuffers[ds_idx].buf;\r
wr->ds_array[ds_idx].length = lpBuffers[ds_idx].len;\r
wr->ds_array[ds_idx].lkey = node->p_reg1->lkey;\r
}\r
lpOverlapped->InternalHigh = 0;\r
for( ds_idx = 0; ds_idx < dwBufferCount; ds_idx++ )\r
{\r
- local_ds[ds_idx].vaddr = (uint64_t)(void* VOID_PTR64)lpBuffers[ds_idx].buf;\r
+ local_ds[ds_idx].vaddr = (ULONG_PTR)lpBuffers[ds_idx].buf;\r
local_ds[ds_idx].length = lpBuffers[ds_idx].len;\r
\r
lpOverlapped->InternalHigh += lpBuffers[ds_idx].len;\r
}\r
\r
\r
+\r
/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
struct memory_node *\r
ibsp_reg_mem(\r
IN struct ibsp_socket_info *s,\r
- IN ib_pd_handle_t FUNC_PTR64 pd,\r
+ IN ib_pd_handle_t pd,\r
IN void *start,\r
IN size_t len,\r
IN ib_access_t access_ctrl,\r
/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
/* Memory registration parameters, returned by ib_reg_mem. */\r
uint32_t lkey;\r
uint32_t rkey;\r
-TO_LONG_PTR( ib_mr_handle_t , mr_handle) ; \r
+ ib_mr_handle_t mr_handle;\r
};\r
\r
\r
cl_list_item_t list_item;\r
\r
cl_waitobj_handle_t cq_waitobj;\r
-TO_LONG_PTR( ib_cq_handle_t , cq) ; \r
+ ib_cq_handle_t cq;\r
\r
/* Number of qp's using this cq */\r
atomic32_t qp_count;\r
/* Listening socket */\r
unsigned int backlog; /* Maximum number of pending connections */\r
cl_qlist_t list; /* list of pending connections */\r
-TO_LONG_PTR( ib_listen_handle_t , handle) ; \r
+ ib_listen_handle_t handle;\r
struct listen_req_param listen_req_param;\r
} listen;\r
\r
struct ibsp_socket_options socket_options; /* Socket Options */\r
\r
/* Infiniband ressources */\r
-TO_LONG_PTR( ib_pd_handle_t , hca_pd) ; /* Copy of the HCA PD, for faster access. */\r
+ ib_pd_handle_t hca_pd; /* Copy of the HCA PD, for faster access. */\r
\r
/* Pointer to completion queue and thread assigned to this socket */\r
struct cq_thread_info *cq_tinfo;\r
\r
-TO_LONG_PTR( ib_qp_handle_t , qp) ; \r
+ ib_qp_handle_t qp;\r
uint32_t max_inline;\r
\r
/* State on the QP. This is only valid when the socket state is IBSP_CONNECTED.\r
\r
ib_net64_t guid;\r
uint16_t dev_id; /* Device ID to selectively cap MTU to 1K for Tavor. */\r
-TO_LONG_PTR( ib_ca_handle_t , hca_handle) ; \r
+ ib_ca_handle_t hca_handle;\r
\r
-TO_LONG_PTR( ib_pd_handle_t , pd) ; \r
+ ib_pd_handle_t pd;\r
\r
/* Memory management */\r
struct mr_list rdma_mem_list; /* Regions registered through IBSPRegisterRdmaMemory */\r
WSAPROTOCOL_INFOW protocol_info;\r
\r
/* Infiniband */\r
-TO_LONG_PTR( ib_al_handle_t , al_handle) ; \r
-TO_LONG_PTR( ib_pnp_handle_t , pnp_handle_ca) ; \r
-TO_LONG_PTR( ib_pnp_handle_t , pnp_handle_port) ; \r
+ ib_al_handle_t al_handle;\r
+ ib_pnp_handle_t pnp_handle_ca;\r
+ ib_pnp_handle_t pnp_handle_port;\r
\r
cl_qlist_t hca_list;\r
cl_spinlock_t hca_mutex;\r