/*
* 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_free.c
*
* PURPOSE: Endpoint management
* Description: Interfaces in this file are completely described in
* the DAPL 1.1 API, Chapter 6, section 5.4
*
* $Id: dapl_ep_free.c,v 1.21 2003/07/30 18:13:37 hobie16 Exp $
*/
#include "dapl.h"
#include "dapl_ia_util.h"
#include "dapl_ep_util.h"
#include "dapl_adapter_util.h"
#include "dapl_ring_buffer_util.h"
/*
* dapl_ep_free
*
* DAPL Requirements Version xxx, 6.5.3
*
* Destroy an instance of the Endpoint
*
* Input:
* ep_handle
*
* Output:
* none
*
* Returns:
* DAT_SUCCESS
* DAT_INVALID_PARAMETER
* DAT_INVALID_STATE
*/
{
/*
* Verify parameter & state
*/
goto bail;
}
"--> dapl_ep_free: invalid state: %x, ep %p\n",
goto bail;
}
/*
* If we are connected, issue a disconnect. If we are in the
* disconnect_pending state, disconnect with the ABRUPT flag
* set.
*/
/*
* Do verification of parameters and the state change atomically.
*/
/*
* Issue the disconnect and return. The DISCONNECT callback
* will invoke this routine and finish the job
*/
"--> dapl_ep_free: disconnecting EP: %x, ep %p\n",
} else {
}
/*
* Release all reference counts and unlink this structure. If we
* got here from a callback, don't repeat this step
*/
/* Remove link from the IA */
}
/*
* If the EP is disconnected tear everything down. Otherwise,
* disconnect the EP but leave the QP and basic EP structure
* intact; the callback code will finish the job.
*/
/*
* Update ref counts. Note the user may have used ep_modify
* to set handles to NULL.
*/
dapl_os_atomic_dec(&((DAPL_PZ *)
}
dapl_os_atomic_dec(&((DAPL_EVD *)
}
dapl_os_atomic_dec(&((DAPL_EVD *)
}
dapl_os_atomic_dec(&((DAPL_EVD *)
}
dapl_os_atomic_dec(&((DAPL_SRQ *)
}
"--> dapl_ep_free: Free EP: %x, ep %p\n",
/*
* Free the QP. If the EP has never been used,
* the QP is invalid
*/
/*
* This should always succeed, but report to the user if
* there is a problem
*/
if (dat_status != DAT_SUCCESS) {
goto bail;
}
}
/* Free the resource */
} else {
}
bail:
return (dat_status);
}