summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2016-08-01 14:01:58 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-08-02 14:29:41 -0700
commit18b18474fc2c962b9ca0038b7f6762b79ff88248 (patch)
tree0201cc64bf4d255d86ae02878088c31b2490754f
parente46b2e393ac16e117bd1181c74438adab246da34 (diff)
downloadchrome-ec-18b18474fc2c962b9ca0038b7f6762b79ff88248.tar.gz
Cr50: Tweak debug messages in extra/usb_updater/
Print the reply bytes, be more consistent between %d and %x. BUG=none BRANCH=none TEST=manual Build debug version, verify that it prints more stuff. Change-Id: I8c8a983360f4895ccc72b73ed67ce2d45a461bad Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/365120 Reviewed-by: Vadim Bendebury <vbendeb@google.com>
-rw-r--r--extra/usb_updater/usb_updater.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/extra/usb_updater/usb_updater.c b/extra/usb_updater/usb_updater.c
index cfd232e758..cce1bfb7ec 100644
--- a/extra/usb_updater/usb_updater.c
+++ b/extra/usb_updater/usb_updater.c
@@ -129,7 +129,7 @@ static int tpm_send_pkt(int fd, unsigned int digest, unsigned int addr,
perror("Could not write to TPM");
return -1;
} else if (done != len) {
- fprintf(stderr, "Error: Wrote %x bytes, expected to write %x\n",
+ fprintf(stderr, "Error: Wrote %d bytes, expected to write %d\n",
done, len);
return -1;
}
@@ -142,10 +142,21 @@ static int tpm_send_pkt(int fd, unsigned int digest, unsigned int addr,
return -1;
}
- debug("Read %x bytes from TPM\n", len);
+ debug("Read %d bytes from TPM\n", len);
len = len - response_offset;
memcpy(response, &reply.digest, len);
*response_size = len;
+#ifdef DEBUG
+ {
+ uint8_t *inbuf = response;
+ int i;
+
+ debug("Response size is %d bytes\n", len);
+ for (i = 0; i < len; i++)
+ debug("%2.2x ", inbuf[i]);
+ debug("\n");
+ }
+#endif
return 0;
}