diff options
Diffstat (limited to 'pcitool/cli.c')
-rw-r--r-- | pcitool/cli.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pcitool/cli.c b/pcitool/cli.c index 57801ab..226ca55 100644 --- a/pcitool/cli.c +++ b/pcitool/cli.c @@ -38,6 +38,7 @@ #include "error.h" #include "debug.h" #include "model.h" +#include "xml.h" #include "locking.h" /* defines */ @@ -92,6 +93,7 @@ typedef enum { MODE_LIST_KMEM, MODE_READ_KMEM, MODE_FREE_KMEM, + MODE_VALIDATE_XML MODE_LIST_LOCKS, MODE_FREE_LOCKS, MODE_LOCK, @@ -141,6 +143,7 @@ typedef enum { OPT_GRAB = 'g', OPT_QUIETE = 'q', OPT_HELP = 'h', + OPT_VALIDATE_XML= 'v', OPT_RESET = 128, OPT_BENCHMARK, OPT_TRIGGER, @@ -192,6 +195,7 @@ static struct option long_options[] = { {"iterations", required_argument, 0, OPT_ITERATIONS }, {"info", no_argument, 0, OPT_INFO }, {"list", no_argument, 0, OPT_LIST }, + {"validate", no_argument,0,OPT_VALIDATE_XML}, {"reset", no_argument, 0, OPT_RESET }, {"benchmark", optional_argument, 0, OPT_BENCHMARK }, {"read", optional_argument, 0, OPT_READ }, @@ -347,6 +351,8 @@ void Usage(int argc, char *argv[], const char *format, ...) { " Data can be specified as sequence of hexdecimal number or\n" " a single value prefixed with '*'. In this case it will be\n" " replicated the specified amount of times\n" +" XML:\n" +" -v -validates the xml file against xsd" "\n\n", argv[0]); @@ -1002,8 +1008,8 @@ int ReadRegister(pcilib_t *handle, const pcilib_model_description_t *model_info, format = model_info->banks[bank_id].format; if (!format) format = "%lu"; - err = pcilib_read_register_by_id(handle, regid, &value); - // err = pcilib_read_register(handle, bank, reg, &value); + err = pcilib_read_register_by_id(handle, regid, &value); + // err = pcilib_read_register(handle, bank, reg, &value); if (err) printf("Error reading register %s\n", reg); else { printf("%s = ", reg); @@ -3293,6 +3299,9 @@ int main(int argc, char **argv) { } switch (mode) { + case MODE_VALIDATE_XML: + validation(); + break; case MODE_INFO: Info(handle, model_info); break; |