-/* Infinicon IBT interface wrappers */
-#define IIBT_IF (kibnal_data.kib_interfaces.ver2)
-
-static inline FSTATUS
-iibt_get_hca_guids(uint32 *hca_count, EUI64 *hca_guid_list)
-{
- return IIBT_IF.GetCaGuids(hca_count, hca_guid_list);
-}
-
-static inline FSTATUS
-iibt_open_hca(EUI64 hca_guid,
- IB_COMPLETION_CALLBACK completion_callback,
- IB_ASYNC_EVENT_CALLBACK async_event_callback,
- void *arg,
- IB_HANDLE *handle)
-{
- return IIBT_IF.Vpi.OpenCA(hca_guid, completion_callback,
- async_event_callback, arg, handle);
-}
-
-static inline FSTATUS
-iibt_query_hca(IB_HANDLE hca_handle, IB_CA_ATTRIBUTES *attrs, void **argp)
-{
- return IIBT_IF.Vpi.QueryCA(hca_handle, attrs, argp);
-}
-
-static inline FSTATUS
-iibt_close_hca(IB_HANDLE hca_handle)
-{
- return IIBT_IF.Vpi.CloseCA(hca_handle);
-}
-
-static inline FSTATUS
-iibt_pd_allocate(IB_HANDLE hca_handle, __u32 max_avs, IB_HANDLE *pd_handle)
-{
- return IIBT_IF.Vpi.AllocatePD(hca_handle, max_avs, pd_handle);
-}
-
-static inline FSTATUS
-iibt_pd_free(IB_HANDLE pd_handle)
-{
- return IIBT_IF.Vpi.FreePD(pd_handle);
-}
-
-static inline FSTATUS
-iibt_register_physical_memory(IB_HANDLE hca_handle,
- IB_VIRT_ADDR requested_io_va,
- void *phys_buffers, uint64 nphys_buffers,
- uint32 io_va_offset, IB_HANDLE pd_handle,
- IB_ACCESS_CONTROL access,
- IB_HANDLE *mem_handle,
- IB_VIRT_ADDR *actual_io_va,
- IB_L_KEY *lkey, IB_R_KEY *rkey)
-{
- return IIBT_IF.Vpi.RegisterPhysMemRegion(hca_handle, requested_io_va,
- phys_buffers, nphys_buffers,
- io_va_offset, pd_handle,
- access,
- mem_handle, actual_io_va,
- lkey, rkey);
-}
-
-static inline FSTATUS
-iibt_register_contig_physical_memory(IB_HANDLE hca_handle,
- IB_VIRT_ADDR requested_io_va,
- IB_MR_PHYS_BUFFER *phys_buffers,
- uint64 nphys_buffers,
- uint32 io_va_offset, IB_HANDLE pd_handle,
- IB_ACCESS_CONTROL access,
- IB_HANDLE *mem_handle,
- IB_VIRT_ADDR *actual_io_va,
- IB_L_KEY *lkey, IB_R_KEY *rkey)
-{
- return IIBT_IF.Vpi.RegisterContigPhysMemRegion(hca_handle,
- requested_io_va,
- phys_buffers,
- nphys_buffers,
- io_va_offset, pd_handle,
- access,
- mem_handle, actual_io_va,
- lkey, rkey);
-}
-
-static inline FSTATUS
-iibt_register_memory(IB_HANDLE hca_handle,
- void *virt_addr, unsigned int length,
- IB_HANDLE pd_handle,
- IB_ACCESS_CONTROL access,
- IB_HANDLE *mem_handle,
- IB_L_KEY *lkey, IB_R_KEY *rkey)
-{
- return IIBT_IF.Vpi.RegisterMemRegion(hca_handle,
- virt_addr, length,
- pd_handle,
- access,
- mem_handle,
- lkey, rkey);
-}
-
-static inline FSTATUS
-iibt_deregister_memory(IB_HANDLE mem_handle)
-{
- return IIBT_IF.Vpi.DeregisterMemRegion(mem_handle);
-}
-
-static inline FSTATUS
-iibt_cq_create(IB_HANDLE hca_handle, uint32 requested_size,
- void *arg, IB_HANDLE *cq_handle, uint32 *actual_size)
-{
- return IIBT_IF.Vpi.CreateCQ(hca_handle, requested_size,
- arg, cq_handle, actual_size);
-}
-
-static inline FSTATUS
-iibt_cq_poll(IB_HANDLE cq_handle, IB_WORK_COMPLETION *wc)
-{
- return IIBT_IF.Vpi.PollCQ(cq_handle, wc);
-}
-
-static inline FSTATUS
-iibt_cq_rearm(IB_HANDLE cq_handle, IB_CQ_EVENT_SELECT select)
-{
- return IIBT_IF.Vpi.RearmCQ(cq_handle, select);
-}
-
-static inline FSTATUS
-iibt_cq_destroy(IB_HANDLE cq_handle)
-{
- return IIBT_IF.Vpi.DestroyCQ(cq_handle);
-}
-
-static inline FSTATUS
-iibt_qp_create(IB_HANDLE hca_handle, IB_QP_ATTRIBUTES_CREATE *create_attr,
- void *arg, IB_HANDLE *cq_handle,
- IB_QP_ATTRIBUTES_QUERY *query_attr)
-{
- return IIBT_IF.Vpi.CreateQP(hca_handle, create_attr, arg, cq_handle,
- query_attr);
-}
-
-static inline FSTATUS
-iibt_qp_query(IB_HANDLE qp_handle, IB_QP_ATTRIBUTES_QUERY *query_attr,
- void **arg_ptr)
-{
- return IIBT_IF.Vpi.QueryQP(qp_handle, query_attr, arg_ptr);
-}
-
-static inline FSTATUS
-iibt_qp_modify(IB_HANDLE qp_handle, IB_QP_ATTRIBUTES_MODIFY *modify_attr,
- IB_QP_ATTRIBUTES_QUERY *query_attr)
-{
- return IIBT_IF.Vpi.ModifyQP(qp_handle, modify_attr, query_attr);
-}
-
-static inline FSTATUS
-iibt_qp_destroy(IB_HANDLE qp_handle)
-{
- return IIBT_IF.Vpi.DestroyQP(qp_handle);
-}
-
-static inline FSTATUS
-iibt_postrecv(IB_HANDLE qp_handle, IB_WORK_REQ *work_req)
-{
- return IIBT_IF.Vpi.PostRecv(qp_handle, work_req);
-}
-
-static inline FSTATUS
-iibt_postsend(IB_HANDLE qp_handle, IB_WORK_REQ *work_req)
-{
- return IIBT_IF.Vpi.PostSend(qp_handle, work_req);
-}
-
-static inline FSTATUS
-iibt_sd_register(IB_HANDLE *sd_handle, CLIENT_CONTROL_PARAMETERS *p)
-{
- return IIBT_IF.Sdi.Register(sd_handle, p);
-}
-
-static inline FSTATUS
-iibt_sd_deregister(IB_HANDLE sd_handle)
-{
- return IIBT_IF.Sdi.Deregister(sd_handle);
-}
-
-static inline FSTATUS
-iibt_sd_port_fabric_operation(IB_HANDLE sd_handle, EUI64 port_guid,
- FABRIC_OPERATION_DATA *fod,
- PFABRIC_OPERATION_CALLBACK callback,
- COMMAND_CONTROL_PARAMETERS *p, void *arg)
-{
- return IIBT_IF.Sdi.PortFabricOperation(sd_handle, port_guid,
- fod, callback, p, arg);
-}
-
-static inline FSTATUS
-iibt_sd_query_port_fabric_information(IB_HANDLE sd_handle, EUI64 port_guid,
- QUERY *qry,
- PQUERY_CALLBACK callback,
- COMMAND_CONTROL_PARAMETERS *p, void *arg)
-{
- return IIBT_IF.Sdi.QueryPortFabricInformation(sd_handle, port_guid,
- qry, callback, p, arg);
-}
-
-static inline IB_HANDLE
-iibt_cm_create_cep(CM_CEP_TYPE type)
-{
- return IIBT_IF.Cmi.CmCreateCEP(type);
-}
-
-static inline FSTATUS
-iibt_cm_modify_cep(IB_HANDLE cep, uint32 attr, char* value, uint32 len,
- uint32 offset)
-{
- return IIBT_IF.Cmi.CmModifyCEP(cep, attr, value, len, offset);
-}
-
-static inline FSTATUS
-iibt_cm_destroy_cep(IB_HANDLE cep_handle)
-{
- return IIBT_IF.Cmi.CmDestroyCEP(cep_handle);
-}
-
-static inline FSTATUS
-iibt_cm_listen(IB_HANDLE cep, CM_LISTEN_INFO *info,
- PFN_CM_CALLBACK callback, void *arg)
-{
- return IIBT_IF.Cmi.CmListen(cep, info, callback, arg);
-}
-
-static inline FSTATUS
-iibt_cm_cancel(IB_HANDLE cep)
-{
- return IIBT_IF.Cmi.CmCancel(cep);
-}
-
-static inline FSTATUS
-iibt_cm_accept(IB_HANDLE cep,
- CM_CONN_INFO *send_info, CM_CONN_INFO *recv_info,
- PFN_CM_CALLBACK callback, void *arg,
- IB_HANDLE *new_cep)
-{
- return IIBT_IF.Cmi.CmAccept(cep,
- send_info, recv_info,
- callback, arg, new_cep);
-}
-
-static inline FSTATUS
-iibt_cm_reject(IB_HANDLE cep, CM_REJECT_INFO *rej)
-{
- return IIBT_IF.Cmi.CmReject(cep, rej);
-}
-
-static inline FSTATUS
-iibt_cm_disconnect(IB_HANDLE cep, CM_DREQUEST_INFO *req,
- CM_DREPLY_INFO *reply)
-{
- return IIBT_IF.Cmi.CmDisconnect(cep, req, reply);
-}
-
-static inline FSTATUS
-iibt_cm_connect (IB_HANDLE cep, CM_REQUEST_INFO *req,
- PFN_CM_CALLBACK callback, void *arg)
-{
- return IIBT_IF.Cmi.CmConnect (cep, req, callback, arg);
-}
-
-static inline int wrq_signals_completion(IB_WORK_REQ *wrq)
-{
- return wrq->Req.SendRC.Options.s.SignaledCompletion == 1;
-}
-
-
-/******************************************************************************/