Whamcloud - gitweb
b_2074
[fs/lustre-release.git] / lnet / utils / portals.c
index b46ee16..fb031ae 100644 (file)
 #include <stdarg.h>
 #include <asm/byteorder.h>
 
+#ifdef __CYGWIN__
+
+#include <netinet/in.h>
+
+#warning assuming little endian
+
+#define __cpu_to_le64(x) ((__u64)(x))
+#define __le64_to_cpu(x) ((__u64)(x))
+#define __cpu_to_le32(x) ((__u32)(x))
+#define __le32_to_cpu(x) ((__u32)(x))
+#define __cpu_to_le16(x) ((__u16)(x))
+#define __le16_to_cpu(x) ((__u16)(x))
+
+#endif /* __CYGWIN__ */
 #include <portals/api-support.h>
 #include <portals/ptlctl.h>
 #include <portals/list.h>
@@ -63,7 +78,6 @@ typedef struct
 static name2num_t nalnames[] = {
         {"any",         0},
         {"tcp",                SOCKNAL},
-        {"toe",                TOENAL},
         {"elan",       QSWNAL},
         {"gm",         GMNAL},
         {"ib",         IBNAL},
@@ -95,6 +109,9 @@ pcfg_ioctl(struct portals_cfg *pcfg)
                 PORTAL_IOC_INIT (data);
                 data.ioc_pbuf1   = (char*)pcfg;
                 data.ioc_plen1   = sizeof(*pcfg);
+                /* XXX liblustre hack XXX */
+                data.ioc_nal_cmd = pcfg->pcfg_command;
+                data.ioc_nid = pcfg->pcfg_nid;
 
                 rc = l_ioctl (PORTALS_DEV_ID, IOC_PORTAL_NAL_CMD, &data);
         }
@@ -651,7 +668,7 @@ int jt_ptl_connect(int argc, char **argv)
                 return 0;
         }
 
-        if (!g_nal_is_compatible (argv[0], SOCKNAL, TOENAL, 0))
+        if (!g_nal_is_compatible (argv[0], SOCKNAL, 0))
                 return -1;
         
         rc = ptl_parse_ipaddr (&ipaddr, argv[1]);
@@ -797,7 +814,7 @@ int jt_ptl_disconnect(int argc, char **argv)
                 return 0;
         }
 
-        if (!g_nal_is_compatible (NULL, SOCKNAL, TOENAL, 0))
+        if (!g_nal_is_compatible (NULL, SOCKNAL, 0))
                 return 0;
 
         if (argc >= 2 &&
@@ -838,7 +855,7 @@ int jt_ptl_push_connection (int argc, char **argv)
                 return 0;
         }
 
-        if (!g_nal_is_compatible (argv[0], SOCKNAL, TOENAL, 0))
+        if (!g_nal_is_compatible (argv[0], SOCKNAL, 0))
                 return -1;
         
         if (argc > 1 &&