]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
infiniband-diags: update to latest SVN
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Feb 2009 22:42:31 +0000 (22:42 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Feb 2009 22:42:31 +0000 (22:42 +0000)
Matches code based on patches submitted upstream.

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

28 files changed:
branches/winverbs/tools/infiniband-diags/include/ibdiag_common.h
branches/winverbs/tools/infiniband-diags/include/windows/config.h [new file with mode: 0644]
branches/winverbs/tools/infiniband-diags/include/windows/ibdiag_osd.h [deleted file]
branches/winverbs/tools/infiniband-diags/include/windows/inttypes.h [new file with mode: 0644]
branches/winverbs/tools/infiniband-diags/include/windows/netinet/in.h [new file with mode: 0644]
branches/winverbs/tools/infiniband-diags/include/windows/unistd.h [new file with mode: 0644]
branches/winverbs/tools/infiniband-diags/src/dirs
branches/winverbs/tools/infiniband-diags/src/ibaddr.c
branches/winverbs/tools/infiniband-diags/src/ibaddr/SOURCES
branches/winverbs/tools/infiniband-diags/src/ibdiag_common.c
branches/winverbs/tools/infiniband-diags/src/ibdiag_windows.c
branches/winverbs/tools/infiniband-diags/src/ibping.c
branches/winverbs/tools/infiniband-diags/src/ibportstate.c
branches/winverbs/tools/infiniband-diags/src/ibportstate/SOURCES
branches/winverbs/tools/infiniband-diags/src/ibstat.c
branches/winverbs/tools/infiniband-diags/src/ibstat/SOURCES
branches/winverbs/tools/infiniband-diags/src/perfquery.c
branches/winverbs/tools/infiniband-diags/src/perfquery/SOURCES
branches/winverbs/tools/infiniband-diags/src/sminfo.c
branches/winverbs/tools/infiniband-diags/src/sminfo/SOURCES
branches/winverbs/tools/infiniband-diags/src/smpdump.c
branches/winverbs/tools/infiniband-diags/src/smpdump/SOURCES
branches/winverbs/tools/infiniband-diags/src/smpquery.c
branches/winverbs/tools/infiniband-diags/src/smpquery/SOURCES [new file with mode: 0644]
branches/winverbs/tools/infiniband-diags/src/smpquery/makefile [new file with mode: 0644]
branches/winverbs/tools/infiniband-diags/src/smpquery/smpquery.rc [new file with mode: 0644]
branches/winverbs/tools/infiniband-diags/src/vendstat.c
branches/winverbs/tools/infiniband-diags/src/vendstat/SOURCES

index d1f296d3ed9e6408245d21d47f87bf23fbf43d86..52fd1475965f902febbe3f0a1189a4d54c348f08 100644 (file)
@@ -36,7 +36,6 @@
 #define _IBDIAG_COMMON_H_
 
 #include <infiniband/mad.h>
-#include "ibdiag_osd.h"
 
 extern int ibdebug;
 extern int ibverbose;
@@ -51,9 +50,13 @@ extern int ibd_timeout;
 /*========================================================*/
 
 #undef DEBUG
-#define        DEBUG   if (ibdebug || ibverbose) IBWARN
-#define        VERBOSE if (ibdebug || ibverbose > 1) IBWARN
-#define IBERROR(fmt, ...)      iberror(__FUNCTION__, fmt, ## __VA_ARGS__)
+#define DEBUG(fmt, ...) do { \
+       if (ibdebug || ibverbose) IBWARN(fmt, ## __VA_ARGS__); \
+} while (0)
+#define VERBOSE(fmt, ...) do { \
+       if (ibdebug || ibverbose > 1) IBWARN(fmt, ## __VA_ARGS__); \
+} while (0)
+#define IBERROR(fmt, ...) iberror(__FUNCTION__, fmt, ## __VA_ARGS__)
 
 struct ibdiag_opt {
        const char *name;
diff --git a/branches/winverbs/tools/infiniband-diags/include/windows/config.h b/branches/winverbs/tools/infiniband-diags/include/windows/config.h
new file mode 100644 (file)
index 0000000..cd70278
--- /dev/null
@@ -0,0 +1,43 @@
+/*\r
+ * Copyright (c) 2009 Intel Corp, Inc.  All rights reserved.\r
+ *\r
+ * This software is available to you under a choice of one of two\r
+ * licenses.  You may choose to be licensed under the terms of the GNU\r
+ * General Public License (GPL) Version 2, available from the file\r
+ * COPYING in the main directory of this source tree, or the\r
+ * OpenIB.org BSD license below:\r
+ *\r
+ *     Redistribution and use in source and binary forms, with or\r
+ *     without modification, are permitted provided that the following\r
+ *     conditions are met:\r
+ *\r
+ *      - Redistributions of source code must retain the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer.\r
+ *\r
+ *      - Redistributions in binary form must reproduce the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer in the documentation and/or other materials\r
+ *        provided with the distribution.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ *\r
+ */\r
+\r
+#ifndef _CONFIG_H_\r
+#define _CONFIG_H_\r
+\r
+#include <../../../../ulp/libibverbs/include/infiniband/verbs.h>\r
+\r
+#define strdup _strdup\r
+#define strdupa _strdup\r
+#define strncasecmp _strnicmp\r
+\r
+#endif /* _CONFIG_H_ */\r
diff --git a/branches/winverbs/tools/infiniband-diags/include/windows/ibdiag_osd.h b/branches/winverbs/tools/infiniband-diags/include/windows/ibdiag_osd.h
deleted file mode 100644 (file)
index 559f814..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*\r
- * Copyright (c) 2009 Intel Corp, Inc.  All rights reserved.\r
- *\r
- * This software is available to you under a choice of one of two\r
- * licenses.  You may choose to be licensed under the terms of the GNU\r
- * General Public License (GPL) Version 2, available from the file\r
- * COPYING in the main directory of this source tree, or the\r
- * OpenIB.org BSD license below:\r
- *\r
- *     Redistribution and use in source and binary forms, with or\r
- *     without modification, are permitted provided that the following\r
- *     conditions are met:\r
- *\r
- *      - Redistributions of source code must retain the above\r
- *        copyright notice, this list of conditions and the following\r
- *        disclaimer.\r
- *\r
- *      - Redistributions in binary form must reproduce the above\r
- *        copyright notice, this list of conditions and the following\r
- *        disclaimer in the documentation and/or other materials\r
- *        provided with the distribution.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
- * SOFTWARE.\r
- *\r
- */\r
-\r
-#ifndef _IBDIAG_OSD_H_\r
-#define _IBDIAG_OSD_H_\r
-\r
-#include <../../../../ulp/libibverbs/include/infiniband/verbs.h>\r
-\r
-#define _CDECL __cdecl\r
-\r
-#define strdupa _strdup\r
-#define strncasecmp _strnicmp\r
-\r
-#endif /* _IBDIAG_OSD_H_ */\r
diff --git a/branches/winverbs/tools/infiniband-diags/include/windows/inttypes.h b/branches/winverbs/tools/infiniband-diags/include/windows/inttypes.h
new file mode 100644 (file)
index 0000000..1977666
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2009 Intel Corp, Inc.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or 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.
+ *
+ */
+
+#ifndef _INTTYPES_H_
+#define _INTTYPES_H_
+
+#endif /* _INTTYPES_H_ */
diff --git a/branches/winverbs/tools/infiniband-diags/include/windows/netinet/in.h b/branches/winverbs/tools/infiniband-diags/include/windows/netinet/in.h
new file mode 100644 (file)
index 0000000..4c84a6b
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2009 Intel Corp, Inc.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or 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.
+ *
+ */
+
+#ifndef _IN_H_
+#define _IN_H_
+
+#endif /* _IN_H_ */
diff --git a/branches/winverbs/tools/infiniband-diags/include/windows/unistd.h b/branches/winverbs/tools/infiniband-diags/include/windows/unistd.h
new file mode 100644 (file)
index 0000000..33b9ba3
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2009 Intel Corp, Inc.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or 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.
+ *
+ */
+
+#ifndef _UNISTD_H_
+#define _UNISTD_H_
+
+#endif /* _UNISTD_H_ */
index 117309dca8ced935f7201eafc672508a4ca03ac3..c3c9fd760c4108b51c2635a340593e6647854031 100644 (file)
@@ -5,4 +5,5 @@ DIRS = \
        perfquery       \\r
        sminfo          \\r
        smpdump         \\r
+       smpquery        \\r
        vendstat
\ No newline at end of file
index 11f48869f764d60e1cdbd6691d6bad4cc1da8e92..9098699c559c3fd4f84c790f62f9ef46557b9542 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <getopt.h>
 
 #include <infiniband/umad.h>
@@ -101,7 +102,7 @@ static int process_opt(void *context, int ch, char *optarg)
        return 0;
 }
 
-int _CDECL main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};
        ib_portid_t portid = {0};
index ac557a9f1fd520affaafcc5a10d6220ebf0fd28b..9ae2509e13454f0b2b29ba7765ad5d428f370e74 100644 (file)
@@ -14,9 +14,11 @@ INCLUDES = ..\..\include;..\..\include\windows;\
                   ..\..\..\..\ulp\libibumad\include;\\r
                   ..\..\..\..\inc;..\..\..\..\inc\user;\r
 \r
-TARGETLIBS =   \\r
+C_DEFINES = $(C_DEFINES) /DHAVE_CONFIG_H\r
+\r
+TARGETLIBS = \\r
        $(SDK_LIB_PATH)\kernel32.lib    \\r
-       $(SDK_LIB_PATH)\ws2_32.lib      \\r
+       $(SDK_LIB_PATH)\ws2_32.lib              \\r
 !if $(FREEBUILD)\r
        $(TARGETPATH)\*\libibmad.lib    \\r
        $(TARGETPATH)\*\libibumad.lib   \r
@@ -25,3 +27,4 @@ TARGETLIBS =  \
        $(TARGETPATH)\*\libibumadd.lib  \r
 !endif\r
 \r
+MSC_WARNING_LEVEL = /W3 /WX /wd4007\r
index a88ca7251e964c81e0de5241676c686ad300c304..5f2472d8527574c31a45e78506e744e5103a4876 100644 (file)
@@ -43,7 +43,9 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <sys/types.h>
+#include <unistd.h>
 #include <ctype.h>
+#include <config.h>
 #include <getopt.h>
 
 #include <infiniband/umad.h>
@@ -271,8 +273,6 @@ int ibdiag_process_opts(int argc, char * const argv[], void *cxt,
        char str_opts[1024];
        const struct ibdiag_opt *o;
 
-       memset((void *) opts_map, 0, sizeof(opts_map));
-
        prog_name = argv[0];
        prog_args = usage_args;
        prog_examples = usage_examples;
index 03ec30d92869024f1f37cf422cc574d9fd0bdac4..bdcbebcc484d7b33e9bee8b8d184886a5ea58009 100644 (file)
@@ -1 +1,34 @@
+/*\r
+ * Copyright (c) 2009 Intel Corp., Inc.\r
+ *\r
+ * This software is available to you under a choice of one of two\r
+ * licenses.  You may choose to be licensed under the terms of the GNU\r
+ * General Public License (GPL) Version 2, available from the file\r
+ * COPYING in the main directory of this source tree, or the\r
+ * OpenIB.org BSD license below:\r
+ *\r
+ *     Redistribution and use in source and binary forms, with or\r
+ *     without modification, are permitted provided that the following\r
+ *     conditions are met:\r
+ *\r
+ *      - Redistributions of source code must retain the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer.\r
+ *\r
+ *      - Redistributions in binary form must reproduce the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer in the documentation and/or other materials\r
+ *        provided with the distribution.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ *\r
+ */\r
+\r
 #include "..\..\..\..\etc\user\getopt.c"\r
index fb45eecae5548587966f91a71c9822ed7a64c67f..29c98c28432d074bc24051cb83c12c71823c4325 100644 (file)
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <string.h>
+#include <signal.h>
 #include <getopt.h>
+#include <sys/time.h>
 
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
@@ -200,7 +203,7 @@ int main(int argc, char **argv)
                { "flood", 'f', 0, NULL, "flood destination" },
                { "oui", 'o', 1, NULL, "use specified OUI number" },
                { "Server", 'S', 0, NULL, "start in server mode" },
-               { }
+               { }
        };
        char usage_args[] = "<dest lid|guid>";
 
index 4aa8606c9db73c6c96de536ca633200cf6b6ba4f..c0b9b349fc0fa19d185f782de9005de18e7dc4c3 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <string.h>
 #include <getopt.h>
 
@@ -184,7 +185,7 @@ validate_speed(int speed, int peerspeed, int lsa)
        }
 }
 
-int _CDECL main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};
        ib_portid_t portid = {0};
index d3a8e6a18b6b3efffdd3e9610df79c1cacca80be..42067e014499b1481de2279c64de36f841bbd0d6 100644 (file)
@@ -14,7 +14,9 @@ INCLUDES = ..\..\include;..\..\include\windows;\
                   ..\..\..\..\ulp\libibumad\include;\\r
                   ..\..\..\..\inc;..\..\..\..\inc\user;\r
 \r
-TARGETLIBS =                                           \\r
+C_DEFINES = $(C_DEFINES) /DHAVE_CONFIG_H\r
+\r
+TARGETLIBS = \\r
        $(SDK_LIB_PATH)\kernel32.lib    \\r
 !if $(FREEBUILD)\r
        $(TARGETPATH)\*\libibmad.lib    \\r
@@ -24,3 +26,4 @@ TARGETLIBS =                                          \
        $(TARGETPATH)\*\libibumadd.lib\r
 !endif\r
 \r
+MSC_WARNING_LEVEL = /W3 /WX /wd4007\r
index dc777a755579bd5ca4b1105db1202ea10c654337..7985be173d77591e1c3bf5e16cf09110eaa9f978 100644 (file)
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
+#include <inttypes.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <getopt.h>
+#include <netinet/in.h>
 
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
@@ -188,7 +190,7 @@ static int process_opt(void *context, int ch, char *optarg)
        return 0;
 }
 
-int _CDECL main(int argc, char *argv[])
+int main(int argc, char *argv[])
 {
        char names[UMAD_MAX_DEVICES][UMAD_CA_NAME_LEN];
        int dev_port = -1;
index 243ac4ac2db4e77e6df574daec55dfba4552e2b4..c41f91e172c334a53cc448ee676a4ec97cbb12eb 100644 (file)
@@ -14,6 +14,8 @@ INCLUDES = ..\..\include;..\..\include\windows;\
                   ..\..\..\..\ulp\libibumad\include;\\r
                   ..\..\..\..\inc;..\..\..\..\inc\user;\r
 \r
+C_DEFINES = $(C_DEFINES) /DHAVE_CONFIG_H\r
+\r
 TARGETLIBS = \\r
        $(SDK_LIB_PATH)\kernel32.lib    \\r
 !if $(FREEBUILD)\r
@@ -24,3 +26,4 @@ TARGETLIBS = \
        $(TARGETPATH)\*\libibumadd.lib  \r
 !endif\r
 \r
+MSC_WARNING_LEVEL = /W3 /WX /wd4007\r
index b263672769db4a96ca6a125ad6a849d74cac664b..6292743bb9ab233b06c7800ae47853a85d8287f1 100644 (file)
@@ -38,7 +38,9 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <getopt.h>
+#include <netinet/in.h>
 
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
@@ -332,7 +334,7 @@ static int process_opt(void *context, int ch, char *optarg)
        return 0;
 }
 
-int _CDECL main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        int mgmt_classes[4] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS, IB_PERFORMANCE_CLASS};
        ib_portid_t portid = {0};
index ded055d299005072c1d8fae6fb526b4aef38beba..d1d67e4eb51b59c85ba9e37e7d9d143044509ab9 100644 (file)
@@ -14,9 +14,11 @@ INCLUDES = ..\..\include;..\..\include\windows;\
                   ..\..\..\..\ulp\libibumad\include;\\r
                   ..\..\..\..\inc;..\..\..\..\inc\user;\r
 \r
-TARGETLIBS =   \\r
+C_DEFINES = $(C_DEFINES) /DHAVE_CONFIG_H\r
+\r
+TARGETLIBS = \\r
        $(SDK_LIB_PATH)\kernel32.lib    \\r
-       $(SDK_LIB_PATH)\ws2_32.lib      \\r
+       $(SDK_LIB_PATH)\ws2_32.lib              \\r
 !if $(FREEBUILD)\r
        $(TARGETPATH)\*\libibmad.lib    \\r
        $(TARGETPATH)\*\libibumad.lib   \r
@@ -25,3 +27,4 @@ TARGETLIBS =  \
        $(TARGETPATH)\*\libibumadd.lib  \r
 !endif\r
 \r
+MSC_WARNING_LEVEL = /W3 /WX /wd4007\r
index 76f23456aec937c8334d89e5301da88973b74509..549cb814a160a4835f4a562b474d0210613fa1d1 100644 (file)
@@ -37,6 +37,8 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
+#include <inttypes.h>
 #include <getopt.h>
 
 #include <infiniband/umad.h>
@@ -86,7 +88,7 @@ static int process_opt(void *context, int ch, char *optarg)
        return 0;
 }
 
-int _CDECL main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};
        int mod = 0;
index 46c1e95bfe099a6b9762e1050ec81a9694dc5a0d..fb8b06d467cbd41ab37e0fb7a0eee01470a07e57 100644 (file)
@@ -14,7 +14,9 @@ INCLUDES = ..\..\include;..\..\include\windows;\
                   ..\..\..\..\ulp\libibumad\include;\\r
                   ..\..\..\..\inc;..\..\..\..\inc\user;\r
 \r
-TARGETLIBS =   \\r
+C_DEFINES = $(C_DEFINES) /DHAVE_CONFIG_H\r
+\r
+TARGETLIBS = \\r
        $(SDK_LIB_PATH)\kernel32.lib    \\r
 !if $(FREEBUILD)\r
        $(TARGETPATH)\*\libibmad.lib    \\r
@@ -24,3 +26,4 @@ TARGETLIBS =  \
        $(TARGETPATH)\*\libibumadd.lib  \r
 !endif\r
 \r
+MSC_WARNING_LEVEL = /W3 /WX /wd4007
\ No newline at end of file
index 6d2f3a5fe47575c11cb1c56fecd8a76c70fa4451..6c7f84caeb36b47cf97de41f67462ccc5680c688 100644 (file)
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
+#include <inttypes.h>
 #include <string.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <getopt.h>
+#include <netinet/in.h>
 
 #include <infiniband/mad.h>
 #include <infiniband/umad.h>
@@ -207,7 +209,7 @@ static int process_opt(void *context, int ch, char *optarg)
        return 0;
 }
 
-int _CDECL main(int argc, char *argv[])
+int main(int argc, char *argv[])
 {
        int dlid = 0;
        void *umad;
index f21cd9ca5ced48ccbbc9ce1151dbc78c3690a2f0..19768ce616b2c173c1c681a0bee19e86a9ba56e6 100644 (file)
@@ -14,6 +14,8 @@ INCLUDES = ..\..\include;..\..\include\windows;\
                   ..\..\..\..\ulp\libibumad\include;\\r
                   ..\..\..\..\inc;..\..\..\..\inc\user;\r
 \r
+C_DEFINES = $(C_DEFINES) /DHAVE_CONFIG_H\r
+\r
 TARGETLIBS = \\r
        $(SDK_LIB_PATH)\kernel32.lib    \\r
        $(SDK_LIB_PATH)\ws2_32.lib              \\r
@@ -25,3 +27,4 @@ TARGETLIBS = \
        $(TARGETPATH)\*\libibumadd.lib  \r
 !endif\r
 \r
+MSC_WARNING_LEVEL = /W3 /WX /wd4007\r
index 44280e17d24cf74eef5b83f8538abd1efe48e83f..2d3d91b2a6befd90b79b3ef500e52807bf81467e 100644 (file)
@@ -47,7 +47,7 @@
 
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
-#include <infiniband/complib/cl_nodenamemap.h>
+#include <complib/cl_nodenamemap.h>
 
 #include "ibdiag_common.h"
 
@@ -191,7 +191,7 @@ pkey_table(ib_portid_t *dest, char **argv, int argc)
        } else
                mad_decode_field(data, IB_NODE_PARTITION_CAP_F, &n);
 
-       for (i = 0; i < (n + 31) / 32; i++) {
+       for (i = 0; i < (uint32_t) ((n + 31) / 32); i++) {
                mod =  i | (portnum << 16);
                if (!smp_query(data, dest, IB_ATTR_PKEY_TBL, mod, 0))
                        return "pkey table query failed";
@@ -353,7 +353,7 @@ guid_info(ib_portid_t *dest, char **argv, int argc)
                return "port info failed";
        mad_decode_field(data, IB_PORT_GUID_CAP_F, &n);
 
-       for (i = 0; i < (n + 7) / 8; i++) {
+       for (i = 0; i < (uint32_t) ((n + 7) / 8); i++) {
                mod =  i;
                if (!smp_query(data, dest, IB_ATTR_GUID_INFO, mod, 0))
                        return "guid info query failed";
@@ -412,7 +412,7 @@ int main(int argc, char **argv)
        const struct ibdiag_opt opts[] = {
                { "combined", 'c', 0, NULL, "use Combined route address argument"},
                { "node-name-map", 1, 1, "<file>", "node name map file"},
-               {}
+               { 0 }
        };
        const char *usage_examples[] = {
                "portinfo 3 1\t\t\t\t# portinfo by lid, with port modifier",
diff --git a/branches/winverbs/tools/infiniband-diags/src/smpquery/SOURCES b/branches/winverbs/tools/infiniband-diags/src/smpquery/SOURCES
new file mode 100644 (file)
index 0000000..ed8f8f9
--- /dev/null
@@ -0,0 +1,32 @@
+TARGETNAME = smpquery\r
+TARGETPATH = ..\..\..\..\bin\user\obj$(BUILD_ALT_DIR)\r
+TARGETTYPE = PROGRAM\r
+\r
+UMTYPE = console\r
+UMENTRY = main\r
+\r
+USE_MSVCRT = 1\r
+\r
+SOURCES = ..\smpquery.c ..\ibdiag_common.c ..\ibdiag_windows.c smpquery.rc\r
+       \r
+INCLUDES = ..\..\include;..\..\include\windows;\\r
+                  ..\..\..\..\ulp\libibmad\include;\\r
+                  ..\..\..\..\ulp\libibumad\include;\\r
+                  ..\..\..\..\inc;..\..\..\..\inc\user;\r
+\r
+C_DEFINES = $(C_DEFINES) /DHAVE_CONFIG_H\r
+\r
+TARGETLIBS = \\r
+       $(SDK_LIB_PATH)\kernel32.lib    \\r
+       $(SDK_LIB_PATH)\ws2_32.lib              \\r
+!if $(FREEBUILD)\r
+       $(TARGETPATH)\*\complib.lib             \\r
+       $(TARGETPATH)\*\libibmad.lib    \\r
+       $(TARGETPATH)\*\libibumad.lib\r
+!else\r
+       $(TARGETPATH)\*\complibd.lib    \\r
+       $(TARGETPATH)\*\libibmadd.lib   \\r
+       $(TARGETPATH)\*\libibumadd.lib  \r
+!endif\r
+\r
+MSC_WARNING_LEVEL = /W3 /WX /wd4007\r
diff --git a/branches/winverbs/tools/infiniband-diags/src/smpquery/makefile b/branches/winverbs/tools/infiniband-diags/src/smpquery/makefile
new file mode 100644 (file)
index 0000000..a0c0627
--- /dev/null
@@ -0,0 +1,7 @@
+#\r
+# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source\r
+# file to this component.  This file merely indirects to the real make file\r
+# that is shared by all the driver components of the OpenIB Windows project.\r
+#\r
+\r
+!INCLUDE ..\..\..\..\inc\openib.def\r
diff --git a/branches/winverbs/tools/infiniband-diags/src/smpquery/smpquery.rc b/branches/winverbs/tools/infiniband-diags/src/smpquery/smpquery.rc
new file mode 100644 (file)
index 0000000..0f8b2d4
--- /dev/null
@@ -0,0 +1,47 @@
+/*\r
+ * Copyright (c) 2009 Intel Corporation.  All rights reserved.\r
+ *\r
+ * This software is available to you under the OpenIB.org BSD license\r
+ * below:\r
+ *\r
+ *     Redistribution and use in source and binary forms, with or\r
+ *     without modification, are permitted provided that the following\r
+ *     conditions are met:\r
+ *\r
+ *      - Redistributions of source code must retain the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer.\r
+ *\r
+ *      - Redistributions in binary form must reproduce the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer in the documentation and/or other materials\r
+ *        provided with the distribution.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ *\r
+ * $Id$\r
+ */\r
+\r
+\r
+#include <oib_ver.h>\r
+\r
+#define VER_FILETYPE                   VFT_APP\r
+#define VER_FILESUBTYPE                        VFT2_UNKNOWN\r
+\r
+#ifdef DBG\r
+#define VER_FILEDESCRIPTION_STR        "Query IB SM Attributes (Debug)"\r
+#else\r
+#define VER_FILEDESCRIPTION_STR        "Query IB SM Attributes"\r
+#endif\r
+\r
+#define VER_INTERNALNAME_STR           "smpquery.exe"\r
+#define VER_ORIGINALFILENAME_STR       "smpquery.exe"\r
+\r
+#include <common.ver>\r
index 4fe6e68cb9db84fa9c41c77bdfdc056f5f739a4e..db87e385b3c686e1cb832b00edd8d3bf3f476647 100644 (file)
@@ -37,7 +37,9 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <getopt.h>
+#include <netinet/in.h>
 
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
@@ -118,7 +120,7 @@ static int process_opt(void *context, int ch, char *optarg)
        return 0;
 }
 
-int _CDECL main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        int mgmt_classes[4] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS, IB_MLX_VENDOR_CLASS};
        ib_portid_t portid = {0};
index 073fa2c3eeff580dad6f27724fd551257301a8ab..aebf4201ab35a621389cf8c51a270cb16438d20a 100644 (file)
@@ -14,9 +14,11 @@ INCLUDES = ..\..\include;..\..\include\windows;\
                   ..\..\..\..\ulp\libibumad\include;\\r
                   ..\..\..\..\inc;..\..\..\..\inc\user;\r
 \r
-TARGETLIBS =   \\r
+C_DEFINES = $(C_DEFINES) /DHAVE_CONFIG_H\r
+\r
+TARGETLIBS = \\r
        $(SDK_LIB_PATH)\kernel32.lib    \\r
-       $(SDK_LIB_PATH)\ws2_32.lib      \\r
+       $(SDK_LIB_PATH)\ws2_32.lib              \\r
 !if $(FREEBUILD)\r
        $(TARGETPATH)\*\libibmad.lib    \\r
        $(TARGETPATH)\*\libibumad.lib   \r
@@ -25,3 +27,4 @@ TARGETLIBS =  \
        $(TARGETPATH)\*\libibumadd.lib  \r
 !endif\r
 \r
+MSC_WARNING_LEVEL = /W3 /WX /wd4007\r