summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2016-03-22 18:46:18 +0100
committerSuren A. Chilingaryan <csa@suren.me>2016-03-22 18:46:18 +0100
commit371661a51fd962dc23dcd2f761b1a8f1def3191a (patch)
treea52987137a0f17eda00ef59e741b738f120c63ad
parent31695b7d43df1537b650f83fde752dadb8943274 (diff)
downloadpcitool-371661a51fd962dc23dcd2f761b1a8f1def3191a.tar.gz
pcitool-371661a51fd962dc23dcd2f761b1a8f1def3191a.tar.bz2
pcitool-371661a51fd962dc23dcd2f761b1a8f1def3191a.tar.xz
pcitool-371661a51fd962dc23dcd2f761b1a8f1def3191a.zip
Fix pcitool getting RAW data and returning STANDARD
-rw-r--r--pcitool/cli.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/pcitool/cli.c b/pcitool/cli.c
index 1fc2abb..b267c5b 100644
--- a/pcitool/cli.c
+++ b/pcitool/cli.c
@@ -1798,14 +1798,8 @@ int GrabCallback(pcilib_event_id_t event_id, const pcilib_event_info_t *info, vo
ctx->incomplete_count++;
return PCILIB_STREAMING_CONTINUE;
}
-
- switch (ctx->format) {
- case FORMAT_DEFAULT:
- data = pcilib_get_data(handle, event_id, PCILIB_EVENT_DATA, &size);
- break;
- default:
- data = pcilib_get_data(handle, event_id, PCILIB_EVENT_RAW_DATA, &size);
- }
+
+ data = pcilib_get_data(handle, event_id, ctx->data, &size);
if (!data) {
int err = (int)size;
@@ -2176,11 +2170,17 @@ int TriggerAndGrab(pcilib_t *handle, GRAB_MODE grab_mode, const char *evname, co
if (data == PCILIB_EVENT_DATA_TYPE_INVALID)
Error("Can't find data type (%s)", data_type);
} else {
- data = PCILIB_EVENT_DATA;
+ switch (format) {
+ case FORMAT_DEFAULT:
+ data = PCILIB_EVENT_DATA;
+ break;
+ default:
+ data = PCILIB_EVENT_RAW_DATA;
+ }
}
-
+
memset(&ctx, 0, sizeof(GRABContext));
-
+
ctx.handle = handle;
ctx.event = event;
ctx.data = data;