/*
* 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 (c) 2002-2003, Network Appliance, Inc. All rights reserved.
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
*
* MODULE: dapl_init.c
*
* PURPOSE: Interface Adapter management
* Description: Interfaces in this file are completely described in
* the DAPL 1.1 API, Chapter 6, section 2
*
* $Id: dapl_init.c,v 1.42 2003/06/30 15:38:20 sjs2 Exp $
*/
#include "dapl.h"
#include "dapl_hca_util.h"
#include "dapl_init.h"
#include "dapl_provider.h"
#include "dapl_mr_util.h"
#include "dapl_osd.h" /* needed for g_daplDebugLevel */
#include "dapl_adapter_util.h"
#include "dapl_name_service.h"
#include "dapl_vendor.h"
static void dapl_init(void);
static void dapl_fini(void);
/*
* dapl_init
*
* initialize this provider
* includes initialization of all global variables
* as well as registering all supported IAs with the dat registry
*
* This function needs to be called once when the provider is loaded.
*
* Input:
* none
*
* Output:
* none
*
* Return Values:
*/
static void
dapl_init(void)
{
#if defined(DAPL_DBG)
/* set up debug type */
/* set up debug level */
#endif /* DAPL_DBG */
/* See if the user is on a loopback setup */
/* initialize the provider list */
if (DAT_SUCCESS != dat_status) {
"dapl_provider_list_create failed %d\n", dat_status);
goto bail;
}
/* Set up name services */
dat_status = dapls_ns_init();
if (DAT_SUCCESS != dat_status) {
goto bail;
}
return;
bail:
dapl_fini();
}
/*
* dapl_fini
*
* finalize this provider
* includes freeing of all global variables
* as well as deregistering all supported IAs from the dat registry
*
* This function needs to be called once when the provider is loaded.
*
* Input:
* none
*
* Output:
* none
*
* Return Values:
*/
static void
dapl_fini(void)
{
/*
* Free up hca related resources
*/
if (DAT_SUCCESS != dat_status) {
"dapl_provider_list_destroy failed %d\n", dat_status);
}
}
/*
*
* This function is called by the registry to initialize a provider
*
* The instance data string is expected to have the following form:
*
* <hca name> <port number>
*
*/
/* ARGSUSED */
void
IN const char *instance_data)
{
&provider);
if (DAT_SUCCESS != dat_status) {
"dat_provider_list_insert failed: %x\n", dat_status);
goto bail;
}
goto bail;
}
/* register providers with dat_registry */
if (DAT_SUCCESS != dat_status) {
"dat_registry_add_provider failed: %x\n", dat_status);
goto bail;
}
bail:
if (DAT_SUCCESS != dat_status) {
(void) dapl_provider_list_remove(
}
}
}
}
/*
*
* This function is called by the registry to de-initialize a provider
*
*/
void
{
&provider);
if (DAT_SUCCESS != dat_status) {
"dat_registry_add_provider failed: %x\n", dat_status);
return;
}
if (DAT_SUCCESS != dat_status) {
"dat_registry_add_provider failed: %x\n", dat_status);
}
}
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 8
* End:
*/