/*
* 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
*/
/*
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
*
* NAME: sol_uverbs.h
*
* DESC: Solaris OFED User Verbs Kernel Agent header file.
*
*/
/*
* Definitions
*/
/*
* Structures
*/
/*
* Kernel User Verbs Events.
*
* User verbs kernel events (asynchronous and completion) representation.
* IBT events are mapped back to OFA events.
*/
typedef struct uverbs_event {
union {
} ev_desc;
/*
* Module Context.
*
* There is a single module context which maintains the list
* of HCA's retrieved from IBT. A user process indicates the
* target HCA open via the uverbs unique minor device number
* associated with the HCA.
*/
typedef struct {
/*
* Underlying IBT HCA Info
*/
/*
* Support user asyncrhonous and completion event delivery via
* user event filesystem.
*/
/*
* User Event File.
*
* Used for delivery of asynchronous and synchronous events to the user.
* An asynchronous event file is created during the allocation of
* a user verbs consumer context, a completion event file is created
* when the user verbs consumer creates a completion channel.
*/
typedef struct uverbs_ufile_uobj {
int ref;
int is_async;
/*
* Type of user context -
*/
/*
* User Context.
*
* A user context is created when a user process opens a specific minor
* device. The context maintains a list of resources created by this
* user that allows the resources to be cleaned up on user close.
*/
typedef struct uverbs_uctxt_uobj {
/*
* List of user resource objects created by this context. The
* objects themselves live in the associated object table, and
* the code should use the table to access and use resources.
* Any objects that remain in these list will be destroyed at
* user close to free the associated resources.
*
* The user context "lock" should be held when invoking
* routines to manipulate the lists.
*/
/*
* Event filesystem interfaces for IB asyncrhonous events
* and completion events.
*/
/*
* User context can be created for :
* 1. All Verbs API
* 2. For getting a file for async events.
* 3. For getting a file for completion events.
* For (1) - pointers to (2) & (3) will be updated. For (2) and (3)
* pointer to (1) will be maintained.
*/
/*
* User PD objects created at PD allocation
*/
typedef struct uverbs_upd_uobj {
/*
* User MR objects created at MR registration
*/
typedef struct uverbs_umr_uobj {
/*
* User CQ objects created at CQ allocation
*/
typedef struct uverbs_ucq_uobj {
/*
* User Shared Receive CQ objects created at SRQ allocation
*/
typedef struct uverbs_usrq_uobj {
/*
* User address handle objects created at AH allocation
*/
typedef struct uverbs_uah_uobj {
/*
* User QP objects created at QP allocation
*/
typedef struct uverbs_uqp_uobj {
/*
* The following structure is used currently to pass data back to
* libmthca on user allocation context. This should be passed opaquely
* to maintain a true hal, we'll look for a generic way to get this information
* and deliver it opaquely post EA-1.
*/
struct mthca_alloc_ucontext_resp {
};
struct ib_udata {
void *inbuf;
void *outbuf;
};
int out_len);
int out_len);
int out_len);
int out_len);
int out_len);
int out_len);
int out_len);
int out_len);
int out_len);
int out_len);
int out_len);
/*
* The following helpers simply provide easy access for acquiring and locking
* User Objects.
*/
static inline uverbs_uctxt_uobj_t *
{
return (uverbs_uctxt_uobj_t *)
}
static inline uverbs_uctxt_uobj_t *
{
return (uverbs_uctxt_uobj_t *)
}
static inline uverbs_upd_uobj_t *
{
return (uverbs_upd_uobj_t *)
}
static inline uverbs_upd_uobj_t *
{
return (uverbs_upd_uobj_t *)
}
static inline uverbs_umr_uobj_t *
{
return (uverbs_umr_uobj_t *)
}
static inline uverbs_umr_uobj_t *
{
return (uverbs_umr_uobj_t *)
}
static inline uverbs_ucq_uobj_t *
{
return (uverbs_ucq_uobj_t *)
}
static inline uverbs_ucq_uobj_t *
{
return (uverbs_ucq_uobj_t *)
}
static inline uverbs_usrq_uobj_t *
{
return (uverbs_usrq_uobj_t *)
}
static inline uverbs_usrq_uobj_t *
{
return (uverbs_usrq_uobj_t *)
}
static inline uverbs_uah_uobj_t *
{
return (uverbs_uah_uobj_t *)
}
static inline uverbs_uah_uobj_t *
{
return (uverbs_uah_uobj_t *)
}
static inline uverbs_uqp_uobj_t *
{
return (uverbs_uqp_uobj_t *)
}
static inline uverbs_uqp_uobj_t *
{
return (uverbs_uqp_uobj_t *)
}
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_CLIENTS_OF_SOL_UVERBS_SOL_UVERBS_H */