/*
* 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_IBTL_IMPL_IBTL_IBNEX_H
#define _SYS_IB_IBTL_IMPL_IBTL_IBNEX_H
/*
*
* All data structures and function prototypes that are specific to the
* IBTL<--->IB nexus private interface.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Cfgadm restricts ap_id length to 30 bytes (See CFGA_LOG_EXT_LEN)
*/
/*
* "ioc" and "ibport" child device names
*/
/*
* These two defines are used by the function ibtl_ibnex_get_hca_info().
* If IBTL_IBNEX_LIST_CLNTS_FLAG is specified then an NVL packed list
* of only client names/ap_ids/alternate_HCA is returned.
* If IBTL_IBNEX_UNCFG_CLNTS_FLAG is specified then an NVL packed list
*/
typedef struct ibtl_ibnex_cb_args_s {
/* Possible values for cb_flag */
/*
* Function:
* ibtl_ibnex_callback_t
* Inputs:
* cb_args - Arguments for the callback
* Returns:
* Description:
* Currently this routine provides function to check wheter
* particular client has access to open HCA or not.
*/
/*
* Function:
* ibtl_ibnex_register_callback
* Inputs:
* ibnex_ibtl_callback - IBTL's IB nexus driver callback function
* Returns:
* NONE
* Description:
* Register a callback routine for IB nexus driver.
*/
/*
* Function:
* ibtl_ibnex_unregister_callback
* Inputs:
* NONE
* Returns:
* NONE
* Description:
* Un-register the callback routine for IB nexus driver.
*/
void ibtl_ibnex_unregister_callback();
/*
* Function:
* ibtl_ibnex_get_hca_info
* Input:
* hca_guid - The HCA's node GUID.
* flag - Tells what to do
* alternate_HCA database
* IBTL_IBNEX_UNCFG_CLNTS_FLAG - Build client devpaths/
* ap_id database
* callback - Callback function to get ap_id from ib(7d)
* Output:
* buffer - The information is returned in this buffer
* bufsiz - The size of the information buffer
* Returns:
* Description:
* For a given HCA node GUID it figures out the registered clients
* (ie. ones who called ibt_attach(9f) on this GUID) and creates
* a NVL packed buffer (of either names/ap_ids/alternate_HCA or
* then an error is returned.
*/
void (*callback)(dev_info_t *, char **));
/*
* Function:
* ibtl_ibnex_hcadip2guid
* Input:
* dev_info_t - The "dip" of this HCA
* Output:
* hca_guid - The HCA's node GUID.
* Description:
* For a given HCA dip it figures out the GUID
* and returns it. If not found, NULL is returned.
*/
/*
* Function:
* ibtl_ibnex_hcaguid2dip
* Input:
* hca_guid - The HCA's node GUID.
* Output:
* dev_info_t - The "dip" of this HCA
* Returns:
* "dip" on SUCCESS, NULL on FAILURE
* Description:
* For a given HCA node GUID it figures out the "dip"
* and returns it. If not found, NULL is returned.
*/
/*
* Function:
* ibtl_ibnex_get_hca_verbose_data
* Input:
* hca_guid - The HCA's node GUID.
* Output:
* buffer - The information is returned in this buffer
* bufsiz - The size of the information buffer
* Returns:
* Description:
* For a given HCA node GUID it figures out the verbose listing display.
*/
/*
* Function:
* ibtl_ibnex_valid_hca_parent
* Input:
* pdip - The parent dip from client's child dev_info_t
* Output:
* NONE
* Returns:
* Description:
* registered HCAs's dip. If match found return IBT_SUCCESS,
* else IBT_NO_HCAS_AVAILABLE.
* the ib(7d) nexus. If yes return IBT_SUCCESS,
* else IBT_NO_HCAS_AVAILABLE.
*/
/*
* Function:
* ibtl_ibnex_phci_register
* Input:
* hca_dip - The HCA dip
* Output:
* NONE
* Returns:
* Description:
* Register the HCA dip as the MPxIO PCHI.
*/
/*
* Function:
* ibtl_ibnex_phci_unregister
* Input:
* hca_dip - The HCA dip
* Output:
* NONE
* Returns:
* Description:
* Free up any pending MPxIO Pathinfos and unregister the HCA dip as the
* MPxIO PCHI.
*/
/*
* Function:
* ibtl_ibnex_query_hca_byguid
* Input:
* hca_guid - The HCA's node GUID.
* driver_name_size- size of the caller allocated driver_name buffer
* Output:
* hca_attrs - caller allocated buffer which will contain
* HCA attributes upon success
* driver_name - caller allocated buffer which will contain
* HCA driver name upon success
* driver_instance - HCA driver instance
* hca_device_path - caller allocated buffer of size MAXPATHLEN which
* will contain hca device path upon success.
* Returns:
* Description:
* Get the HCA attributes, driver name and instance number of the
* specified HCA.
*/
char *);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_IBTL_IMPL_IBTL_IBNEX_H */