From 6eae52a0944136f4745770be0233dc1bef6cd2a1 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Fri, 25 Nov 2016 12:43:15 -0800 Subject: [PATCH] usb_updater: use proper TPM command code for vendor commands Until extension commands using incompatible TPM command code are phased out, the function sending vendor/extension commands to the TPM needs to be aware of the subcommand code and use the matching TPM command code. BRANCH=none BUG=chrome-os-partner:60013 TEST=with the rest of the patches applied both posted and immediate reset commands operate on Gru as expected. Change-Id: I8977df22e4c2fadfd3427c0b4f70035f7f532e00 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/414946 Reviewed-by: Bill Richardson --- extra/usb_updater/usb_updater.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extra/usb_updater/usb_updater.c b/extra/usb_updater/usb_updater.c index 8818061b28..67a5aec366 100644 --- a/extra/usb_updater/usb_updater.c +++ b/extra/usb_updater/usb_updater.c @@ -225,7 +225,10 @@ static int tpm_send_pkt(int fd, unsigned int digest, unsigned int addr, out->tag = htobe16(0x8001); out->length = htobe32(len); - out->ordinal = htobe32(CONFIG_EXTENSION_COMMAND); + if (subcmd <= LAST_EXTENSION_COMMAND) + out->ordinal = htobe32(CONFIG_EXTENSION_COMMAND); + else + out->ordinal = htobe32(TPM_CC_VENDOR_BIT_MASK); out->subcmd = htobe16(subcmd); out->digest = digest; out->address = htobe32(addr);