dapl: update to git commit e8991b8f0877b0e2e857717e1140c679e9266abe
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 4 Jun 2009 18:49:12 +0000 (18:49 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 4 Jun 2009 18:49:12 +0000 (18:49 +0000)
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2233 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/dapl2/dapl/openib_cma/SOURCES
ulp/dapl2/dapl/openib_cma/dapl_ib_util.c

index e59ef35..fd67d07 100644 (file)
@@ -45,10 +45,12 @@ TARGETLIBS= \
        $(SDK_LIB_PATH)\ws2_32.lib \\r
 !if $(FREEBUILD)\r
        $(TARGETPATH)\*\dat2.lib \\r
+       $(TARGETPATH)\*\winverbs.lib \\r
        $(TARGETPATH)\*\libibverbs.lib \\r
        $(TARGETPATH)\*\librdmacm.lib\r
 !else\r
        $(TARGETPATH)\*\dat2d.lib \\r
+       $(TARGETPATH)\*\winverbsd.lib \\r
        $(TARGETPATH)\*\libibverbsd.lib \\r
        $(TARGETPATH)\*\librdmacmd.lib\r
 !endif\r
index 3b83ab8..bf23d43 100644 (file)
@@ -57,10 +57,50 @@ struct dapl_llist_entry *g_hca_list;
 #if defined(_WIN64) || defined(_WIN32)
 #include "..\..\..\..\..\etc\user\comp_channel.cpp"
 #include "..\..\..\..\..\etc\user\dlist.c"
+#include <rdma\winverbs.h>
 
-#define getipaddr_netdev(x,y,z) -1
 struct ibvw_windata windata;
 
+static int getipaddr_netdev(char *name, char *addr, int addr_len)
+{
+       IWVProvider *prov;
+       WV_DEVICE_ADDRESS devaddr;
+       struct addrinfo *res, *ai;
+       HRESULT hr;
+       int index;
+
+       if (strncmp(name, "rdma_dev", 8)) {
+               return EINVAL;
+       }
+
+       index = atoi(name + 8);
+
+       hr = WvGetObject(&IID_IWVProvider, (LPVOID *) &prov);
+       if (FAILED(hr)) {
+               return hr;
+       }
+
+       hr = getaddrinfo("..localmachine", NULL, NULL, &res);
+       if (hr) {
+               goto release;
+       }
+
+       for (ai = res; ai; ai = ai->ai_next) {
+               hr = prov->lpVtbl->TranslateAddress(prov, ai->ai_addr, &devaddr);
+               if (SUCCEEDED(hr) && (ai->ai_addrlen <= addr_len) && (index-- == 0)) {
+                       memcpy(addr, ai->ai_addr, ai->ai_addrlen);
+                       goto free;
+               }
+       }
+       hr = ENODEV;
+
+free:
+       freeaddrinfo(res);
+release:
+       prov->lpVtbl->Release(prov);
+       return hr;
+}
+
 static int dapls_os_init(void)
 {
        return ibvw_get_windata(&windata, IBVW_WINDATA_VERSION);