code = get_unaligned_be32(sendbuf + sizeof(uint16_t) +
sizeof(uint32_t));
+#ifdef DEBUG
printf("tpm: %zd bytes, recv_len %zd, cmd = %x\n", send_size,
*recv_len, code);
print_buffer(0, sendbuf, 1, send_size, 0);
+#endif
switch (code) {
case TPM_CMD_GET_CAPABILITY:
type = get_unaligned_be32(sendbuf + 14);
printf("Unknown tpm command %02x\n", code);
return -ENOSYS;
}
+#ifdef DEBUG
+ printf("tpm: rx recv_len %zd\n", *recv_len);
+ print_buffer(0, recvbuf, 1, *recv_len, 0);
+#endif
return 0;
}