/*
* 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_ep_disconnect.c
*
* PURPOSE: Endpoint management
* Description: Interfaces in this file are completely described in
* the DAPL 1.1 API, Chapter 6, section 5
*
* $Id: dapl_ep_disconnect.c,v 1.15 2003/07/30 18:13:37 hobie16 Exp $
*/
#include "dapl.h"
#include "dapl_ia_util.h"
#include "dapl_ep_util.h"
#include "dapl_evd_util.h"
#include "dapl_adapter_util.h"
/*
* dapl_ep_disconnect
*
* DAPL Requirements Version xxx, 6.5.9
*
* Terminate a connection.
*
* Input:
* ep_handle
* disconnect_flags
*
* Output:
* None
*
* Returns:
* DAT_SUCCESS
* DAT_INSUFFICIENT_RESOURCES
* DAT_INVALID_PARAMETER
*/
{
/*
* Verify parameter & state
*/
goto bail;
}
/*
* Do the verification of parameters and the state change
* atomically.
*/
/*
* Check the EP state to ensure we are queiscent. Note that
* we may get called in UNCONNECTED state in order to remove
* RECV requests from the queue prior to destroying an EP.
* See the states in the spec at 6.5.1 Endpont Lifecycle
*/
goto bail;
}
/*
* Calling disconnect when DISCONNECTED is a NOOP, just return
* good.
*/
goto bail;
}
/*
* If in state DISCONNECT_PENDING then this must be an
* ABRUPT disconnect
*/
goto bail;
}
/*
* transition ep_state to DISCONNECT_PENDING
*/
/*
* we do not have to post an event here.
* the CM will generate one.
*/
goto bail;
}
/*
* Transition the EP state to DISCONNECT_PENDING if we are
* CONNECTED. Otherwise we do not get a disconnect event and will be
* stuck in DISCONNECT_PENDING.
*
* If the user specifies a graceful disconnect, the underlying
* provider should complete all DTOs before disconnecting; in IB
* terms, this means setting the QP state to SQD before completing
* the disconnect state transitions.
*/
}
bail:
"dapl_ep_disconnect () returns 0x%x\n", dat_status);
return (dat_status);
}