summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;