[DAPL2] remove ibal-scm in favor of openib_scm
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 26 Apr 2009 21:38:54 +0000 (21:38 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 26 Apr 2009 21:38:54 +0000 (21:38 +0000)
Remove ibal-scm from dirs file

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2138 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/dapl2/dapl/dirs
ulp/dapl2/dapl/ibal-scm/SOURCES [deleted file]
ulp/dapl2/dapl/ibal-scm/dapl_ibal-scm_cm.c [deleted file]
ulp/dapl2/dapl/ibal-scm/dapl_ibal-scm_util.c [deleted file]
ulp/dapl2/dapl/ibal-scm/makefile [deleted file]
ulp/dapl2/dapl/ibal-scm/udapl.rc [deleted file]
ulp/dapl2/dapl/ibal-scm/udapl_scm_exports.src [deleted file]
ulp/dapl2/dapl/ibal-scm/udapl_sources.c [deleted file]

index 713ed74..e865dfb 100644 (file)
@@ -1 +1 @@
-DIRS = ibal ibal-scm openib_scm openib_cma
+DIRS = ibal openib_scm openib_cma
diff --git a/ulp/dapl2/dapl/ibal-scm/SOURCES b/ulp/dapl2/dapl/ibal-scm/SOURCES
deleted file mode 100644 (file)
index 0ae83f8..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-!if $(FREEBUILD)
-TARGETNAME = dapl2-scm
-!else
-TARGETNAME = dapl2-scmd
-!endif
-
-TARGETPATH = ..\..\..\..\bin\user\obj$(BUILD_ALT_DIR)
-TARGETTYPE = DYNLINK
-DLLENTRY = _DllMainCRTStartup
-
-!if $(_NT_TOOLS_VERSION) == 0x700
-DLLDEF=$O\udapl_scm_exports.def
-!else
-DLLDEF=$(OBJ_PATH)\$O\udapl_scm_exports.def
-!endif
-
-USE_MSVCRT = 1
-
-SOURCES = udapl.rc                     \
-       udapl_sources.c                 \
-       ..\dapl_common_src.c    \
-       ..\dapl_udapl_src.c             \
-       dapl_ibal-scm_cm.c              \
-       dapl_ibal-scm_util.c
-
-INCLUDES = ..\include;..\common;..\ibal;..\..\dat\include;\
-                  ..\..\dat\udat\windows;..\udapl\windows;\
-                  ..\..\..\..\inc;..\..\..\..\inc\user;
-
-DAPL_OPTS = -DEXPORT_DAPL_SYMBOLS -D_VENDOR_IBAL_ -DDAPL_MERGE_CM_DTO\
-                       -DDAT_EXTENSIONS -DSOCK_CM
-
-USER_C_FLAGS = $(USER_C_FLAGS) $(DAPL_OPTS)
-!if !$(FREEBUILD)
-USER_C_FLAGS = $(USER_C_FLAGS) -DDAPL_DBG #-DDAPL_COUNTERS
-!endif
-
-TARGETLIBS = \
-       $(SDK_LIB_PATH)\kernel32.lib \
-       $(SDK_LIB_PATH)\ws2_32.lib \
-!if $(FREEBUILD)
-       $(TARGETPATH)\*\dat2.lib \
-       $(TARGETPATH)\*\complib.lib \
-       $(TARGETPATH)\*\ibal.lib
-!else
-       $(TARGETPATH)\*\dat2d.lib \
-       $(TARGETPATH)\*\complibd.lib \
-       $(TARGETPATH)\*\ibald.lib
-!endif
-
-# FIX ME ASAP
-#MSC_WARNING_LEVEL= /W3
-MSC_WARNING_LEVEL= /W1 /wd4113 /Wp64
diff --git a/ulp/dapl2/dapl/ibal-scm/dapl_ibal-scm_cm.c b/ulp/dapl2/dapl/ibal-scm/dapl_ibal-scm_cm.c
deleted file mode 100644 (file)
index e81c092..0000000
+++ /dev/null
@@ -1,1590 +0,0 @@
-/*
- * This Software is licensed under one of the following licenses:
- *
- * 1) under the terms of the "Common Public License 1.0" a copy of which is
- *    available from the Open Source Initiative, see
- *    http://www.opensource.org/licenses/cpl.php.
- *
- * 2) under the terms of the "The BSD License" a copy of which is
- *    available from the Open Source Initiative, see
- *    http://www.opensource.org/licenses/bsd-license.php.
- *
- * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
- *    copy of which is available from the Open Source Initiative, see
- *    http://www.opensource.org/licenses/gpl-license.php.
- *
- * Licensee has the right to choose one of the above licenses.
- *
- * Redistributions of source code must retain the above copyright
- * notice and one of the license notices.
- *
- * Redistributions in binary form must reproduce both the above copyright
- * notice, one of the license notices in the documentation
- * and/or other materials provided with the distribution.
- */
-
-/***************************************************************************
- *
- *   Module:            uDAPL
- *
- *   Filename:          dapl_sock_cm.c
- *
- *   Authors:           Arlin Davis / Stan C. Smith
- *
- *   Created:           3/10/2005
- *
- *   Description: 
- *
- *   The uDAPL socket CM provider - connection management
- *
- ****************************************************************************
- *                Source Control System Information
- *
- *    $Id: $
- *
- *     Copyright (c) 2007 Intel Corporation.  All rights reserved.
- *
- **************************************************************************/
-
-#include "dapl.h"
-#include "dapl_adapter_util.h"
-#include "dapl_evd_util.h"
-#include "dapl_cr_util.h"
-#include "dapl_name_service.h"
-#include "dapl_ibal_name_service.h"
-#include "dapl_ibal_util.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <windows.h>
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <io.h>
-
-extern int g_scm_pipe[2];
-
-extern DAT_RETURN
-dapls_ib_query_gid( IN  DAPL_HCA       *hca_ptr,
-                   IN  GID             *gid );
-
-
-static struct ib_cm_handle * dapli_cm_create(void)
-{ 
-       struct ib_cm_handle *cm_ptr;
-
-       /* Allocate CM, init lock, and initialize */
-       if ((cm_ptr = dapl_os_alloc(sizeof(*cm_ptr))) == NULL) 
-               return NULL;
-
-       (void)dapl_os_memzero(cm_ptr, sizeof(*cm_ptr));
-        if (dapl_os_lock_init(&cm_ptr->lock)) 
-               goto bail;
-
-       cm_ptr->dst.ver = htons(DSCM_VER);
-       cm_ptr->socket = -1;
-       cm_ptr->l_socket = -1;
-       return cm_ptr;
-bail:
-       dapl_os_free(cm_ptr, sizeof(*cm_ptr));
-       return NULL;
-}
-
-
-/* mark for destroy, remove all references, schedule cleanup */
-
-static void dapli_cm_destroy(struct ib_cm_handle *cm_ptr)
-{
-       dapl_dbg_log(DAPL_DBG_TYPE_CM, 
-                    " cm_destroy: cm %p ep %p\n", cm_ptr,cm_ptr->ep);
-       
-       /* cleanup, never made it to work queue */
-       if (cm_ptr->state == SCM_INIT) {
-               if (cm_ptr->socket >= 0)  
-                       closesocket(cm_ptr->socket);
-               if (cm_ptr->l_socket >= 0)  
-                       closesocket(cm_ptr->l_socket);
-               dapl_os_free(cm_ptr, sizeof(*cm_ptr));
-               return;
-       }
-
-       dapl_os_lock(&cm_ptr->lock);
-       cm_ptr->state = SCM_DESTROY;
-       if (cm_ptr->ep) 
-               cm_ptr->ep->cm_handle = IB_INVALID_HANDLE;
-
-       /* close socket if still active */
-       if (cm_ptr->socket >= 0) {
-               closesocket(cm_ptr->socket);
-               cm_ptr->socket = -1;
-       }
-       if (cm_ptr->l_socket >= 0) {
-               closesocket(cm_ptr->l_socket);
-               cm_ptr->l_socket = -1;
-       }
-       dapl_os_unlock(&cm_ptr->lock);
-
-       /* wakeup work thread */
-       _write(g_scm_pipe[1], "w", sizeof "w");
-}
-
-
-/* queue socket for processing CM work */
-static void dapli_cm_queue(struct ib_cm_handle *cm_ptr)
-{
-       /* add to work queue for cr thread processing */
-       dapl_llist_init_entry((DAPL_LLIST_ENTRY*)&cm_ptr->entry);
-       dapl_os_lock( &cm_ptr->hca->ib_trans.lock );
-       dapl_llist_add_tail((DAPL_LLIST_HEAD*)&cm_ptr->hca->ib_trans.list, 
-                           (DAPL_LLIST_ENTRY*)&cm_ptr->entry, (void*)cm_ptr);
-       dapl_os_unlock(&cm_ptr->hca->ib_trans.lock);
-
-        /* wakeup CM work thread */
-        _write(g_scm_pipe[1], "w", sizeof "w");
-}
-
-
-
-static uint16_t
-dapli_get_lid(IN DAPL_HCA *hca, IN int port)
-{
-    dapl_ibal_ca_t      *p_ca = (dapl_ibal_ca_t *) hca->ib_hca_handle;
-    dapl_ibal_port_t    *p_active_port;
-    p_ca = (dapl_ibal_ca_t *) hca->ib_hca_handle;
-
-    if (NULL == p_ca)
-    {
-        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,
-                       "--> %s() There is no HCA @ line #%d\n",
-                       __FUNCTION__, __LINE__);
-        return 0;
-    }
-
-    /*
-     * We are using the first active port in the list for
-     * communication. We have to get back here when we decide to support
-     * fail-over and high-availability.
-     */
-    p_active_port = dapli_ibal_get_port ( p_ca, (uint8_t)port );
-
-    if (NULL == p_active_port)
-    {
-        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,
-                       "--> %s() Port %d is not available @ line #%d\n",
-                       __FUNCTION__, port, __LINE__);
-        return 0;
-    }
-
-    if (p_active_port->p_attr->link_state != IB_LINK_ACTIVE)
-    {
-       /* 
-         * Port is DOWN; can not send or recv messages
-         */
-       dapl_dbg_log (DAPL_DBG_TYPE_ERR,"--> %s() Port %d is DOWN; "
-                       "can not send/recv to/from fabric\n", 
-                       __FUNCTION__, p_active_port->p_attr->port_num);
-        return 0;
-    }
-
-    if (p_active_port->p_attr->lid == 0) 
-    {
-            dapl_dbg_log ( DAPL_DBG_TYPE_ERR, "--> %s() Port %d has no LID "
-                           "assigned; can not operate\n", 
-                       __FUNCTION__, p_active_port->p_attr->port_num);
-    }
-#if 0 && defined(DAPL_DBG)
-    dapl_dbg_log(DAPL_DBG_TYPE_CM, "--> %s() Port_num %d LID 0x%x\n", 
-               __FUNCTION__, p_active_port->p_attr->port_num,
-               p_active_port->p_attr->lid);
-#endif
-
-    return p_active_port->p_attr->lid; 
-}
-
-
-/*
- * ACTIVE/PASSIVE: called from CR thread or consumer via ep_disconnect
- */
-static DAT_RETURN 
-dapli_socket_disconnect(dp_ib_cm_handle_t cm_ptr)
-{
-       DAPL_EP *ep_ptr = cm_ptr->ep;
-       DAT_UINT32 disc_data = htonl(0xdead);
-
-       if (ep_ptr == NULL)
-               return DAT_SUCCESS;
-       
-       dapl_os_lock(&cm_ptr->lock);
-       if ((cm_ptr->state == SCM_INIT) ||
-           (cm_ptr->state == SCM_DISCONNECTED)) {
-               dapl_os_unlock(&cm_ptr->lock);
-               return DAT_SUCCESS;
-       } else {
-               /* send disc date, close socket, schedule destroy */
-               if (cm_ptr->socket >= 0) { 
-                       send(cm_ptr->socket, (const char *)&disc_data,
-                               sizeof(disc_data), 0);
-                       closesocket(cm_ptr->socket);
-                       cm_ptr->socket = -1;
-               }
-               cm_ptr->state = SCM_DISCONNECTED;
-               _write(g_scm_pipe[1], "w", sizeof "w");
-       }
-       dapl_os_unlock(&cm_ptr->lock);
-
-
-       if (ep_ptr->cr_ptr) {
-               dapls_cr_callback(cm_ptr,
-                                 IB_CME_DISCONNECTED,
-                                 NULL,
-                                 ((DAPL_CR *)ep_ptr->cr_ptr)->sp_ptr);
-       } else {
-               dapl_evd_connection_callback(ep_ptr->cm_handle,
-                                            IB_CME_DISCONNECTED,
-                                            NULL,
-                                            ep_ptr);
-       }       
-
-       /* remove reference from endpoint */
-       ep_ptr->cm_handle = NULL;
-       
-       /* schedule destroy */
-
-
-       return DAT_SUCCESS;
-}
-
-
-
-/*
- * PASSIVE: consumer accept, send local QP information, private data, 
- * queue on work thread to receive RTU information to avoid blocking
- * user thread. 
- */
-static DAT_RETURN 
-dapli_socket_accept_usr( DAPL_EP       *ep_ptr,
-                        DAPL_CR        *cr_ptr,
-                        DAT_COUNT      p_size,
-                        DAT_PVOID      p_data )
-{
-       DAPL_IA         *ia_ptr = ep_ptr->header.owner_ia;
-       dp_ib_cm_handle_t cm_ptr = cr_ptr->ib_cm_handle;
-       WSABUF          iovec[2];
-       int             len, rc;
-       short           rtu_data = 0;
-       ib_api_status_t ibs;
-       ib_qp_attr_t    qpa;
-       dapl_ibal_port_t *p_port;
-       dapl_ibal_ca_t  *p_ca;
-
-       dapl_dbg_log (DAPL_DBG_TYPE_EP, "%s() p_sz %d sock %d port 0x%x\n",
-                       __FUNCTION__,p_size,cm_ptr->socket,
-                       ia_ptr->hca_ptr->port_num);
-
-       if (p_size >  IB_MAX_REP_PDATA_SIZE) 
-               return DAT_LENGTH_ERROR;
-
-       /* must have a accepted socket */
-       if ( cm_ptr->socket < 0 ) {
-               dapl_dbg_log(DAPL_DBG_TYPE_EP, 
-                    "%s() Not accepted socket? remote port=0x%x lid=0x%x"
-                    " qpn=0x%x psize=%d\n",
-                    cm_ptr->dst.port, cm_ptr->dst.lid,
-                    ntohs(cm_ptr->dst.qpn), cm_ptr->dst.p_size); 
-               return DAT_INTERNAL_ERROR;
-       }
-       
-       dapl_dbg_log(DAPL_DBG_TYPE_EP, 
-                    " accept_usr: remote port=0x%x lid=0x%x"
-                    " qpn=0x%x psize=%d\n",
-                    cm_ptr->dst.port, cm_ptr->dst.lid,
-                    ntohs(cm_ptr->dst.qpn), cm_ptr->dst.p_size); 
-
-       /* modify QP to RTR and then to RTS with remote info already read */
-
-       p_ca = (dapl_ibal_ca_t *) ia_ptr->hca_ptr->ib_hca_handle;
-       p_port = dapli_ibal_get_port (p_ca, (uint8_t)ia_ptr->hca_ptr->port_num);
-       if (!p_port)
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR,
-                       "%s() dapli_ibal_get_port() failed @ line #%d\n",
-                       __FUNCTION__,__LINE__);
-               goto bail;
-       }
-
-       dapl_dbg_log(DAPL_DBG_TYPE_EP,
-                       "%s() DST: qpn 0x%x port 0x%x lid %x psize %d\n",
-                       __FUNCTION__,
-                       cl_ntoh32(cm_ptr->dst.qpn),
-                       cm_ptr->dst.port,
-                       cl_ntoh16(cm_ptr->dst.lid), cm_ptr->dst.p_size);
-
-       /* modify QP to RTR and then to RTS with remote info */
-
-       ibs = dapls_modify_qp_state_to_rtr( ep_ptr->qp_handle, 
-                                           cm_ptr->dst.qpn,
-                                           cm_ptr->dst.lid,
-                                           p_port );
-       if (ibs != IB_SUCCESS)
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR,
-                               "%s() QP --> RTR failed @ line #%d\n",
-                               __FUNCTION__,__LINE__);
-               goto bail;
-       }
-
-       if ( dapls_modify_qp_state_to_rts( ep_ptr->qp_handle ) )
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR,
-                               "%s() QP --> RTS failed @ line #%d\n",
-                               __FUNCTION__,__LINE__);
-               goto bail;
-       }
-
-       ep_ptr->qp_state = IB_QP_STATE_RTS;
-       
-       /* save remote address information */
-       dapl_os_memcpy( &ep_ptr->remote_ia_address, 
-                       &cm_ptr->dst.ia_address, 
-                       sizeof(ep_ptr->remote_ia_address));
-
-       /* determine QP & port numbers */
-       ibs = ib_query_qp(ep_ptr->qp_handle, &qpa);
-       if (ibs != IB_SUCCESS)
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                            " ib_query_qp() ERR %s\n", ib_get_err_str(ibs)); 
-               goto bail;
-       }
-
-       /* Send our QP info, IA address, and private data */
-       cm_ptr->dst.qpn = qpa.num; /* ib_net32_t */
-       cm_ptr->dst.port = ia_ptr->hca_ptr->port_num;
-       cm_ptr->dst.lid = dapli_get_lid(ia_ptr->hca_ptr, ia_ptr->hca_ptr->port_num);
-       /* set gid in network order */
-       ibs = dapls_ib_query_gid( ia_ptr->hca_ptr, &cm_ptr->dst.gid );
-       if ( ibs != IB_SUCCESS )
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                       "%s() dapls_ib_query_gid() returns '%s'\n",
-                       __FUNCTION__,ib_get_err_str(ibs)); 
-               goto bail;
-       }
-
-       cm_ptr->dst.ia_address = ia_ptr->hca_ptr->hca_address;
-       cm_ptr->dst.p_size = p_size;
-
-       dapl_dbg_log(DAPL_DBG_TYPE_CM,
-               "%s()\n  Tx QP info: qpn %x port 0x%x lid 0x%x p_sz %d IP %s\n",
-               __FUNCTION__, cl_ntoh32(cm_ptr->dst.qpn), cm_ptr->dst.port,
-               cl_ntoh16(cm_ptr->dst.lid), cm_ptr->dst.p_size,
-               dapli_get_ip_addr_str(&cm_ptr->dst.ia_address,NULL));
-
-       /* network byte-ordering - QPN & LID already are */
-       cm_ptr->dst.p_size = cl_hton32(cm_ptr->dst.p_size);
-       cm_ptr->dst.port = cl_hton16(cm_ptr->dst.port);
-
-       iovec[0].buf = (char*)&cm_ptr->dst;
-       iovec[0].len  = sizeof(ib_qp_cm_t);
-       if (p_size) {
-               iovec[1].buf = p_data;
-               iovec[1].len  = p_size;
-       }
-       rc = WSASend( cm_ptr->socket, iovec, (p_size ? 2:1), &len, 0, 0, 0 );
-       if (rc || len != (p_size + sizeof(ib_qp_cm_t))) {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                            " accept_usr: ERR %d, wcnt=%d\n",
-                            WSAGetLastError(), len); 
-               goto bail;
-       }
-       dapl_dbg_log(DAPL_DBG_TYPE_CM, 
-                    " accept_usr: local port=0x%x lid=0x%x"
-                    " qpn=0x%x psize=%d\n",
-                    ntohs(cm_ptr->dst.port), ntohs(cm_ptr->dst.lid), 
-                    ntohl(cm_ptr->dst.qpn), ntohl(cm_ptr->dst.p_size)); 
-       
-       /* save state and reference to EP, queue for RTU data */
-       cm_ptr->ep = ep_ptr;
-       cm_ptr->hca = ia_ptr->hca_ptr;
-       cm_ptr->state = SCM_ACCEPTED;
-
-       /* restore remote address information for query */
-       dapl_os_memcpy( &cm_ptr->dst.ia_address, 
-                       &ep_ptr->remote_ia_address,
-                       sizeof(cm_ptr->dst.ia_address));
-
-       dapl_dbg_log( DAPL_DBG_TYPE_EP," PASSIVE: accepted!\n" ); 
-       dapli_cm_queue(cm_ptr);
-
-       return DAT_SUCCESS;
-
-bail:
-       dapl_dbg_log( DAPL_DBG_TYPE_ERR," accept_usr: ERR !QP_RTR_RTS \n"); 
-       dapli_cm_destroy(cm_ptr);
-       dapls_ib_reinit_ep( ep_ptr ); /* reset QP state */
-
-       return DAT_INTERNAL_ERROR;
-}
-
-
-/*
- * PASSIVE: read RTU from active peer, post CONN event
- */
-void 
-dapli_socket_accept_rtu(dp_ib_cm_handle_t cm_ptr)
-{
-       int             len;
-       short           rtu_data = 0;
-
-       /* complete handshake after final QP state change */
-       len = recv(cm_ptr->socket, (char*)&rtu_data, sizeof(rtu_data), 0);
-       if ( len != sizeof(rtu_data) || ntohs(rtu_data) != 0x0e0f ) {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                            " accept_rtu: ERR %d, rcnt=%d rdata=%x\n",
-                            WSAGetLastError(), len, ntohs(rtu_data) ); 
-               goto bail;
-       }
-
-       /* save state and reference to EP, queue for disc event */
-       cm_ptr->state = SCM_CONNECTED;
-
-       /* final data exchange if remote QP state is good to go */
-       dapl_dbg_log( DAPL_DBG_TYPE_EP," PASSIVE: connected!\n" ); 
-       dapls_cr_callback(cm_ptr, IB_CME_CONNECTED, NULL, cm_ptr->sp);
-       return;
-bail:
-       dapls_ib_reinit_ep(cm_ptr->ep); /* reset QP state */
-       dapli_cm_destroy(cm_ptr);
-       dapls_cr_callback(cm_ptr, IB_CME_DESTINATION_REJECT, NULL, cm_ptr->sp);
-}
-
-
-/*
- * ACTIVE: Create socket, connect, and exchange QP information 
- */
-static DAT_RETURN 
-dapli_socket_connect ( DAPL_EP                 *ep_ptr,
-                       DAT_IA_ADDRESS_PTR      r_addr,
-                       DAT_CONN_QUAL           r_qual,
-                       DAT_COUNT               p_size,
-                       DAT_PVOID               p_data )
-{
-       dp_ib_cm_handle_t cm_ptr;
-       DAPL_IA         *ia_ptr = ep_ptr->header.owner_ia;
-       int             len, rc, opt = 1;
-       WSABUF          iovec[2];
-       DWORD           ioflags;
-       short           rtu_data = htons(0x0E0F);
-       ib_qp_attr_t    qpa;
-       ib_api_status_t ibs;
-       dapl_ibal_port_t *p_port;
-       dapl_ibal_ca_t  *p_ca;
-       
-       dapl_dbg_log(DAPL_DBG_TYPE_EP, " connect: r_qual %d psize %d\n",
-                    r_qual, p_size);
-                       
-       cm_ptr = dapli_cm_create();
-       if (cm_ptr == NULL)
-               return DAT_INSUFFICIENT_RESOURCES;
-
-       /* create, connect, sockopt, and exchange QP information */
-       if ((cm_ptr->socket = socket(AF_INET,SOCK_STREAM,0)) < 0 ) {
-               dapli_cm_destroy(cm_ptr);
-               return DAT_INSUFFICIENT_RESOURCES;
-       }
-
-       ((struct sockaddr_in*)r_addr)->sin_port = htons(r_qual);
-
-       if (connect(cm_ptr->socket, r_addr, sizeof(*r_addr)) == SOCKET_ERROR) {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, " connect: %d on r_qual %d\n",
-                            WSAGetLastError(), (unsigned int)r_qual);
-               dapli_cm_destroy(cm_ptr);
-               return DAT_INVALID_ADDRESS;
-       }
-
-       (void)setsockopt( cm_ptr->socket,
-                         IPPROTO_TCP,TCP_NODELAY,
-                         (const char*)&opt,
-                         sizeof(opt) );
-       
-       dapl_dbg_log(DAPL_DBG_TYPE_EP, " socket connected!\n");
-
-       /* determine QP & port numbers */
-       ibs = ib_query_qp(ep_ptr->qp_handle, &qpa);
-       if (ibs != IB_SUCCESS)
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                            " ib_query_qp() ERR %s\n", ib_get_err_str(ibs)); 
-               goto bail;
-       }
-
-       /* Send QP info, IA address and private data */
-       cm_ptr->dst.qpn = qpa.num; /* ib_net32_t */
-       cm_ptr->dst.port = cl_hton16(ia_ptr->hca_ptr->port_num);
-       cm_ptr->dst.lid = dapli_get_lid( ia_ptr->hca_ptr, 
-                                        ia_ptr->hca_ptr->port_num );
-       if (cm_ptr->dst.lid == 0)
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                               "%s() ERR lid == 0? @ line #%d\n",
-                               __FUNCTION__, __LINE__); 
-               goto bail;
-       }
-
-       /* set gid in network order */
-       ibs = dapls_ib_query_gid( ia_ptr->hca_ptr, &cm_ptr->dst.gid );
-       if ( ibs != IB_SUCCESS )
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                       "%s() dapls_ib_query_gid() returns '%s'\n",
-                       __FUNCTION__,ib_get_err_str(ibs)); 
-               goto bail;
-       }
-
-       cm_ptr->dst.ia_address = ia_ptr->hca_ptr->hca_address;
-       cm_ptr->dst.p_size = cl_hton32(p_size);
-
-       dapl_dbg_log(DAPL_DBG_TYPE_CM, "%s()\n  Tx QP info: qpn %x "
-                       "port %d lid 0x%x p_sz %d IP %s\n",__FUNCTION__,
-                       cl_ntoh32(cm_ptr->dst.qpn), cl_ntoh16(cm_ptr->dst.port),
-                       cl_ntoh16(cm_ptr->dst.lid),
-                       cl_ntoh32(cm_ptr->dst.p_size),
-                       dapli_get_ip_addr_str(&cm_ptr->dst.ia_address,NULL));
-
-       iovec[0].buf = (char*)&cm_ptr->dst;
-       iovec[0].len  = sizeof(ib_qp_cm_t);
-       if ( p_size ) {
-               iovec[1].buf = p_data;
-               iovec[1].len  = p_size;
-       }
-
-       dapl_dbg_log(DAPL_DBG_TYPE_EP," socket connected, write QP and private data\n"); 
-       rc = WSASend (cm_ptr->socket, iovec, (p_size ? 2:1), &len, 0, 0, NULL);
-       if ( rc || len != (p_size + sizeof(ib_qp_cm_t)) ) {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                            " connect write: ERR %d, wcnt=%d\n",
-                            WSAGetLastError(), len); 
-               goto bail;
-       }
-       dapl_dbg_log(DAPL_DBG_TYPE_EP, 
-                    " connect: SRC port=0x%x lid=0x%x, qpn=0x%x, psize=%d\n",
-                    cm_ptr->dst.port, cm_ptr->dst.lid, 
-                    cm_ptr->dst.qpn, cm_ptr->dst.p_size ); 
-
-       /* queue up to work thread to avoid blocking consumer */
-       cm_ptr->state = SCM_CONN_PENDING;
-       cm_ptr->hca = ia_ptr->hca_ptr;
-       cm_ptr->ep = ep_ptr;
-       dapli_cm_queue(cm_ptr);
-       return DAT_SUCCESS;
-bail:
-       /* close socket, free cm structure */
-       dapli_cm_destroy(cm_ptr);
-       return DAT_INTERNAL_ERROR;
-}
-
-
-/*
- * ACTIVE: exchange QP information, called from CR thread
- */
-void 
-dapli_socket_connect_rtu(dp_ib_cm_handle_t cm_ptr)
-{
-       DAPL_EP         *ep_ptr = cm_ptr->ep;
-       DAPL_IA         *ia_ptr = cm_ptr->ep->header.owner_ia;
-       int             len, rc;
-       DWORD           ioflags;
-       WSABUF          iovec[1];
-       short           rtu_data = htons(0x0E0F);
-       ib_cm_events_t  event = IB_CME_DESTINATION_REJECT;
-       ib_api_status_t ibs;
-       dapl_ibal_port_t *p_port;
-       dapl_ibal_ca_t  *p_ca;
-
-       /* read DST information into cm_ptr, overwrite SRC info */
-       dapl_dbg_log(DAPL_DBG_TYPE_EP," connect_rtu: recv peer QP data\n"); 
-
-       iovec[0].buf = (char*)&cm_ptr->dst;
-       iovec[0].len  = sizeof(ib_qp_cm_t);
-       ioflags = len = 0;
-       rc = WSARecv (cm_ptr->socket, iovec, 1, &len, &ioflags, 0, 0);
-       if ( rc == SOCKET_ERROR || len != sizeof(ib_qp_cm_t) ||
-                                       ntohs(cm_ptr->dst.ver) != DSCM_VER )
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR,
-                            "connect_rtu read: ERR %d rcnt=%d ver=%d\n",
-                            WSAGetLastError(), len, cm_ptr->dst.ver); 
-               goto bail;
-       }
-
-       /* check for consumer reject */
-       if (cm_ptr->dst.rej) {
-               dapl_dbg_log(DAPL_DBG_TYPE_CM, 
-                            " connect_rtu read: PEER REJ reason=0x%x\n",
-                            ntohs(cm_ptr->dst.rej)); 
-               event = IB_CME_DESTINATION_REJECT_PRIVATE_DATA;
-               goto bail;
-       }
-
-       /* convert peer response values to host order */
-       cm_ptr->dst.port = cl_ntoh16(cm_ptr->dst.port);
-       cm_ptr->dst.lid = ntohs(cm_ptr->dst.lid);
-       cm_ptr->dst.qpn = cm_ptr->dst.qpn;
-       cm_ptr->dst.p_size = cl_ntoh32(cm_ptr->dst.p_size);
-
-       dapl_dbg_log(DAPL_DBG_TYPE_EP, " connect: Rx DST: qpn %x port %d "
-                       "lid %x psize %d IP %s\n",
-                       cl_ntoh32(cm_ptr->dst.qpn), cm_ptr->dst.port,
-                       cl_ntoh16(cm_ptr->dst.lid), 
-                       cm_ptr->dst.p_size,
-                       dapli_get_ip_addr_str(&cm_ptr->dst.ia_address,NULL));
-
-       /* save remote address information */
-       dapl_os_memcpy( &ep_ptr->remote_ia_address, 
-                       &cm_ptr->dst.ia_address, 
-                       sizeof(ep_ptr->remote_ia_address));
-
-       dapl_dbg_log(DAPL_DBG_TYPE_EP, 
-                    " connect_rtu: DST %s port=0x%x lid=0x%x, qpn=0x%x, psize=%d\n",
-                    inet_ntoa(((struct sockaddr_in *)&cm_ptr->dst.ia_address)->sin_addr),
-                    cm_ptr->dst.port, cm_ptr->dst.lid, 
-                    cm_ptr->dst.qpn, cm_ptr->dst.p_size); 
-
-       /* validate private data size before reading */
-       if (cm_ptr->dst.p_size > IB_MAX_REP_PDATA_SIZE) {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                            " connect_rtu read: psize (%d) wrong\n",
-                            cm_ptr->dst.p_size ); 
-               goto bail;
-       }
-
-       /* read private data into cm_handle if any present */
-       dapl_dbg_log(DAPL_DBG_TYPE_EP," socket connected, read private data\n"); 
-       if ( cm_ptr->dst.p_size ) {
-               iovec[0].buf = cm_ptr->p_data;
-               iovec[0].len  = cm_ptr->dst.p_size;
-               ioflags = 0;
-               rc = WSARecv (cm_ptr->socket, iovec, 1, &len, &ioflags, 0, 0 );
-               if (rc || len != cm_ptr->dst.p_size, &len, 0, 0, 0 ) {
-                       dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                               " connect read pdata: ERR %d, rcnt=%d\n",
-                               WSAGetLastError(), len); 
-                       goto bail;
-               }
-       }
-
-       p_ca = (dapl_ibal_ca_t *) ia_ptr->hca_ptr->ib_hca_handle;
-       p_port = dapli_ibal_get_port (p_ca, (uint8_t)ia_ptr->hca_ptr->port_num);
-       if (!p_port)
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR,
-                       "%s() dapli_ibal_get_port() failed @ line #%d\n",
-                       __FUNCTION__,__LINE__);
-               goto bail;
-       }
-
-       /* modify QP to RTR and then to RTS with remote info */
-       ibs = dapls_modify_qp_state_to_rtr( ep_ptr->qp_handle, 
-                                           cm_ptr->dst.qpn,
-                                           cm_ptr->dst.lid,
-                                           p_port );
-       if (ibs != IB_SUCCESS)
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR,
-                               "%s() QP --> RTR failed @ line #%d\n",
-                               __FUNCTION__,__LINE__);
-               goto bail;
-       }
-
-       if ( dapls_modify_qp_state_to_rts( ep_ptr->qp_handle ) )
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR,
-                               "%s() QP --> RTS failed @ line #%d\n",
-                               __FUNCTION__,__LINE__);
-               goto bail;
-       }
-                
-       ep_ptr->qp_state = IB_QP_STATE_RTS;
-
-       dapl_dbg_log(DAPL_DBG_TYPE_EP," connect_rtu: send RTU\n"); 
-
-       /* complete handshake after final QP state change */
-       send(cm_ptr->socket, (const char *)&rtu_data, sizeof(rtu_data), 0);
-
-       /* init cm_handle and post the event with private data */
-       ep_ptr->cm_handle = cm_ptr;
-       cm_ptr->state = SCM_CONNECTED;
-       dapl_dbg_log( DAPL_DBG_TYPE_EP," ACTIVE: connected!\n" ); 
-
-       dapl_evd_connection_callback(   ep_ptr->cm_handle, 
-                                       IB_CME_CONNECTED, 
-                                       cm_ptr->p_data, 
-                                       ep_ptr );       
-       return;
-bail:
-       /* close socket, free cm structure and post error event */
-       dapli_cm_destroy(cm_ptr);
-       dapls_ib_reinit_ep(ep_ptr); /* reset QP state */
-       dapl_evd_connection_callback(   NULL /*ep_ptr->cm_handle*/, 
-                                       event, 
-                                       NULL, 
-                                       ep_ptr );
-}
-
-
-/*
- * PASSIVE: Create socket, listen, accept, exchange QP information 
- */
-static DAT_RETURN 
-dapli_socket_listen (  DAPL_IA         *ia_ptr,
-                       DAT_CONN_QUAL   serviceID,
-                       DAPL_SP         *sp_ptr )
-{
-       struct sockaddr_in      addr;
-       ib_cm_srvc_handle_t     cm_ptr = NULL;
-       int                     opt = 1, rc;
-       DAT_RETURN              dat_status = DAT_SUCCESS;
-
-       dapl_dbg_log (  DAPL_DBG_TYPE_EP,
-                       " listen(ia_ptr %p ServiceID %d sp_ptr %p)\n",
-                       ia_ptr, serviceID, sp_ptr);
-
-       /* Allocate CM and initialize */
-       cm_ptr = dapli_cm_create();
-       if (cm_ptr == NULL)
-               return DAT_INSUFFICIENT_RESOURCES;
-
-       cm_ptr->sp = sp_ptr;
-       cm_ptr->hca = ia_ptr->hca_ptr;
-       
-       /* bind, listen, set sockopt, accept, exchange data */
-       if ((cm_ptr->l_socket = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
-               dapl_dbg_log (DAPL_DBG_TYPE_ERR, 
-                               "socket for listen returned %d\n", errno);
-               dat_status = DAT_INSUFFICIENT_RESOURCES;
-               goto bail;
-       }
-
-       setsockopt(cm_ptr->l_socket,
-                  SOL_SOCKET,
-                  SO_REUSEADDR,
-                  (const char *)&opt,
-                  sizeof(opt));
-       addr.sin_port        = htons(serviceID);
-       addr.sin_family      = AF_INET;
-       addr.sin_addr.s_addr = INADDR_ANY;
-
-       rc = bind (cm_ptr->l_socket, (struct sockaddr*)&addr, sizeof(addr));
-       if (rc == SOCKET_ERROR)
-       {
-               rc = WSAGetLastError();
-               dapl_dbg_log( DAPL_DBG_TYPE_CM,
-                               " bind: ERROR %d on conn_qual 0x%x\n",
-                               rc,serviceID); 
-
-               if ( rc == WSAEADDRINUSE )
-                       dat_status = DAT_CONN_QUAL_IN_USE;
-               else
-                       dat_status = DAT_CONN_QUAL_UNAVAILABLE;
-               goto bail;
-       }
-
-       rc = listen (cm_ptr->l_socket, 128);
-       if (rc == SOCKET_ERROR)
-       {
-               rc = WSAGetLastError();
-               dapl_dbg_log( DAPL_DBG_TYPE_CM,
-                               " listen: ERROR %d on conn_qual 0x%x\n",
-                               rc,serviceID); 
-
-               if ( rc == WSAEADDRINUSE )
-                       dat_status = DAT_CONN_QUAL_IN_USE;
-               else
-                       dat_status = DAT_CONN_QUAL_UNAVAILABLE;
-               goto bail;
-       }
-       
-       /* set cm_handle for this service point, save listen socket */
-       sp_ptr->cm_srvc_handle = cm_ptr;
-
-       /* queue up listen socket to process inbound CR's */
-       cm_ptr->state = SCM_LISTEN;
-       dapli_cm_queue(cm_ptr);
-
-       dapl_dbg_log( DAPL_DBG_TYPE_CM,
-                       " listen: qual 0x%x cr %p s_fd %d\n",
-                       ntohs(serviceID), cm_ptr, cm_ptr->l_socket ); 
-       
-       return dat_status;
-bail:
-       dapl_dbg_log( DAPL_DBG_TYPE_CM,
-                       " listen: ERROR on conn_qual 0x%x\n",serviceID); 
-       dapli_cm_destroy(cm_ptr);
-       return dat_status;
-}
-
-
-/*
- * PASSIVE: send local QP information, private data, and wait for 
- *         active side to respond with QP RTS/RTR status 
- */
-static DAT_RETURN 
-dapli_socket_accept(ib_cm_srvc_handle_t cm_ptr)
-{
-       dp_ib_cm_handle_t acm_ptr;
-       void            *p_data = NULL;
-       int             len;
-       DAT_RETURN      dat_status = DAT_SUCCESS;
-               
-       dapl_dbg_log(DAPL_DBG_TYPE_EP," socket_accept\n");
-
-       /* Allocate accept CM and initialize */
-       if ((acm_ptr = dapli_cm_create()) == NULL) 
-               return DAT_INSUFFICIENT_RESOURCES;
-
-       acm_ptr->l_socket = -1;
-       acm_ptr->sp = cm_ptr->sp;
-       acm_ptr->hca = cm_ptr->hca;
-
-       len = sizeof(acm_ptr->dst.ia_address);
-       acm_ptr->socket = accept(cm_ptr->l_socket, 
-                               (struct sockaddr*)&acm_ptr->dst.ia_address, 
-                               &len );
-
-       if ( acm_ptr->socket < 0 ) {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                       " accept: ERR %d on FD %d l_cr %p\n",
-                       WSAGetLastError(),cm_ptr->l_socket,cm_ptr); 
-               dat_status = DAT_INTERNAL_ERROR;
-               goto bail;
-       }
-
-       dapl_dbg_log(DAPL_DBG_TYPE_EP," socket accepted, read QP data\n"); 
-
-       /* read in DST QP info, IA address. check for private data */
-       len = recv(acm_ptr->socket,(char*)&acm_ptr->dst,sizeof(ib_qp_cm_t),0);
-       if ( len != sizeof(ib_qp_cm_t) || ntohs(acm_ptr->dst.ver) != DSCM_VER )
-       {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                       " accept read: ERR %d, rcnt=%d ver=%d\n",
-                       WSAGetLastError(), len, acm_ptr->dst.ver); 
-               dat_status = DAT_INTERNAL_ERROR;
-               goto bail;
-
-       }
-       /* convert accepted values to host byte ordering */
-       acm_ptr->dst.port = cl_ntoh16(acm_ptr->dst.port);
-       acm_ptr->dst.lid = ntohs(acm_ptr->dst.lid);
-       acm_ptr->dst.qpn = acm_ptr->dst.qpn;
-       acm_ptr->dst.p_size = cl_ntoh32(acm_ptr->dst.p_size);
-
-       dapl_dbg_log(DAPL_DBG_TYPE_EP, " accept: DST %s port 0x%x "
-               "lid 0x%x qpn 0x%x psize %d\n",
-               dapli_get_ip_addr_str(&acm_ptr->dst.ia_address,NULL),
-               acm_ptr->dst.port,
-               cl_ntoh16(acm_ptr->dst.lid),
-               cl_ntoh32(acm_ptr->dst.qpn),
-               acm_ptr->dst.p_size);
-
-       /* validate private data size before reading */
-       if ( acm_ptr->dst.p_size > IB_MAX_REQ_PDATA_SIZE ) {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                       " accept read: psize (%d) wrong\n",
-                       acm_ptr->dst.p_size ); 
-               dat_status = DAT_INTERNAL_ERROR;
-               goto bail;
-       }
-
-       dapl_dbg_log(DAPL_DBG_TYPE_EP," socket accepted, read private data\n");
-
-       /* read private data into cm_handle if any present */
-       if ( acm_ptr->dst.p_size ) {
-               len = recv( acm_ptr->socket, 
-                           acm_ptr->p_data,
-                           acm_ptr->dst.p_size,
-                           0 );
-               if ( len != acm_ptr->dst.p_size ) {
-                       dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                               " accept read pdata: ERR %d, rcnt=%d\n",
-                               WSAGetLastError(), len ); 
-                       dat_status = DAT_INTERNAL_ERROR;
-                       goto bail;
-               }
-               dapl_dbg_log(DAPL_DBG_TYPE_EP, 
-                               " accept: psize=%d read\n",
-                               acm_ptr->dst.p_size); 
-               p_data = acm_ptr->p_data;
-       }
-       
-       acm_ptr->state = SCM_ACCEPTING;
-
-       /* trigger CR event and return SUCCESS */
-       dapls_cr_callback(  acm_ptr,
-                           IB_CME_CONNECTION_REQUEST_PENDING,
-                           p_data,
-                           acm_ptr->sp );
-
-       return DAT_SUCCESS;
-bail:
-       dapli_cm_destroy(acm_ptr);
-       return DAT_INTERNAL_ERROR;
-}
-
-
-/*
- * dapls_ib_connect
- *
- * Initiate a connection with the passive listener on another node
- *
- * Input:
- *     ep_handle,
- *     remote_ia_address,
- *     remote_conn_qual,
- *     prd_size                size of private data and structure
- *     prd_prt                 pointer to private data structure
- *
- * Output:
- *     none
- *
- * Returns:
- *     DAT_SUCCESS
- *     DAT_INSUFFICIENT_RESOURCES
- *     DAT_INVALID_PARAMETER
- *
- */
-DAT_RETURN
-dapls_ib_connect (
-       IN  DAT_EP_HANDLE               ep_handle,
-       IN  DAT_IA_ADDRESS_PTR          remote_ia_address,
-       IN  DAT_CONN_QUAL               remote_conn_qual,
-       IN  DAT_COUNT                   private_data_size,
-       IN  void                        *private_data )
-{
-       DAPL_EP         *ep_ptr;
-       ib_qp_handle_t  qp_ptr;
-       
-       dapl_dbg_log ( DAPL_DBG_TYPE_EP,
-                       " connect(ep_handle %p ....)\n", ep_handle);
-       /*
-        *  Sanity check
-        */
-       if ( NULL == ep_handle ) 
-               return DAT_SUCCESS;
-
-       ep_ptr = (DAPL_EP*)ep_handle;
-       qp_ptr = ep_ptr->qp_handle;
-
-       return (dapli_socket_connect(   ep_ptr, remote_ia_address, 
-                                       remote_conn_qual,
-                                       private_data_size, private_data ));
-}
-
-/*
- * dapls_ib_disconnect
- *
- * Disconnect an EP
- *
- * Input:
- *     ep_handle,
- *     disconnect_flags
- *
- * Output:
- *     none
- *
- * Returns:
- *     DAT_SUCCESS
- *
- */
-DAT_RETURN
-dapls_ib_disconnect (
-       IN      DAPL_EP                 *ep_ptr,
-       IN      DAT_CLOSE_FLAGS         close_flags )
-{
-       dp_ib_cm_handle_t cm_ptr = ep_ptr->cm_handle;
-       ib_api_status_t   ib_status;
-
-       dapl_dbg_log (DAPL_DBG_TYPE_EP,
-                       "dapls_ib_disconnect(ep_handle %p ....)\n", ep_ptr);
-
-#if 0 // XXX
-       /* disconnect QP ala transition to RESET state */
-       ib_status = dapls_modify_qp_state_to_reset (ep_ptr->qp_handle);
-
-       if ( ib_status != IB_SUCCESS )
-       {
-               dapl_dbg_log (DAPL_DBG_TYPE_ERR,
-                       "--> %s() failed to move qp to RESET status = %s\n", 
-                       __FUNCTION__, ib_get_err_str(ib_status));
-               return DAT_INTERNAL_ERROR;
-       }
-       ep_ptr->qp_state = IB_QPS_RESET;
-
-       /* inform DAPL of disconnect */
-       if ( ep_ptr->cr_ptr ) {
-               dapls_cr_callback ( ep_ptr->cm_handle,
-                                   IB_CME_DISCONNECTED,
-                                   NULL,
-                                   ((DAPL_CR *)ep_ptr->cr_ptr)->sp_ptr );
-       } else {
-               dapl_evd_connection_callback ( ep_ptr->cm_handle,
-                                               IB_CME_DISCONNECTED,
-                                               NULL,
-                                               ep_ptr );
-               ep_ptr->cm_handle = NULL;
-       }       
-#endif
-       /* modify QP state --> INIT */
-       dapls_ib_reinit_ep(ep_ptr);
-
-       if (cm_ptr == NULL)
-       return DAT_SUCCESS;
-       else
-               return dapli_socket_disconnect(cm_ptr);
-}
-
-
-/*
- * dapls_ib_disconnect_clean
- *
- * Clean up outstanding connection data. This routine is invoked
- * after the final disconnect callback has occurred. Only on the
- * ACTIVE side of a connection.
- *
- * Input:
- *     ep_ptr          DAPL_EP
- *     active          Indicates active side of connection
- *
- * Output:
- *     none
- *
- * Returns:
- *     void
- *
- */
-void
-dapls_ib_disconnect_clean (
-       IN  DAPL_EP                     *ep_ptr,
-       IN  DAT_BOOLEAN                 active,
-       IN  const ib_cm_events_t        ib_cm_event )
-{
-    return;
-}
-
-/*
- * dapl_ib_setup_conn_listener
- *
- * Have the CM set up a connection listener.
- *
- * Input:
- *     ibm_hca_handle          HCA handle
- *     qp_handle                       QP handle
- *
- * Output:
- *     none
- *
- * Returns:
- *     DAT_SUCCESS
- *     DAT_INSUFFICIENT_RESOURCES
- *     DAT_INTERNAL_ERROR
- *     DAT_CONN_QUAL_UNAVAILBLE
- *     DAT_CONN_QUAL_IN_USE
- *
- */
-DAT_RETURN
-dapls_ib_setup_conn_listener (
-       IN  DAPL_IA             *ia_ptr,
-       IN  DAT_UINT64          ServiceID,
-       IN  DAPL_SP             *sp_ptr )
-{
-       return (dapli_socket_listen( ia_ptr, ServiceID, sp_ptr ));
-}
-
-
-/*
- * dapl_ib_remove_conn_listener
- *
- * Have the CM remove a connection listener.
- *
- * Input:
- *     ia_handle               IA handle
- *     ServiceID               IB Channel Service ID
- *
- * Output:
- *     none
- *
- * Returns:
- *     DAT_SUCCESS
- *     DAT_INVALID_STATE
- *
- */
-DAT_RETURN
-dapls_ib_remove_conn_listener (
-       IN  DAPL_IA             *ia_ptr,
-       IN  DAPL_SP             *sp_ptr )
-{
-       ib_cm_srvc_handle_t     cm_ptr = sp_ptr->cm_srvc_handle;
-
-       dapl_dbg_log (DAPL_DBG_TYPE_EP,
-                       "dapls_ib_remove_conn_listener(ia_ptr %p sp_ptr %p cm_ptr %p)\n",
-                       ia_ptr, sp_ptr, cm_ptr );
-
-       /* close accepted socket, free cm_srvc_handle and return */
-       if ( cm_ptr != NULL ) {
-               if ( cm_ptr->l_socket >= 0 ) {
-                       closesocket( cm_ptr->l_socket );
-                       cm_ptr->l_socket = -1;
-               }
-               if ( cm_ptr->socket >= 0 ) {
-                       closesocket( cm_ptr->socket );
-                       cm_ptr->socket = -1;
-               }
-               /* cr_thread will free */
-               sp_ptr->cm_srvc_handle = NULL;
-               _write(g_scm_pipe[1], "w", sizeof "w");
-       }
-       return DAT_SUCCESS;
-}
-
-
-/*
- * dapls_ib_accept_connection
- *
- * Perform necessary steps to accept a connection
- *
- * Input:
- *     cr_handle
- *     ep_handle
- *     private_data_size
- *     private_data
- *
- * Output:
- *     none
- *
- * Returns:
- *     DAT_SUCCESS
- *     DAT_INSUFFICIENT_RESOURCES
- *     DAT_INTERNAL_ERROR
- *
- */
-DAT_RETURN
-dapls_ib_accept_connection (
-       IN  DAT_CR_HANDLE       cr_handle,
-       IN  DAT_EP_HANDLE       ep_handle,
-       IN  DAT_COUNT           p_size,
-       IN  const DAT_PVOID     p_data )
-{
-       DAPL_CR                 *cr_ptr;
-       DAPL_EP                 *ep_ptr;
-       
-       dapl_dbg_log (DAPL_DBG_TYPE_EP,
-                     "dapls_ib_accept_connection(cr %llx ep %llx p_sz %d)\n",
-                     cr_handle, ep_handle, p_size);
-
-       cr_ptr  = (DAPL_CR *) cr_handle;
-       ep_ptr  = (DAPL_EP *) ep_handle;
-       
-       /* allocate and attach a QP if necessary */
-       if ( ep_ptr->qp_state == DAPL_QP_STATE_UNATTACHED ) {
-               DAT_RETURN status;
-               status = dapls_ib_qp_alloc( ep_ptr->header.owner_ia, 
-                                           ep_ptr, ep_ptr );
-               if ( status != DAT_SUCCESS )
-                       return status;
-       }
-    
-       return ( dapli_socket_accept_usr(ep_ptr, cr_ptr, p_size, p_data) );
-}
-
-
-/*
- * dapls_ib_reject_connection
- *
- * Reject a connection
- *
- * Input:
- *     cr_handle
- *
- * Output:
- *     none
- *
- * Returns:
- *     DAT_SUCCESS
- *     DAT_INTERNAL_ERROR
- *
- */
-
-DAT_RETURN
-dapls_ib_reject_connection (
-       IN  dp_ib_cm_handle_t   cm_ptr,
-       IN  int                 reject_reason,
-       IN  DAT_COUNT           psize,
-       IN  const DAT_PVOID     pdata)
-{
-       WSABUF  iovec[1];
-       int     len;
-
-       dapl_dbg_log (DAPL_DBG_TYPE_EP,
-                     " reject(cm %p reason %x pdata %p psize %d)\n",
-                     cm_ptr, reject_reason, pdata, psize );
-
-       /* write reject data to indicate reject */
-       if (cm_ptr->socket >= 0) {
-               cm_ptr->dst.rej = (uint16_t)reject_reason;
-               cm_ptr->dst.rej = cl_hton16(cm_ptr->dst.rej);
-               iovec[0].buf = (char*)&cm_ptr->dst;
-               iovec[0].len  = sizeof(ib_qp_cm_t);
-               (void) WSASend (cm_ptr->socket, iovec, 1, &len, 0, 0, NULL);
-               closesocket(cm_ptr->socket);
-               cm_ptr->socket = -1;
-       }
-
-       /* cr_thread will destroy CR */
-       cm_ptr->state = SCM_REJECTED;
-        _write(g_scm_pipe[1], "w", sizeof "w");
-       return DAT_SUCCESS;
-}
-
-
-/*
- * dapls_ib_cm_remote_addr
- *
- * Obtain the remote IP address given a connection
- *
- * Input:
- *     cr_handle
- *
- * Output:
- *     remote_ia_address: where to place the remote address
- *
- * Returns:
- *     DAT_SUCCESS
- *     DAT_INVALID_HANDLE
- *
- */
-DAT_RETURN
-dapls_ib_cm_remote_addr (
-       IN      DAT_HANDLE      dat_handle,
-       OUT     DAT_SOCK_ADDR6  *remote_ia_address )
-{
-       DAPL_HEADER             *header;
-       dp_ib_cm_handle_t       ib_cm_handle;
-
-       dapl_dbg_log (DAPL_DBG_TYPE_EP,
-                     "dapls_ib_cm_remote_addr(dat_handle %p, ....)\n",
-                     dat_handle );
-
-       header = (DAPL_HEADER *)dat_handle;
-
-       if (header->magic == DAPL_MAGIC_EP) 
-               ib_cm_handle = ((DAPL_EP *) dat_handle)->cm_handle;
-       else if (header->magic == DAPL_MAGIC_CR) 
-               ib_cm_handle = ((DAPL_CR *) dat_handle)->ib_cm_handle;
-       else 
-               return DAT_INVALID_HANDLE;
-
-       dapl_os_memcpy( remote_ia_address, 
-                       &ib_cm_handle->dst.ia_address, 
-                       sizeof(DAT_SOCK_ADDR6) );
-
-       return DAT_SUCCESS;
-}
-
-/*
- * dapls_ib_private_data_size
- *
- * Return the size of private data given a connection op type
- *
- * Input:
- *     prd_ptr         private data pointer
- *     conn_op         connection operation type
- *      hca_ptr         hca pointer, needed for transport type
- *
- * If prd_ptr is NULL, this is a query for the max size supported by
- * the provider, otherwise it is the actual size of the private data
- * contained in prd_ptr.
- *
- *
- * Output:
- *     None
- *
- * Returns:
- *     length of private data
- *
- */
-int dapls_ib_private_data_size (
-       IN      DAPL_PRIVATE    *prd_ptr,
-       IN      DAPL_PDATA_OP   conn_op,
-       IN      DAPL_HCA        *hca_ptr)
-{
-       int  size;
-
-       switch (conn_op)
-       {
-               case DAPL_PDATA_CONN_REQ:
-               {
-                       size = IB_MAX_REQ_PDATA_SIZE;
-                       break;
-               }
-               case DAPL_PDATA_CONN_REP:
-               {
-                       size = IB_MAX_REP_PDATA_SIZE;
-                       break;
-               }
-               case DAPL_PDATA_CONN_REJ:
-               {
-                       size = IB_MAX_REJ_PDATA_SIZE;
-                       break;
-               }
-               case DAPL_PDATA_CONN_DREQ:
-               {
-                       size = IB_MAX_DREQ_PDATA_SIZE;
-                       break;
-               }
-               case DAPL_PDATA_CONN_DREP:
-               {
-                       size = IB_MAX_DREP_PDATA_SIZE;
-                       break;
-               }
-               default:
-               {
-                       size = 0;
-               }
-
-       } /* end case */
-
-       return size;
-}
-
-/*
- * Map all socket CM event codes to the DAT equivelent.
- */
-#define DAPL_IB_EVENT_CNT      11
-
-static struct ib_cm_event_map
-{
-       const ib_cm_events_t    ib_cm_event;
-       DAT_EVENT_NUMBER        dat_event_num;
-       } ib_cm_event_map[DAPL_IB_EVENT_CNT] = {
-       /* 00 */  { IB_CME_CONNECTED,   
-                                       DAT_CONNECTION_EVENT_ESTABLISHED}, 
-       /* 01 */  { IB_CME_DISCONNECTED,        
-                                       DAT_CONNECTION_EVENT_DISCONNECTED},
-       /* 02 */  { IB_CME_DISCONNECTED_ON_LINK_DOWN, 
-                                       DAT_CONNECTION_EVENT_DISCONNECTED},
-       /* 03 */  { IB_CME_CONNECTION_REQUEST_PENDING,  
-                                       DAT_CONNECTION_REQUEST_EVENT},
-       /* 04 */  { IB_CME_CONNECTION_REQUEST_PENDING_PRIVATE_DATA,
-                                       DAT_CONNECTION_REQUEST_EVENT},
-       /* 05 */  { IB_CME_DESTINATION_REJECT,
-                                       DAT_CONNECTION_EVENT_NON_PEER_REJECTED},
-       /* 06 */  { IB_CME_DESTINATION_REJECT_PRIVATE_DATA,             
-                                       DAT_CONNECTION_EVENT_PEER_REJECTED},
-       /* 07 */  { IB_CME_DESTINATION_UNREACHABLE,     
-                                       DAT_CONNECTION_EVENT_UNREACHABLE},
-       /* 08 */  { IB_CME_TOO_MANY_CONNECTION_REQUESTS,
-                                       DAT_CONNECTION_EVENT_NON_PEER_REJECTED},
-       /* 09 */  { IB_CME_LOCAL_FAILURE,
-                                       DAT_CONNECTION_EVENT_BROKEN},
-       /* 10 */  { IB_CM_LOCAL_FAILURE,
-                                       DAT_CONNECTION_EVENT_BROKEN}
-};
-#ifdef NOT_USED
-/*
- * dapls_ib_get_cm_event
- *
- * Return a DAT connection event given a provider CM event.
- *
- * Input:
- *     dat_event_num   DAT event we need an equivelent CM event for
- *
- * Output:
- *     none
- *
- * Returns:
- *     ib_cm_event of translated DAPL value
- */
-DAT_EVENT_NUMBER
-dapls_ib_get_dat_event (
-       IN    const ib_cm_events_t      ib_cm_event,
-       IN    DAT_BOOLEAN               active)
-{
-       DAT_EVENT_NUMBER        dat_event_num;
-       int                     i;
-       
-       active = active;
-
-       if (ib_cm_event > IB_CM_LOCAL_FAILURE)
-               return (DAT_EVENT_NUMBER) 0;
-
-       dat_event_num = 0;
-       for (i = 0; i < DAPL_IB_EVENT_CNT; i++) {
-               if (ib_cm_event == ib_cm_event_map[i].ib_cm_event) {
-                       dat_event_num = ib_cm_event_map[i].dat_event_num;
-                       break;
-               }
-       }
-       dapl_dbg_log (DAPL_DBG_TYPE_CALLBACK,
-               "dapls_ib_get_dat_event: event translate(%s) ib=0x%x dat=0x%x\n",
-               active ? "active" : "passive",  ib_cm_event, dat_event_num);
-
-       return dat_event_num;
-}
-
-
-/*
- * dapls_ib_get_cm_event
- *
- * Return a DAT connection event given a provider CM event.
- * 
- * Input:
- *     ib_cm_event     event provided to the dapl callback routine
- *     active          switch indicating active or passive connection
- *
- * Output:
- *     none
- *
- * Returns:
- *     DAT_EVENT_NUMBER of translated provider value
- */
-ib_cm_events_t
-dapls_ib_get_cm_event (
-       IN    DAT_EVENT_NUMBER          dat_event_num)
-{
-    ib_cm_events_t     ib_cm_event;
-    int                        i;
-
-    ib_cm_event = 0;
-    for (i = 0; i < DAPL_IB_EVENT_CNT; i++) {
-       if ( dat_event_num == ib_cm_event_map[i].dat_event_num ) {
-               ib_cm_event = ib_cm_event_map[i].ib_cm_event;
-               break;
-       }
-    }
-    return ib_cm_event;
-}
-#endif /* NOT_USED */
-
-/* outbound/inbound CR processing thread to avoid blocking applications */
-
-#define SCM_MAX_CONN (8 * sizeof(fd_set))
-
-void cr_thread(void *arg) 
-{
-    struct dapl_hca    *hca_ptr = arg;
-    ib_cm_srvc_handle_t        cr, next_cr;
-    int                        max_fd, rc;
-    char               rbuf[2];
-    fd_set             rfd, rfds;
-    struct timeval     to;
-     
-    dapl_dbg_log(DAPL_DBG_TYPE_UTIL," cr_thread: ENTER hca %p\n",hca_ptr);
-
-    dapl_os_lock( &hca_ptr->ib_trans.lock );
-    hca_ptr->ib_trans.cr_state = IB_THREAD_RUN;
-
-    while (hca_ptr->ib_trans.cr_state == IB_THREAD_RUN) {
-       
-       FD_ZERO( &rfds ); 
-       FD_SET(g_scm_pipe[0], &rfds);
-       max_fd = g_scm_pipe[0];
-       
-       if (!dapl_llist_is_empty((DAPL_LLIST_HEAD*)&hca_ptr->ib_trans.list))
-            next_cr = dapl_llist_peek_head((DAPL_LLIST_HEAD*)
-                                               &hca_ptr->ib_trans.list);
-       else
-           next_cr = NULL;
-
-       while (next_cr) {
-           cr = next_cr;
-               next_cr = dapl_llist_next_entry((DAPL_LLIST_HEAD*)
-                                               &hca_ptr->ib_trans.list,
-                                               (DAPL_LLIST_ENTRY*)&cr->entry);
-           //dapl_dbg_log (DAPL_DBG_TYPE_CM," CR_thread: cm_ptr %p\n", cr );
-           if (cr->l_socket == -1 || 
-               hca_ptr->ib_trans.cr_state != IB_THREAD_RUN) {
-
-               dapl_dbg_log(DAPL_DBG_TYPE_CM," thread: Freeing %p\n", cr);
-               dapl_llist_remove_entry((DAPL_LLIST_HEAD*)
-                                               &hca_ptr->ib_trans.list, 
-                                       (DAPL_LLIST_ENTRY*)&cr->entry);
-               dapl_os_free( cr, sizeof(*cr) );
-               continue;
-           }
-                 
-           if (cr->socket == -1) {
-               continue;
-           }
-           if (cr->socket > SCM_MAX_CONN-1) {
-               dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
-                            "SCM ERR: cr->socket(%d) exceeded FD_SETSIZE %d\n",
-                               cr->socket,SCM_MAX_CONN-1);
-               continue;
-           }
-           FD_SET( cr->socket, &rfds ); /* add to select SET */
-           if ( cr->socket > max_fd )
-               max_fd = cr->l_socket;
-
-           /* individual select poll to check for work */
-           FD_ZERO(&rfd);
-           FD_SET(cr->socket, &rfd);
-           dapl_os_unlock(&hca_ptr->ib_trans.lock);    
-
-           to.tv_sec  = 0;
-           to.tv_usec = 0; /* wakeup and check destroy */
-
-           /* block waiting for Rx data */
-           if (select(cr->socket+1,&rfd,NULL,NULL,&to) == SOCKET_ERROR) {
-               rc = WSAGetLastError();
-               if ( rc != SOCKET_ERROR /*WSAENOTSOCK*/ )
-               {
-                   dapl_dbg_log (DAPL_DBG_TYPE_ERR/*CM*/,
-                               " thread: select(sock %d) ERR %d on cr %p\n",
-                               cr->socket, rc, cr);
-               }
-               closesocket(cr->socket);
-               cr->socket = -1;
-           } else if (FD_ISSET(cr->socket,&rfd)) {
-               if (cr->socket > 0) {
-                       if (cr->state == SCM_LISTEN) 
-                               dapli_socket_accept(cr);
-                       else if (cr->state == SCM_ACCEPTED)
-                               dapli_socket_accept_rtu(cr);
-                       else if (cr->state == SCM_CONN_PENDING)
-                               dapli_socket_connect_rtu(cr);
-                       else if (cr->state == SCM_CONNECTED)
-                               dapli_socket_disconnect(cr);
-               }
-           }
-           dapl_os_lock( &hca_ptr->ib_trans.lock );
-       }
-       dapl_os_unlock( &hca_ptr->ib_trans.lock );
-
-       to.tv_sec  = 0;
-       to.tv_usec = 100000; /* wakeup and check destroy */
-
-       (void) select(max_fd+1, &rfds, NULL, NULL, &to);
-
-       /* if pipe data consume - used to wake this thread up */
-       if (FD_ISSET(g_scm_pipe[0],&rfds)) {
-               dapl_dbg_log(DAPL_DBG_TYPE_CM," cr_thread() read pipe data\n");
-printf(" cr_thread() read pipe data\n");
-               _read(g_scm_pipe[0], rbuf, 2);
-printf(" cr_thread() Finished read pipe data\n");
-       }
-       dapl_os_lock( &hca_ptr->ib_trans.lock );
-    }
-    dapl_os_unlock( &hca_ptr->ib_trans.lock ); 
-    hca_ptr->ib_trans.cr_state = IB_THREAD_EXIT;
-    dapl_dbg_log(DAPL_DBG_TYPE_UTIL," cr_thread(hca %p) exit\n",hca_ptr);
-}
-
-/*
- * Local variables:
- *  c-indent-level: 4
- *  c-basic-offset: 4
- *  tab-width: 8
- * End:
- */
diff --git a/ulp/dapl2/dapl/ibal-scm/dapl_ibal-scm_util.c b/ulp/dapl2/dapl/ibal-scm/dapl_ibal-scm_util.c
deleted file mode 100644 (file)
index 06bc704..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * This Software is licensed under one of the following licenses:
- *
- * 1) under the terms of the "Common Public License 1.0" a copy of which is
- *    available from the Open Source Initiative, see
- *    http://www.opensource.org/licenses/cpl.php.
- *
- * 2) under the terms of the "The BSD License" a copy of which is
- *    available from the Open Source Initiative, see
- *    http://www.opensource.org/licenses/bsd-license.php.
- *
- * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
- *    copy of which is available from the Open Source Initiative, see
- *    http://www.opensource.org/licenses/gpl-license.php.
- *
- * Licensee has the right to choose one of the above licenses.
- *
- * Redistributions of source code must retain the above copyright
- * notice and one of the license notices.
- *
- * Redistributions in binary form must reproduce both the above copyright
- * notice, one of the license notices in the documentation
- * and/or other materials provided with the distribution.
- */
-
-/***************************************************************************
- *
- *   Module:            uDAPL
- *
- *   Filename:          dapl_ib_util.c
- *
- *   Author:            Arlin Davis
- *
- *   Created:           3/10/2005
- *
- *   Description: 
- *
- *   The uDAPL openib provider - init, open, close, utilities
- *
- ****************************************************************************
- *                Source Control System Information
- *
- *    $Id: $
- *
- *     Copyright (c) 2005 Intel Corporation.  All rights reserved.
- *
- **************************************************************************/
-#ifdef RCSID
-static const char rcsid[] = "$Id:  $";
-#endif
-
-#include "dapl.h"
-#include "dapl_adapter_util.h"
-#include "dapl_ibal_util.h"
-#include "dapl_ibal_name_service.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <windows.h>
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <io.h>
-#include <fcntl.h>
-
-extern void cr_thread(void *arg);
-
-int g_dapl_loopback_connection = 0;
-int g_scm_pipe[2];
-
-#ifdef NOT_USED
-
-/* just get IP address for hostname */
-static DAT_RETURN getipaddr( char *addr, int addr_len)
-{
-       struct sockaddr_in      *ipv4_addr = (struct sockaddr_in*)addr;
-       struct hostent          *h_ptr;
-       struct utsname          ourname;
-
-       if ( uname( &ourname ) < 0 ) 
-               return DAT_INTERNAL_ERROR;
-
-       h_ptr = gethostbyname( ourname.nodename );
-       if ( h_ptr == NULL ) 
-               return DAT_INTERNAL_ERROR;
-
-       if ( h_ptr->h_addrtype == AF_INET ) {
-               int i;
-               struct in_addr  **alist =
-                       (struct in_addr **)h_ptr->h_addr_list;
-
-               *(uint32_t*)&ipv4_addr->sin_addr = 0;
-               ipv4_addr->sin_family = AF_INET;
-               
-               /* Walk the list of addresses for host */
-               for (i=0; alist[i] != NULL; i++) {
-                      
-                       /* first non-loopback address */                        
-                      if ( *(uint32_t*)alist[i] != htonl(0x7f000001) ) {
-                               dapl_os_memcpy( &ipv4_addr->sin_addr,
-                                               h_ptr->h_addr_list[i],
-                                               4 );
-                               break;
-                       }
-               }
-               /* if no acceptable address found */
-               if (*(uint32_t*)&ipv4_addr->sin_addr == 0)
-                       return DAT_INVALID_ADDRESS;
-       } else 
-               return DAT_INVALID_ADDRESS;
-
-       return DAT_SUCCESS;
-}
-#endif
-
-/*
- * dapli_init_sock_cm
- *
- * Input:
- *      *hca_p  pointer to provide HCA handle
- *
- * Output:
- *      none
- *
- * Return:
- *      DAT_SUCCESS
- *      dapl_convert_errno
- *
- */
-DAT_RETURN dapli_init_sock_cm ( IN DAPL_HCA  *hca_ptr )
-{
-       int             opts;
-       int             i;
-       DAT_RETURN      dat_status = DAT_SUCCESS;
-
-       dapl_dbg_log (DAPL_DBG_TYPE_UTIL, " %s(): %p\n",__FUNCTION__,hca_ptr );
-
-       /* set RC tunables via enviroment or default */
-       hca_ptr->ib_trans.max_inline_send = 
-               dapl_os_get_env_val("DAPL_MAX_INLINE", INLINE_SEND_DEFAULT);
-#if 0
-       hca_ptr->ib_trans.ack_retry = 
-               dapl_os_get_env_val("DAPL_ACK_RETRY", SCM_ACK_RETRY);
-       hca_ptr->ib_trans.ack_timer =
-               dapl_os_get_env_val("DAPL_ACK_TIMER", SCM_ACK_TIMER);
-       hca_ptr->ib_trans.rnr_retry = 
-               dapl_os_get_env_val("DAPL_RNR_RETRY", SCM_RNR_RETRY);
-       hca_ptr->ib_trans.rnr_timer = 
-               dapl_os_get_env_val("DAPL_RNR_TIMER", SCM_RNR_TIMER);
-       hca_ptr->ib_trans.global =
-               dapl_os_get_env_val("DAPL_GLOBAL_ROUTING", SCM_GLOBAL);
-       hca_ptr->ib_trans.hop_limit =
-               dapl_os_get_env_val("DAPL_HOP_LIMIT", SCM_HOP_LIMIT);
-       hca_ptr->ib_trans.tclass =
-               dapl_os_get_env_val("DAPL_TCLASS", SCM_TCLASS);
-#endif
-
-       /* initialize cr_list lock */
-       dat_status = dapl_os_lock_init(&hca_ptr->ib_trans.lock);
-       if (dat_status != DAT_SUCCESS)
-       {
-               dapl_dbg_log (DAPL_DBG_TYPE_ERR, 
-                       "%s() failed to init cr_list lock\n", __FUNCTION__);
-               return DAT_INTERNAL_ERROR;
-       }
-
-#if 0
-       /* initialize cq_lock */
-       dat_status = dapl_os_lock_init(&hca_ptr->ib_trans.cq_lock);
-       if (dat_status != DAT_SUCCESS) {
-               dapl_log(DAPL_DBG_TYPE_ERR, 
-                        "%s() failed to init cq_lock\n", __FUNCTION__);
-               return DAT_INTERNAL_ERROR;
-       }
-#endif
-
-       /* initialize CM list for listens on this HCA */
-       dapl_llist_init_head((DAPL_LLIST_HEAD*)&hca_ptr->ib_trans.list);
-
-       /* create pipe communication endpoints */
-       if (_pipe(g_scm_pipe, 256, O_TEXT)) {
-               dapl_dbg_log (DAPL_DBG_TYPE_ERR, 
-                       "%s() failed to create thread\n", __FUNCTION__);
-               return DAT_INTERNAL_ERROR;
-       }
-
-       /* create thread to process inbound connect request */
-       hca_ptr->ib_trans.cr_state = IB_THREAD_INIT;
-       dat_status = dapl_os_thread_create(cr_thread, 
-                                          (void*)hca_ptr, 
-                                          &hca_ptr->ib_trans.thread );
-       if (dat_status != DAT_SUCCESS)
-       {
-               dapl_dbg_log (DAPL_DBG_TYPE_ERR, 
-                               " open_hca: failed to create thread\n");
-               return DAT_INTERNAL_ERROR;
-       }
-       
-       /* wait for thread */
-       while (hca_ptr->ib_trans.cr_state != IB_THREAD_RUN) {
-               dapl_dbg_log(DAPL_DBG_TYPE_UTIL, 
-                            " open_hca: waiting for cr_thread\n");
-               Sleep (250); /* 1/4 sec */
-       }
-
-       dapl_dbg_log (DAPL_DBG_TYPE_UTIL, 
-               "IB hca: port %d, %s  %d.%d.%d.%d\n", 
-               hca_ptr->port_num,
-               ((struct sockaddr_in *)&hca_ptr->hca_address)->sin_family == AF_INET ?  "AF_INET":"AF_INET6",
-               dapli_get_ip_addr_str(&hca_ptr->hca_address,NULL) );
-
-       return dat_status;
-}
-
-
-/*
- * dapli_close_sock_cm
- *
- * Open HCA
- *
- * Input:
- *      DAPL_HCA   provide CA handle
- *
- * Output:
- *      none
- *
- * Return:
- *      DAT_SUCCESS
- *     dapl_convert_errno 
- *
- */
-DAT_RETURN dapli_close_sock_cm ( IN DAPL_HCA  *hca_ptr )
-{
-       dapl_dbg_log (DAPL_DBG_TYPE_UTIL," %s(): %p\n", __FUNCTION__, hca_ptr);
-
-       /* destroy cr_thread and lock */
-       hca_ptr->ib_trans.cr_state = IB_THREAD_CANCEL;
-
-       while (hca_ptr->ib_trans.cr_state != IB_THREAD_EXIT) {
-               dapl_dbg_log(DAPL_DBG_TYPE_UTIL, 
-                            " close_hca: waiting for cr_thread\n");
-               Sleep (500); /* 1/2 seconds */
-       }
-       dapl_os_lock_destroy(&hca_ptr->ib_trans.lock);
-
-       return (DAT_SUCCESS);
-}
-  
diff --git a/ulp/dapl2/dapl/ibal-scm/makefile b/ulp/dapl2/dapl/ibal-scm/makefile
deleted file mode 100644 (file)
index e26e1c0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source
-# file to this component.  This file merely indirects to the real make file
-# that is shared by all the driver components of the OpenIB Windows project.
-#
-
-!INCLUDE ..\..\..\..\inc\openib.def
diff --git a/ulp/dapl2/dapl/ibal-scm/udapl.rc b/ulp/dapl2/dapl/ibal-scm/udapl.rc
deleted file mode 100644 (file)
index 622169a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007 Intel Corporation.  All rights reserved.
- *
- * This software is available to you under the OpenIB.org BSD license
- * below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * $Id$
- */
-
-
-#include <oib_ver.h>
-
-#define VER_FILETYPE                   VFT_DLL
-#define VER_FILESUBTYPE                        VFT2_UNKNOWN
-
-#if DBG
-#define VER_FILEDESCRIPTION_STR                "Direct Access Provider Library v2.0 (socket-cm) (Debug)"
-#define VER_INTERNALNAME_STR           "dapl2-scmd.dll"
-#define VER_ORIGINALFILENAME_STR       "dapl2-scmd.dll"
-#else
-#define VER_FILEDESCRIPTION_STR                "Direct Access Provider Library v2.0 (socket-cm)"
-#define VER_INTERNALNAME_STR           "dapl2-scm.dll"
-#define VER_ORIGINALFILENAME_STR       "dapl2-scm.dll"
-#endif
-
-#include <common.ver>
diff --git a/ulp/dapl2/dapl/ibal-scm/udapl_scm_exports.src b/ulp/dapl2/dapl/ibal-scm/udapl_scm_exports.src
deleted file mode 100644 (file)
index 6702c89..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#if DBG
-LIBRARY dapl2-scmd.dll
-#else
-LIBRARY dapl2-scm.dll
-#endif
-
-
-EXPORTS
-dat_provider_init
-dat_provider_fini
-#ifdef DAT_EXTENSIONS
-dapl_extensions
-#endif
-
diff --git a/ulp/dapl2/dapl/ibal-scm/udapl_sources.c b/ulp/dapl2/dapl/ibal-scm/udapl_sources.c
deleted file mode 100644 (file)
index 05a7808..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "..\ibal\dapl_ibal_qp.c"
-#include "..\ibal\dapl_ibal_cq.c"
-#include "..\ibal\dapl_ibal_util.c"
-#include "..\ibal\dapl_ibal_name_service.c"
-#include "..\ibal\dapl_ibal_extensions.c"