2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
2N/A */
2N/A
2N/A/*
2N/A * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A/*
2N/A *
2N/A * MODULE: dapl_evd_un_async_error_callback.c
2N/A *
2N/A * PURPOSE: implements Unaffiliated callbacks from verbs
2N/A *
2N/A * $Id: dapl_evd_un_async_error_callb.c,v 1.9 2003/07/31 13:55:18 hobie16 Exp $
2N/A */
2N/A
2N/A#include "dapl.h"
2N/A#include "dapl_evd_util.h"
2N/A#include "dapl_adapter_util.h"
2N/A
2N/A/*
2N/A * dapl_evd_un_async_error_callback
2N/A *
2N/A * The callback function registered with verbs for unaffiliated async errors
2N/A *
2N/A * Input:
2N/A * ib_cm_handle,
2N/A * ib_cm_event
2N/A * cause_ptr
2N/A * context (evd)
2N/A *
2N/A * Output:
2N/A * None
2N/A *
2N/A */
2N/A
2N/Avoid
2N/Adapl_evd_un_async_error_callback(
2N/A IN ib_hca_handle_t ib_hca_handle,
2N/A IN ib_error_record_t *cause_ptr,
2N/A IN void *context)
2N/A{
2N/A DAPL_EVD *async_evd;
2N/A DAT_EVENT_NUMBER async_event;
2N/A DAT_RETURN dat_status;
2N/A
2N/A dapl_dbg_log(DAPL_DBG_TYPE_CALLBACK | DAPL_DBG_TYPE_EXCEPTION,
2N/A "dapl_evd_un_async_error_callback (%p, %p, %p)\n",
2N/A ib_hca_handle,
2N/A cause_ptr,
2N/A context);
2N/A
2N/A if (NULL == context) {
2N/A dapl_os_assert(!"NULL == context\n");
2N/A return;
2N/A }
2N/A
2N/A async_evd = (DAPL_EVD *) context;
2N/A
2N/A dat_status = dapls_ib_get_async_event(cause_ptr, &async_event);
2N/A
2N/A if (dat_status == DAT_SUCCESS) {
2N/A /*
2N/A * If dapls_ib_get_async_event is not successful,
2N/A * an event has been generated by the provider that
2N/A * we are not interested in. E.g. LINK_UP.
2N/A */
2N/A (void) dapls_evd_post_async_error_event(async_evd,
2N/A async_event,
2N/A async_evd->header.owner_ia);
2N/A }
2N/A dapl_dbg_log(DAPL_DBG_TYPE_CALLBACK | DAPL_DBG_TYPE_EXCEPTION,
2N/A "dapl_evd_un_async_error_callback () returns\n");
2N/A}