summaryrefslogtreecommitdiffstats
path: root/pcitool/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'pcitool/cli.c')
-rw-r--r--pcitool/cli.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/pcitool/cli.c b/pcitool/cli.c
index 4c21e99..2ae569f 100644
--- a/pcitool/cli.c
+++ b/pcitool/cli.c
@@ -1,6 +1,7 @@
#define _XOPEN_SOURCE 700
#define _POSIX_C_SOURCE 200112L
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#include <stdio.h>
#include <stdlib.h>
@@ -38,7 +39,6 @@
#include "error.h"
#include "debug.h"
#include "model.h"
-#include "xml.h"
#include "locking.h"
/* defines */
@@ -348,8 +348,6 @@ 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]);
@@ -1005,8 +1003,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);
@@ -3134,7 +3132,7 @@ int main(int argc, char **argv) {
else Usage(argc, argv, "The %i data values is specified, but %i required", argc - optind, size);
case MODE_READ:
if (!addr) {
- if (((!dma_info)||(!dma_info->api))&&(!model_info->api)) {
+ if (((!dma_info)||(!dma_info->api))&&(!model_info->api)&&(!handle->num_reg)) {
// if (model == PCILIB_MODEL_PCI) {
if ((amode != ACCESS_DMA)&&(amode != ACCESS_CONFIG))
Usage(argc, argv, "The address is not specified");
@@ -3394,6 +3392,6 @@ int main(int argc, char **argv) {
pcilib_close(handle);
if (data != argv + optind) free(data);
-
+
return err;
}