9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * CDDL HEADER START
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * The contents of this file are subject to the terms of the
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Common Development and Distribution License (the "License").
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * You may not use this file except in compliance with the License.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * See the License for the specific language governing permissions
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * and limitations under the License.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * When distributing Covered Code, include this CDDL HEADER in each
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * If applicable, add the following below this CDDL HEADER, with the
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * fields enclosed by brackets "[]" replaced with your own identifying
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * information: Portions Copyright [yyyy] [name of copyright owner]
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * CDDL HEADER END
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Use is subject to license terms.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * PURPOSE: Event Management
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Description: Interfaces in this file are completely described in
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * the DAPL 1.1 API, Chapter 6, section 3
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * $Id: dapl_evd_modify_cno.c,v 1.10 2003/07/14 17:50:32 sjs2 Exp $
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * dapl_evd_modify_cno
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * DAPL Requirements Version xxx, 6.3.2.4
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Modify the CNO associated with the EVD
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * evd_handle
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * cno_handle
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * DAT_SUCCSSS
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * DAT_INVALID_HANDLE
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor /* cno_handle of DAT_HANDLE_NULL disassociated the EVD with any CNO */
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor /* nothing to change */
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor if (dapls_ib_modify_cno(evd_ptr, cno_ptr) != DAT_SUCCESS) {
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * We need to first remove the evd from the old CNO's list before
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * adding it to the new CNO's list
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor (void) dapl_llist_remove_entry(&old_cno_ptr->evd_list_head,
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor dapl_os_atomic_dec(&(old_cno_ptr->cno_ref_count));
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor /* Take a reference count on the CNO */
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * We need to enable the callback handler if the EVD has a CQ associated
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * to it and is enabled.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor if ((evd_ptr->evd_flags & (DAT_EVD_DTO_FLAG | DAT_EVD_RMR_BIND_FLAG)) &&
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor evd_ptr->evd_enabled && cno_handle != DAT_HANDLE_NULL) {
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor evd_ptr->ib_cq_handle, IB_NOTIFY_ON_NEXT_COMP, 0);
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor /* FIXME report error */