/*
* 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
*/
/*
*/
/*
*
* Provides the Solaris OFED User Verbs thin common hca interface for
* sharing of IBT client handle, device list, and asynchronous event
* delivery.
*/
#ifdef VFS_OPS
#include <sys/vfs_opreg.h>
#endif
#include <sys/semaphore.h>
extern char *sol_uverbs_dbg_str;
/*
* Globals for managing the list of HCA's and the registered clients.
*/
typedef struct sol_uverbs_hca_client_data {
void *data;
static
/*
* Function:
* sol_uverbs_ib_register_client
* Input:
* client - Pointer to the client structure
* Output:
* None
* Returns:
* Zero on success, else error code.
* Description:
* The Solaris User Verbs kernel agent provides a single
* common view of the IBTF devices. This function allows
* Solaris OFA kernel implementations to share this view
* by registerng a client callback for notification of HCA
* addtion and removal. Note that when this function is
* called, the client will get an "add" callback for all
* existing devices.
*/
int
{
}
}
return (0);
}
/*
* Function:
* sol_uverbs_ib_unregister_client
* Input:
* client - Pointer to the client structure
* Output:
* None
* Returns:
* None
* Description:
* Removes a client registration previously created with
* the sol_uverbs_ib_register_client() call.
*/
void
{
}
}
}
}
}
/*
* Function:
* sol_uverbs_ib_get_client_data
* Input:
* hca - Pointer to HCA struct passed in the client
* add function callback.
* client - A pointer to the client structure.
* Output:
* None
* Returns:
* The client data, or NULL on error.
* Description:
* Returns the client data associated with the given
* sol_uverbs_ib_set_client_data() function.
*/
void *
{
break;
}
}
return (data);
}
/*
* Function:
* sol_uverbs_ib_set_client_data
* Input:
* hca - Pointer to HCA struct passed in the client
* add function.
* client - A pointer to the client structure.
* data - The client data to associate with the HCA.
* Output:
* None
* Returns:
* None
* Description:
* Sets the client data associated with the given
* HCA.
*/
void
{
goto out;
}
}
"HCA SET CLIENT DATA: No client found for %s\n",
out:
}
/*
* Function:
* sol_uverbs_ib_register_event_handler
* Input:
* handler - Pointer to handler structure
* Output:
* None
* Returns:
* Zero
* Description:
* Register to receive ansynchronous notifications
* for the HCA defined in the handler struct. The notifications
* are delivered via the callback function defined in the handler
* struct.
*/
int
{
return (0);
}
/*
* Function:
* sol_uverbs_ib_unregister_event_handler
* Input:
* handler - Pointer to handler structure
* Output:
* None
* Returns:
* Zero
* Description:
* Unregister a ansynchronous notification handler previously
* registered via the osl_uverbs_ib_register_event_handler() call.
*/
int
{
return (0);
}
/*
* Function:
* sol_uverbs_common_hca_init
* Input:
* None
* Output:
* None
* Returns:
* Zero
* Description:
* Perform initialization required by the common hca client API.
*/
int
{
return (0);
}
/*
* Function:
* sol_uverbs_common_hca_fini
* Input:
* None
* Output:
* None
* Returns:
* None
* Description:
* Perform cleanup required by the common hca client API.
*/
void
{
}
/*
* Helpers for internal use only
*/
/*
* Function:
* sol_uverbs_hca_add_client_context
* Input:
* hca - Pointer to the hca struct to add a client context.
* client - Pointer to the client.
* Output:
* None
* Returns:
* 0 on success, else the error.
* Description:
* Create a context for the specified client and attach it to
* the specified hca.
*/
static
{
if (!context) {
"HCA: Couldn't allocate client context for %s",
return (ENOMEM);
}
return (0);
}
/*
* Function:
* sol_uverbs_ibt_hdl_to_hca
* Input:
* hca_hdl - IBT handle to an HCA.
* Output:
* None
* Returns:
* A pointer to the sol_uverbs HCA structure associated with the handle,
* or NULL if no associated HCA is found.
* Description:
* Given an IBT hca handle, return the user verbs HCA structure associated
* with that handle.
*/
{
break;
}
}
return (ret);
}