When debugging, it is welcome to get more information about what the TPM
returns. Add the possibility to print the packets received to show their
exact content.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
int err, ret;
u8 response_buffer[COMMAND_BUFFER_SIZE];
size_t response_length;
+ int i;
if (response) {
response_length = *size_ptr;
if (size_ptr)
*size_ptr = response_length;
- return tpm_return_code(response);
+ ret = tpm_return_code(response);
+
+ log(LOGC_NONE, LOGL_DEBUG, "TPM response [ret:%d]: ", ret);
+ for (i = 0; i < response_length; i++)
+ log(LOGC_NONE, LOGL_DEBUG, "%02x ", ((u8 *)response)[i]);
+ log(LOGC_NONE, LOGL_DEBUG, "\n");
+
+ return ret;
}
int tpm_init(void)