Lines Matching refs:tpm
72 struct sandbox_tpm2 *tpm = dev_get_priv(dev); in sandbox_tpm2_check_session() local
165 if (!pw_sz && !tpm->pw_sz[*hierarchy]) in sandbox_tpm2_check_session()
179 if (pw_sz != tpm->pw_sz[*hierarchy] || in sandbox_tpm2_check_session()
180 strncmp(pw, tpm->pw[*hierarchy], tpm->pw_sz[*hierarchy])) { in sandbox_tpm2_check_session()
190 struct sandbox_tpm2 *tpm = dev_get_priv(dev); in sandbox_tpm2_check_readyness() local
194 if (!tpm->init_done || tpm->startup_done) in sandbox_tpm2_check_readyness()
199 if (!tpm->init_done || !tpm->startup_done) in sandbox_tpm2_check_readyness()
204 if (!tpm->startup_done) in sandbox_tpm2_check_readyness()
209 if (!tpm->tests_done) in sandbox_tpm2_check_readyness()
243 struct sandbox_tpm2 *tpm = dev_get_priv(dev); in sandbox_tpm2_extend() local
248 if (tpm->pcr[pcr_index][i] || extension[i]) in sandbox_tpm2_extend()
251 memcpy(tpm->pcr[pcr_index], sandbox_extended_once_pcr, in sandbox_tpm2_extend()
253 tpm->pcr_extensions[pcr_index]++; in sandbox_tpm2_extend()
262 struct sandbox_tpm2 *tpm = dev_get_priv(dev); in sandbox_tpm2_xfer() local
320 tpm->startup_done = true; in sandbox_tpm2_xfer()
336 tpm->tests_done = true; in sandbox_tpm2_xfer()
343 tpm->pw_sz[hierarchy] = 0; in sandbox_tpm2_xfer()
348 tpm->pw_sz[i] = 0; in sandbox_tpm2_xfer()
352 tpm->properties[i] = 0; in sandbox_tpm2_xfer()
356 tpm->pcr_extensions[i] = 0; in sandbox_tpm2_xfer()
358 tpm->pcr[i][j] = 0; in sandbox_tpm2_xfer()
370 tpm->pw_sz[hierarchy] = new_pw_sz; in sandbox_tpm2_xfer()
371 memcpy(tpm->pw[hierarchy], sent, new_pw_sz); in sandbox_tpm2_xfer()
426 put_unaligned_be32(tpm->properties[property + i], in sandbox_tpm2_xfer()
441 tpm->properties[TPM2_PROP_MAX_TRIES] = get_unaligned_be32(sent); in sandbox_tpm2_xfer()
442 sent += sizeof(*tpm->properties); in sandbox_tpm2_xfer()
443 tpm->properties[TPM2_RECOVERY_TIME] = get_unaligned_be32(sent); in sandbox_tpm2_xfer()
444 sent += sizeof(*tpm->properties); in sandbox_tpm2_xfer()
445 tpm->properties[TPM2_LOCKOUT_RECOVERY] = get_unaligned_be32(sent); in sandbox_tpm2_xfer()
446 sent += sizeof(*tpm->properties); in sandbox_tpm2_xfer()
508 put_unaligned_be32(tpm->pcr_extensions[pcr_index], recv); in sandbox_tpm2_xfer()
512 memcpy(recv, tpm->pcr[pcr_index], TPM2_DIGEST_LEN); in sandbox_tpm2_xfer()
578 struct sandbox_tpm2 *tpm = dev_get_priv(dev); in sandbox_tpm2_open() local
580 if (tpm->init_done) in sandbox_tpm2_open()
583 tpm->init_done = true; in sandbox_tpm2_open()
590 struct sandbox_tpm2 *tpm = dev_get_priv(dev); in sandbox_tpm2_probe() local
593 memset(tpm, 0, sizeof(*tpm)); in sandbox_tpm2_probe()