ibci.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_IB_IBTL_IBCI_H
#define _SYS_IB_IBTL_IBCI_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ibci.h
*
* Define the data structures and function prototypes that comprise
* the IB Channel API (API for HCA drivers). All CI handles are opaque
* to the IBTF here, real data is accessed in the HCA driver by a
* typecast to a driver specific struct.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Define CI opaque IBTF handles.
*/
/*
* Define IBTF opaque CI handles.
*/
/* Handle used by CI for up calls to IBTF */
/*
* Fields opaque to TI, but visible to CI
*/
/*
* ibt_qp_alloc_attr_t
*/
#define qp_ibc_scq_hdl qp_opaque1
#define qp_ibc_rcq_hdl qp_opaque2
#define qp_ibc_srq_hdl qp_opaque3
/*
* ibt_status_t
*/
/* exceeds HCA max */
/* limit */
/* not supported */
/* Attribute */
/* Timer Value */
/*
* ibt_wc_status_t
*/
/* the QP does not match */
/* the RDD associated with */
/* the EE Context */
/* incoming RD message */
/* operation */
/* detected */
/*
* ibt_async_code_t
*/
/*
* ibt_object_type_t
*/
#define IBT_HDL_EEC IBT_HDL_OPAQUE1
#define IBT_HDL_RDD IBT_HDL_OPAQUE2
/*
* ibt_hca_attr_t
*/
/* per EEC with HCA as target */
/* per EE by this HCA */
#define hca_max_ipv6_qp hca_max_ipv6_chan
#define hca_max_ether_qp hca_max_ether_chan
#define hca_eec_max_ci_priv_sz hca_opaque7
#define hca_rdd_max_ci_priv_sz hca_opaque8
/*
* ibt_wc_t
*/
/* Channel Interface version */
typedef enum ibc_version_e {
IBCI_V1 = 1
typedef enum ibc_free_qp_flags_e {
IBC_FREE_QP_AND_QPN = 0, /* free all qp resources */
/* cannot be reused until a future */
/* call to ibc_release_qpn(qpn_hdl), */
/* where qpn_hdl is a return value */
/* of ibc_free_qp() */
/*
* RDD alloc flags
*/
typedef enum ibc_rdd_flags_e {
IBT_RDD_NO_FLAGS = 0,
IBT_RDD_USER_MAP = (1 << 0),
/*
* EEC alloc flags
*/
typedef enum ibc_eec_flags_e {
IBT_EEC_NO_FLAGS = 0,
IBT_EEC_USER_MAP = (1 << 0),
/*
* Completion Queues
*
*/
/*
* CQ handler attribute structure.
*/
typedef struct ibc_cq_handler_attr_s {
int h_flags; /* Flags of ddi_intr_get_cap */
int h_pri; /* priority from */
/* ddi_intr_get_pri */
void *h_bind; /* unknown intrd stuff */
/*
* to the async handler.
*
* Here is the table that describes which async_event struct members need
* to be defined when ibc_async_handler is called.
*
* async_code async_event fields
* IBT_EVENT_PATH_MIGRATED_QP ev_qp_hdl
* IBT_EVENT_SQD ev_qp_hdl
* IBT_EVENT_COM_EST_QP ev_qp_hdl
* IBT_ERROR_CATASTROPHIC_QP ev_qp_hdl
* IBT_ERROR_INVALID_REQUEST_QP ev_qp_hdl
* IBT_ERROR_ACCESS_VIOLATION_QP ev_qp_hdl
* IBT_ERROR_PATH_MIGRATE_REQ_QP ev_qp_hdl
*
* IBT_EVENT_PATH_MIGRATED_EEC ev_eec_hdl
* IBT_EVENT_COM_EST_EEC ev_eec_hdl
* IBT_ERROR_PATH_MIGRATE_REQ_EEC ev_eec_hdl
* IBT_ERROR_CATASTROPHIC_EEC ev_eec_hdl
*
* IBT_ERROR_CQ ev_cq_hdl
* IBT_ERROR_LOCAL_CATASTROPHIC none
* IBT_ERROR_PORT_DOWN ev_port
* IBT_EVENT_PORT_UP ev_port
* IBT_EVENT_LIMIT_REACHED_SRQ ev_srq_hdl
* IBT_EVENT_EMPTY_QP ev_qp_hdl
* IBT_ERROR_CATASTROPHIC_SRQ ev_srq_hdl
*/
typedef struct ibc_async_event_s {
typedef struct ibc_operations_s {
/* HCA */
/* Protection Domain */
ibc_pd_hdl_t *pd_p);
/* Reliable Datagram Domain */
/* Address Handle */
/* Queue Pair */
ibc_qp_hdl_t *qp_p);
/* Completion Queues */
/* EE Context */
/* Memory Registration */
/* Memory Window */
/* Multicast Group */
/* WR processing */
/* CI Object Private Data */
/* Shared Receive Queues */
/* Address translation */
/* Allocate L_Key */
/* Physical Register Memory Region */
/*
* The ibc_hca_info_s structure is used for HCA drivers to communicate its
* HCA specific information to IBTF when it attaches a device via ibc_attach().
*
* IBTF assumes that the structures pointed to by the hca_ops and hca_attr
* structure members are persistent.
*/
typedef struct ibc_hca_info_s {
/* "hca_ops" */
/* Channel Interface return status */
typedef enum ibc_status_e {
IBC_SUCCESS = 0,
IBC_FAILURE = 1
} ibc_status_t;
/*
* CI up-calls to IBTF.
*/
/*
* ibc_init
* Registers CI clients with the Solaris I/O framework
*
* ibc_fini
* Un-Registers CI clients with the Solaris I/O framework
*
* modlp - Pointer to IBC client module linkage structure
*/
/*
* ibc_attach
* Register HCA device with IBTF.
*
* ibc_hdl_p An IBTF HCA device info handle, assigned by IBTF.
* To be used by the HCA driver in all its kernel
* function calls to IBTF.
*
* info_p Pointer to ibc_hca_info_t() struct, which contains
* HCA driver's information needed by IBTF.
*
* ibc_post_attach
* After a successful ibc_attach, this must be called.
*
* ibc_hdl The IBTF HCA device info handle that was returned
* as the result of a previously successful call to
* ibc_attach.
*
* ibc_pre_detach
* Attempt to De-Register HCA Device from IBTF.
* This requires the cooperation of IBTF clients to
* stop using this HCA. Upon success, the HCA driver
* is committed to calling ibc_detach.
*
* ibc_hdl An IBTF HCA device info handle.
* Obtained by ibc_attach().
*
* cmd Type of detach command - DDI_DETACH.
*
* ibc_detach
* De-Register HCA Device from IBTF.
* This function will succeed if ibc_pre_detach has previously
* succeeded for this device.
*
* ibc_hdl An IBTF HCA device info handle.
*/
/*
* ibc_cq_handler
* IBTF Completion Queue Notification Handler.
*
* ibc_hdl An IBTF HCA device info handle.
* Obtained by ibc_attach().
*
* ibt_cq An IBT CQ handle, on which completion notification
* has occurred. This is passed to HCA driver during
* ibc_alloc_cq().
*/
/*
* ibc_async_handler
*
* ibc_hdl An IBTF HCA device info handle.
* Obtained by ibc_attach().
*
* code Asynchronous event code.
*
* event_p Pointer to ibc_async_event_t struct, to return event
* information.
*/
/*
* ibc_memory_handler
*
* ibc_hdl An IBTF HCA device info handle.
* Obtained by ibc_attach().
*
* Memory Region.
*
* data_p Pointer to ibt_mem_data_t struct.
*
* ibtl_reserved The private data associated with either the MR or MA
* handle contained in the ibt_mem_data_t struct, that
* was passed to the CI on a memory registration or memory
* map operation.
*/
/*
* ibc_get_ci_failure()
*
* Used to obtain a special IBTF failure code for CI specific failures,
* failures other than those defined in ibt_status_t.
*
* ena '0' or the ENA the CI intends to use in an ereport for this
* failure.
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_IBTL_IBCI_H */