]> git.openfabrics.org - ~adrianc/mstflint.git/commitdiff
Add mstdump tool, make it compile with mtcr.h
authorMichael S. Tsirkin <mst@mellanox.co.il>
Thu, 28 Dec 2006 15:13:42 +0000 (17:13 +0200)
committerMichael S. Tsirkin <mst@mellanox.co.il>
Thu, 28 Dec 2006 15:13:42 +0000 (17:13 +0200)
Makefile
mstdump.c

index 9ac502a3a7fcd761ce56b7971bd459f4c362d453..35479a8e419519ceb038aefddff59dee84bd57ab 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ EXTRA_LOADLIBES=-lz
 LOADLIBES+=${EXTRA_LOADLIBES}
 
 all: default
-bin: mstflint mread mwrite
+bin: mstflint mread mwrite mstdump
 
 default: bin
 static: bin
@@ -34,5 +34,8 @@ mwrite: mwrite.c mtcr.h
 mread: mread.c mtcr.h
        $(CC) ${CFLAGS} mread.c -o mread
 
+mstdump: mstdump.c mtcr.h
+       $(CC) ${CFLAGS} mstdump.c -o mstdump
+
 clean:
        rm -f mstflint mread mwrite mstflint.o
index 5e2324118a1a08f4e6715f39cc50c5d1dda98d5f..c156c7cfa4a28ecf9d45fba580a962ced9f28e07 100644 (file)
--- a/mstdump.c
+++ b/mstdump.c
@@ -37,9 +37,9 @@
  */
 
 
+#include <mtcr.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <mtcr.h>
 
 static unsigned tavor_address_list[]=
 {
@@ -60760,11 +60760,19 @@ int main(int argc, char** argv)
   int list_size;
   unsigned* list;
 
+  if (argc != 2)
+  {
+    fprintf(stderr,"Usage: %s <device>.\n", argv[0]);
+    return 2;
+  }
+
+#if 0
   if (argc != 2 && argc != 3)
   {
     fprintf(stderr,"Usage: %s <device> [i2c-slave].\n", argv[0]);
     return 2;
   }
+#endif
 
   f=mopen(argv[1]);
 
@@ -60774,9 +60782,10 @@ int main(int argc, char** argv)
     return 1;
   }
 
+#if 0
   if (argc == 3)
       mset_i2c_slave(f, strtoul(argv[2],0,0));
-
+#endif
 
   myread4(f,0xF0014,&hca_id);
   myread4(f,0x60014,&is3_id);