dapl_evd_util.h revision 9517:b4839b0aa7a4
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22/* 23 * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved. 24 */ 25 26/* 27 * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 28 * Use is subject to license terms. 29 */ 30 31/* 32 * 33 * HEADER: dapl_evd_util.h 34 * 35 * PURPOSE: Utility defs & routines for the EVD data structure 36 * 37 * $Id: dapl_evd_util.h,v 1.10 2003/06/13 12:21:09 sjs2 Exp $ 38 * 39 */ 40 41#ifndef _DAPL_EVD_UTIL_H_ 42#define _DAPL_EVD_UTIL_H_ 43 44#ifdef __cplusplus 45extern "C" { 46#endif 47 48#include "dapl.h" 49 50DAT_RETURN 51dapls_evd_internal_create( 52 IN DAPL_IA *ia_ptr, 53 IN DAPL_CNO *cno_ptr, 54 IN DAT_COUNT min_qlen, 55 IN DAT_EVD_FLAGS evd_flags, 56 OUT DAPL_EVD **evd_ptr_ptr); 57 58DAPL_EVD * 59dapls_evd_alloc( 60 IN DAPL_IA *ia_ptr, 61 IN DAPL_CNO *cno_ptr, 62 IN DAT_EVD_FLAGS evd_flags, 63 IN DAT_COUNT qlen); 64 65DAT_RETURN 66dapls_evd_dealloc( 67 IN DAPL_EVD *evd_ptr); 68 69/* 70 * Each of these functions will retrieve a free event from 71 * the specified EVD, fill in the elements of that event, and 72 * post the event back to the EVD. If there is no EVD available, 73 * an overflow event will be posted to the async EVD associated 74 * with the EVD. 75 * 76 * DAT_INSUFFICIENT_RESOURCES will be returned on overflow, 77 * DAT_SUCCESS otherwise. 78 */ 79 80DAT_RETURN 81dapls_evd_post_cr_arrival_event( 82 IN DAPL_EVD *evd_ptr, 83 IN DAT_EVENT_NUMBER event_number, 84 IN DAT_SP_HANDLE sp_handle, 85 DAT_IA_ADDRESS_PTR ia_address_ptr, 86 DAT_CONN_QUAL conn_qual, 87 DAT_CR_HANDLE cr_handle); 88 89DAT_RETURN 90dapls_evd_post_connection_event( 91 IN DAPL_EVD *evd_ptr, 92 IN DAT_EVENT_NUMBER event_number, 93 IN DAT_EP_HANDLE ep_handle, 94 IN DAT_COUNT private_data_size, 95 IN DAT_PVOID private_data); 96 97DAT_RETURN 98dapls_evd_post_async_error_event( 99 IN DAPL_EVD *evd_ptr, 100 IN DAT_EVENT_NUMBER event_number, 101 IN DAT_IA_HANDLE ia_handle); 102 103DAT_RETURN 104dapls_evd_post_software_event( 105 IN DAPL_EVD *evd_ptr, 106 IN DAT_EVENT_NUMBER event_number, 107 IN DAT_PVOID pointer); 108 109/* 110 * dapl internal callbacks functions 111 */ 112 113/* connection verb callback */ 114extern void dapl_evd_connection_callback( 115 IN ib_cm_handle_t ib_cm_handle, 116 IN const ib_cm_events_t ib_cm_events, 117 IN const void *instant_data_p, 118 IN const void * context); 119 120/* dto verb callback */ 121extern void dapl_evd_dto_callback( 122 IN ib_hca_handle_t ib_hca_handle, 123 IN ib_cq_handle_t ib_cq_handle, 124 IN void* context); 125 126/* async verb callbacks */ 127extern void dapl_evd_un_async_error_callback( 128 IN ib_hca_handle_t ib_hca_handle, 129 IN ib_error_record_t *cause_ptr, 130 IN void *context); 131 132extern void dapl_evd_cq_async_error_callback( 133 IN ib_hca_handle_t ib_hca_handle, 134 IN ib_cq_handle_t ib_cq_handle, 135 IN ib_error_record_t *cause_ptr, 136 IN void *context); 137 138extern void dapl_evd_qp_async_error_callback( 139 IN ib_hca_handle_t ib_hca_handle, 140 IN ib_qp_handle_t ib_qp_handle, 141 IN ib_error_record_t *cause_ptr, 142 IN void *context); 143 144extern void dapls_cr_callback( 145 ib_cm_handle_t ib_cm_handle, 146 IN const ib_cm_events_t ib_cm_event, 147 IN const void *instant_data_p, 148 IN const void *context); 149 150extern void dapls_evd_copy_cq( 151 IN DAPL_EVD *evd_ptr, 152 OUT int *nevents); 153 154extern DAT_RETURN dapls_evd_copy_events( 155 DAPL_EVD *evd_ptr, 156 DAT_TIMEOUT timeout); 157 158extern void dapls_evd_post_premature_events( 159 DAPL_EP *ep_ptr); 160 161extern DAT_RETURN dapls_evd_cq_poll_to_event( 162 IN DAPL_EVD *evd_ptr, 163 OUT DAT_EVENT *event); 164 165#ifdef __cplusplus 166} 167#endif 168 169#endif /* _DAPL_EVD_UTIL_H_ */ 170