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 <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/414946
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Vadim Bendebury
2016-11-25 12:43:15 -08:00
committed by chrome-bot
parent 1461cc8043
commit 6eae52a094

View File

@@ -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);