Lines Matching refs:tpm

68 	struct sandbox_tpm2 *tpm = dev_get_priv(dev);  in sandbox_tpm2_check_session()  local
161 if (!pw_sz && !tpm->pw_sz[*hierarchy]) in sandbox_tpm2_check_session()
175 if (pw_sz != tpm->pw_sz[*hierarchy] || in sandbox_tpm2_check_session()
176 strncmp(pw, tpm->pw[*hierarchy], tpm->pw_sz[*hierarchy])) { in sandbox_tpm2_check_session()
186 struct sandbox_tpm2 *tpm = dev_get_priv(dev); in sandbox_tpm2_check_readyness() local
190 if (!tpm->init_done || tpm->startup_done) in sandbox_tpm2_check_readyness()
195 if (!tpm->init_done || !tpm->startup_done) in sandbox_tpm2_check_readyness()
200 if (!tpm->startup_done) in sandbox_tpm2_check_readyness()
205 if (!tpm->tests_done) in sandbox_tpm2_check_readyness()
239 struct sandbox_tpm2 *tpm = dev_get_priv(dev); in sandbox_tpm2_extend() local
244 if (tpm->pcr[pcr_index][i] || extension[i]) in sandbox_tpm2_extend()
247 memcpy(tpm->pcr[pcr_index], sandbox_extended_once_pcr, in sandbox_tpm2_extend()
249 tpm->pcr_extensions[pcr_index]++; in sandbox_tpm2_extend()
258 struct sandbox_tpm2 *tpm = dev_get_priv(dev); in sandbox_tpm2_xfer() local
316 tpm->startup_done = true; in sandbox_tpm2_xfer()
332 tpm->tests_done = true; in sandbox_tpm2_xfer()
339 tpm->pw_sz[hierarchy] = 0; in sandbox_tpm2_xfer()
344 tpm->pw_sz[i] = 0; in sandbox_tpm2_xfer()
348 tpm->properties[i] = 0; in sandbox_tpm2_xfer()
352 tpm->pcr_extensions[i] = 0; in sandbox_tpm2_xfer()
354 tpm->pcr[i][j] = 0; in sandbox_tpm2_xfer()
366 tpm->pw_sz[hierarchy] = new_pw_sz; in sandbox_tpm2_xfer()
367 memcpy(tpm->pw[hierarchy], sent, new_pw_sz); in sandbox_tpm2_xfer()
456 val = tpm->properties[(property - in sandbox_tpm2_xfer()
485 tpm->properties[TPM2_PROP_MAX_TRIES] = get_unaligned_be32(sent); in sandbox_tpm2_xfer()
486 sent += sizeof(*tpm->properties); in sandbox_tpm2_xfer()
487 tpm->properties[TPM2_RECOVERY_TIME] = get_unaligned_be32(sent); in sandbox_tpm2_xfer()
488 sent += sizeof(*tpm->properties); in sandbox_tpm2_xfer()
489 tpm->properties[TPM2_LOCKOUT_RECOVERY] = get_unaligned_be32(sent); in sandbox_tpm2_xfer()
490 sent += sizeof(*tpm->properties); in sandbox_tpm2_xfer()
552 put_unaligned_be32(tpm->pcr_extensions[pcr_index], recv); in sandbox_tpm2_xfer()
556 memcpy(recv, tpm->pcr[pcr_index], TPM2_DIGEST_LEN); in sandbox_tpm2_xfer()
622 struct sandbox_tpm2 *tpm = dev_get_priv(dev); in sandbox_tpm2_open() local
624 if (tpm->init_done) in sandbox_tpm2_open()
627 tpm->init_done = true; in sandbox_tpm2_open()
634 struct sandbox_tpm2 *tpm = dev_get_priv(dev); in sandbox_tpm2_probe() local
640 memset(tpm, 0, sizeof(*tpm)); in sandbox_tpm2_probe()