00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __VIPL_PRIV
00009 #define __VIPL_PRIV
00010
00017 #include <stdio.h>
00018 #include <stdlib.h>
00019 #include <assert.h>
00020
00021 #ifndef WIN32
00022 #include <pthread.h>
00023 #include <semaphore.h>
00024 #include <errno.h>
00025 #endif
00026 #ifdef WIN32
00027 #include <windows.h>
00028 #endif
00029
00030 #include "vipl.h"
00031 #ifdef WIN32
00032 #include "vipl_win_thread.h"
00033 #endif
00034 #include "avl.h"
00035 #include "vipl_config.h"
00036 #include "vipl_macros.h"
00037 #include "vipl_packets.h"
00038 #include "vipl_structs.h"
00039
00040 extern VIP_MUTEX_T vip_glob_lock;
00041 extern VIP_MUTEX_T vip_gm_host_name_lock;
00042 extern struct gm_lookaside *vip_glob_nic_lookaside;
00043 extern VIP_GM *vip_glob_gm_ptrs[VI_GM_MAX_NICS];
00044
00045
00047 void vip_debug (const char *, const char *, VIP_UINT32, const char *, ...);
00049 void vip_debug_gm (const char *, const char *, VIP_UINT32, gm_status_t,
00050 const char *, ...);
00051
00053 void vi_gm_debug_checksum_compute (VIP_CHKSUM *, void *, VIP_UINT32);
00055 void vi_gm_debug_checksum_check (VIP_UCHAR *, void *, VIP_CHKSUM *);
00057 void vi_gm_debug_checksum_copy (VIP_CHKSUM *, VIP_CHKSUM *);
00058
00060 VIP_RETURN vip_init_handle_set (VIP_HANDLE_SET *, VIP_UINT32, VIP_UINT32,
00061 VIP_UINT32);
00063 VIP_HANDLE *vip_allocate_handle (VIP_HANDLE_SET *);
00065 void vip_free_handle (VIP_HANDLE_SET *, VIP_HANDLE *);
00067 void vip_destroy_conn_handle_set (VIP_HANDLE_SET *);
00069 void vip_destroy_vi_handle_set (VIP_HANDLE_SET *);
00071 void vip_destroy_cq_handle_set (VIP_HANDLE_SET *);
00073 void vip_destroy_mem_handle_set (VIP_HANDLE_SET *);
00075 void vip_destroy_ptag_handle_set (VIP_HANDLE_SET *);
00076
00078 void vip_handle_conn_list (VIP_PACKET_CONN_LIST *, VIP_GM *);
00080 void vip_handle_conn_req (VIP_PACKET_CONN_REQ *, gm_recv_event_t *, VIP_GM *);
00082 void vip_handle_conn_nomatch (VIP_PACKET_CONN_NOMATCH *, VIP_GM *);
00084 void vip_handle_conn_accept (VIP_PACKET_CONN_ACCEPT *, gm_recv_event_t *, VIP_GM *);
00086 void vip_handle_conn_reject (VIP_PACKET_CONN_REJECT *);
00088 void vip_handle_conn_ack (VIP_PACKET_CONN_ACK *);
00089
00091 VIP_BOOLEAN vip_is_conn_notified (VIP_PVOID);
00093 VIP_BOOLEAN vip_is_first_desc_notified (VIP_PVOID);
00096 VIP_BOOLEAN vip_is_first_cq_entry_notified (VIP_PVOID);
00097
00099 VIP_RETURN vip_wait_for_notification (VIP_ULONG, VIP_HANDLE *,
00100 VIP_EVENT_T *,
00101 VIP_BOOLEAN (*)(VIP_PVOID), VIP_PVOID);
00102
00104 void vip_process_send_desc (VIP_VI *);
00106 VIP_SEND_REQ *vip_allocate_packet (VIP_GM *, VIP_UINT32);
00108 void vip_send_data (VIP_SEND_REQ *);
00110 void vip_return_report (VIP_GM *, VIP_NIC *, VIP_VI *, VIP_UCHAR, VIP_UCHAR);
00112 VIP_RETURN vip_check_memory_handle (VIP_NIC *, VIP_MEM_HANDLE, VIP_UINT64,
00113 VIP_UINT64, VIP_UINT32);
00115 void vip_remove_conn_waiting_list (VIP_GM *, VIP_CONN *);
00117 void vip_alive_alarm_callback (void *);
00119 void vip_alive_sent_callback (struct gm_port *, void *, gm_status_t);
00121 void vip_conn_peer_request_alarm_callback (void *);
00123 void vip_sent_callback (struct gm_port *, void *, gm_status_t);
00125 void vip_receive_event (VIP_GM *, VIP_BOOLEAN);
00127 void *vip_plumber_periodic (void *);
00129 void *vip_plumber_blocking (void *);
00131 void *vip_send_notify_thread (void *);
00133 void *vip_recv_notify_thread (void *);
00135 void *vip_cq_notify_thread (void *);
00136
00138 void vip_vi_transition_to_error_state (VIP_VI *, VIP_BOOLEAN);
00140 void vip_default_error_callback (VIP_PVOID, VIP_ERROR_DESCRIPTOR *);
00143 void vip_generate_async_error (VIP_NIC * vip_nic_ptr, VIP_VI *, VIP_CQ *,
00144 VIP_DESCRIPTOR *, VIP_RESOURCE_CODE,
00145 VIP_ERROR_CODE, VIP_UINT32);
00147 void vip_notify_desc_completion (VIP_DESCRIPTOR *, VIP_VI *, VIP_BOOLEAN);
00148
00150 int vip_avl_compare_function (const void *, const void *, void *);
00152 void vip_avl_free_function (void *, void *);
00155 VIP_UINT32 vip_avl_register_memory (VIP_GM *, VIP_UINTPTR, VIP_UINTPTR);
00158 VIP_RETURN vip_avl_deregister_memory (VIP_GM *, VIP_UINTPTR, VIP_UINTPTR);
00159
00161 VIP_UINT64 vip_addr2addrbits (VIP_PVOID);
00163 VIP_PVOID vip_addrbits2addr (VIP_UINT64);
00165 VIP_ENTRY_POINT void vip_millisleep (unsigned int);
00167 VIP_ENTRY_POINT int vip_gettimeofday (struct timeval *, void*);
00169 VIP_ENTRY_POINT int vip_gethostname (char *, size_t);
00171 VIP_ENTRY_POINT void vip_notice (char*, ...);
00173 VIP_ENTRY_POINT char *vip_vsprintf (const char *msg, ...);
00174
00175 #endif