/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_IB_MGT_IBMF_IBMF_IMPL_H
#define _SYS_IB_MGT_IBMF_IBMF_IMPL_H
/*
* This file contains the IBMF implementation dependent structures and defines.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Work request ID format used for receive requests.
*
* bit 0 set to 1
*/
/*
* Convenience macro used in the RMPP protocol to obtain R_Method field
* of MAD header with Response bit flipped.
*/
/* Work Request ID macros */
(!(IBMF_IS_RECV_WR_ID((id))))
/* Decrement IBMF message reference count */
(msg)->im_ref_count--; \
}
/* Increment IBMF message reference count */
(msg)->im_ref_count++;
(clp)->ic_recvs_active++; \
}
(clp)->ic_recvs_active--; \
if ((clp)->ic_recvs_active == 0) \
}
(altqp)->isq_recvs_active++; \
}
(altqp)->isq_recvs_active--; \
if ((altqp)->isq_recvs_active == 0) \
}
/* warlock annotations for ibmf.h and ibmf_msg.h structures */
/*
* WQE pool management contexts
*/
typedef struct _ibmf_wqe_mgt {
/*
* structure used to keep track of qp handles
*/
typedef struct _ibmf_qp_t {
} ibmf_qp_t;
/* defines for iq_flags */
/*
* structure used to keep track of qp handles for qps other than
* the special qps
*/
typedef struct _ibmf_alt_qp_t {
/*
* This structure is used to keep track of IBT returned ibt_ud_dest_t
* structures.
*/
typedef struct ibmf_ud_dest_s {
/*
* ibmf_msg_impl definition
* The IBMF client initializes various members of the msg while sending
* the message. IBMF fills in the various members of the msg when a message
* is received.
*/
typedef struct _ibmf_msg_impl {
/* im_flags */
/* retransmission parameter defaults for im_retrans field */
#define IBMF_RETRANS_DEF_RETRIES 0
/*
* Transaction state flags (im_trans_state_flags) definitions
* Don't use 0x0 as a flag value since clients OR and AND the flags
*/
/* Timer types */
typedef enum _ibmf_timer_t {
} ibmf_timer_t;
/*
* structure to hold specific client info taken from ibmf_register_info_t
* since we can register for more than one client at a time, but each specific
* ibmf_client_t only holds one client itself.
*/
typedef struct _ibmf_client_info {
/*
* Bits 16-19 of the client_class specify the client type.
*/
/*
* structure used to keep track of clients
*/
typedef struct _ibmf_client {
/* IBTL asynchronous event callback (eg. HCA offline) */
/* Asynchronous/Unsolicited message handler */
void *ic_recv_cb_arg;
/* registration */
/* Statistics */
/* remove recv_cb */
/* IBMF_MAD_ONLY is used by the alternate QP context only (isq_flags) */
#define IBMF_REG_MSG_LIST 0
/*
* Send WQE context
*/
typedef struct _ibmf_send_wqe {
/*
* Receive WQE context
*/
typedef struct _ibmf_recv_wqe {
/*
* Struct that keeps track of the underlying IB channel interface. There
* is one per CI. Each clients on a given ci gets a reference to the CI.
* References are tracked used ci_ref field; when ci_ref drops to 0, the
* structure can be freed.
*/
typedef struct _ibmf_ci {
/* UD destination resources */
/* free QP synchronization with WQE completion processing */
/* port kstats */
} ibmf_ci_t;
/* defines for ci_init_state */
/* defines for ci_state */
/* defines for ci_state_flags */
/*
* for keeping track of ibmf state
*/
typedef struct _ibmf_state {
/* for classes not registered */
} ibmf_state_t;
/* UD Destination resource cache definitions */
/*
* It is preferred that the difference between the hi and lo water
* marks be only a few ud_dest resources. The intent is that a
* thread that needs to run ibmf_i_populate_ud_dest_list() does not
* spend too much time in this ud_dest resource population process
* before it returns to its caller. A benefit of a higher lo water
* mark is that the larger available pool of resources supports high
* stress scenarios better.
*/
/*
* Prototypes
*/
/* ci related functions */
/* client related functions */
/* qp related functions */
/* pkt related functions */
void ibmf_i_pop_ud_dest_thread(void *argp);
/* WQE related functions */
#ifdef DEBUG
#endif
/* msg related functions */
int km_flags);
/* transaction related functions */
int msg_flags);
/* timer related functions */
void ibmf_i_recv_timeout(void *argp);
void ibmf_i_send_timeout(void *argp);
void ibmf_i_err_terminate_timeout(void *msgp);
/* rmpp related functions */
#ifdef NOTDEF
#endif
int block);
/* Alternate QP WQE cache functions */
int kmflags);
int kmflags);
/* Receive callback functions */
/* UD Dest population thread */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_MGT_IBMF_IBMF_IMPL_H */