dapl_evd_connection_callb.c revision 9e39c5ba00a55fa05777cc94b148296af305e135
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
*
* MODULE: dapl_evd_connection_callback.c
*
* PURPOSE: implements connection callbacks
*
* Description: Accepts asynchronous callbacks from the Communications Manager
* for EVDs that have been specified as the connection_evd.
*
* $Id: dapl_evd_connection_callb.c,v 1.33 2003/07/30 18:13:38 hobie16 Exp $
*/
#include "dapl.h"
#include "dapl_evd_util.h"
#include "dapl_ep_util.h"
/*
* dapl_evd_connection_callback
*
* Connection callback function for ACTIVE connection requests; callbacks
* generated by the Connection Manager in response to issuing a
* connect call.
*
* Input:
* ib_cm_handle,
* ib_cm_event
* private_data_ptr
* context (evd)
* cr_pp
*
* Output:
* None
*
*/
void
IN const void *private_data_ptr,
{
"--> dapl_evd_connection_callback: ctxt: %p event: %x"
" cm_handle %p\n",
/*
* Determine the type of handle passed back to us in the context
* and sort out key parameters.
*/
/*
* Active side of the connection, context is an EP and
* PSP is irrelevant.
*/
switch (ib_cm_event) {
case IB_CME_CONNECTED:
{
/*
* If we don't have an EP at this point we are very screwed
* up
*/
/*
* If someone pulled the plug on the connection, just
* exit
*/
break;
}
/* copy in the private data */
(DAT_HANDLE) ep_ptr,
if (dat_status != DAT_SUCCESS) {
(void) dapls_ib_disconnect(ep_ptr,
}
/*
* If we received any premature DTO completions and
* post them to the recv evd now.
* there is a race here - if events arrive after we change
* the ep state to connected and before we process premature
* events
*/
break;
}
case IB_CME_DISCONNECTED:
{
/*
* EP is now fully disconnected; initiate any post processing
* to reset the underlying QP and get the EP ready for
* another connection
*/
/* DTO error caused this */
} else {
}
/* If the EP has been freed, the evd_ptr will be NULL */
(void) dapls_evd_post_connection_event(
}
/*
* If the user has done an ep_free of the EP, we have been
* waiting for the disconnect event; just clean it up now.
*/
(void) dapl_ep_free(ep_ptr);
}
break;
}
{
(void) dapls_evd_post_connection_event(
(DAT_HANDLE) ep_ptr,
0,
0);
break;
}
{
(void) dapls_evd_post_connection_event(
(DAT_HANDLE) ep_ptr,
0,
0);
break;
}
case IB_CME_LOCAL_FAILURE:
{
(void) dapls_evd_post_connection_event(
(DAT_HANDLE) ep_ptr,
0,
0);
break;
}
case IB_CME_TIMED_OUT:
{
(void) dapls_evd_post_connection_event(
(DAT_HANDLE) ep_ptr,
0,
0);
break;
}
default:
{
dapl_os_assert(0); /* shouldn't happen */
break;
}
}
"dapl_evd_connection_callback () returns\n");
}
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 8
* End:
*/