Lines Matching refs:rc

251 	int rc;  in tpm2_pcr_read()  local
267 rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), in tpm2_pcr_read()
269 if (rc == 0) { in tpm2_pcr_read()
274 return rc; in tpm2_pcr_read()
300 int rc; in tpm2_pcr_extend() local
315 rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), in tpm2_pcr_extend()
318 return rc; in tpm2_pcr_extend()
432 int rc; in tpm2_seal_trusted() local
434 rc = tpm_buf_init(&buf, TPM2_ST_SESSIONS, TPM2_CC_CREATE); in tpm2_seal_trusted()
435 if (rc) in tpm2_seal_trusted()
436 return rc; in tpm2_seal_trusted()
471 rc = -E2BIG; in tpm2_seal_trusted()
475 rc = tpm_transmit_cmd(chip, buf.data, PAGE_SIZE, "sealing data"); in tpm2_seal_trusted()
476 if (rc) in tpm2_seal_trusted()
481 rc = -E2BIG; in tpm2_seal_trusted()
491 if (rc > 0) in tpm2_seal_trusted()
492 rc = -EPERM; in tpm2_seal_trusted()
494 return rc; in tpm2_seal_trusted()
506 int rc; in tpm2_load() local
517 rc = tpm_buf_init(&buf, TPM2_ST_SESSIONS, TPM2_CC_LOAD); in tpm2_load()
518 if (rc) in tpm2_load()
519 return rc; in tpm2_load()
531 rc = -E2BIG; in tpm2_load()
535 rc = tpm_transmit_cmd(chip, buf.data, PAGE_SIZE, "loading blob"); in tpm2_load()
536 if (!rc) in tpm2_load()
543 if (rc > 0) in tpm2_load()
544 rc = -EPERM; in tpm2_load()
546 return rc; in tpm2_load()
552 int rc; in tpm2_flush_context() local
554 rc = tpm_buf_init(&buf, TPM2_ST_NO_SESSIONS, TPM2_CC_FLUSH_CONTEXT); in tpm2_flush_context()
555 if (rc) { in tpm2_flush_context()
563 rc = tpm_transmit_cmd(chip, buf.data, PAGE_SIZE, "flushing context"); in tpm2_flush_context()
564 if (rc) in tpm2_flush_context()
566 rc); in tpm2_flush_context()
579 int rc; in tpm2_unseal() local
581 rc = tpm_buf_init(&buf, TPM2_ST_SESSIONS, TPM2_CC_UNSEAL); in tpm2_unseal()
582 if (rc) in tpm2_unseal()
583 return rc; in tpm2_unseal()
592 rc = tpm_transmit_cmd(chip, buf.data, PAGE_SIZE, "unsealing"); in tpm2_unseal()
593 if (rc > 0) in tpm2_unseal()
594 rc = -EPERM; in tpm2_unseal()
596 if (!rc) { in tpm2_unseal()
607 return rc; in tpm2_unseal()
623 int rc; in tpm2_unseal_trusted() local
625 rc = tpm2_load(chip, payload, options, &blob_handle); in tpm2_unseal_trusted()
626 if (rc) in tpm2_unseal_trusted()
627 return rc; in tpm2_unseal_trusted()
629 rc = tpm2_unseal(chip, payload, options, blob_handle); in tpm2_unseal_trusted()
633 return rc; in tpm2_unseal_trusted()
651 int rc; in tpm2_get_tpm_pt() local
658 rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), desc); in tpm2_get_tpm_pt()
659 if (!rc) in tpm2_get_tpm_pt()
662 return rc; in tpm2_get_tpm_pt()
716 int rc; in tpm2_shutdown() local
721 rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), "stopping the TPM"); in tpm2_shutdown()
726 if (rc < 0) in tpm2_shutdown()
728 rc); in tpm2_shutdown()
781 int rc; in tpm2_start_selftest() local
787 rc = tpm_transmit_cmd(chip, &cmd, TPM2_SELF_TEST_IN_SIZE, in tpm2_start_selftest()
793 if (rc == TPM2_RC_TESTING) { in tpm2_start_selftest()
795 rc = 0; in tpm2_start_selftest()
798 return rc; in tpm2_start_selftest()
814 int rc; in tpm2_do_selftest() local
825 rc = tpm2_start_selftest(chip, true); in tpm2_do_selftest()
826 if (rc) in tpm2_do_selftest()
827 return rc; in tpm2_do_selftest()
839 rc = tpm_transmit_cmd(chip, (u8 *) &cmd, sizeof(cmd), NULL); in tpm2_do_selftest()
840 if (rc < 0) in tpm2_do_selftest()
843 rc = be32_to_cpu(cmd.header.out.return_code); in tpm2_do_selftest()
844 if (rc != TPM2_RC_TESTING) in tpm2_do_selftest()
850 return rc; in tpm2_do_selftest()
881 int rc; in tpm2_probe() local
888 rc = tpm_transmit(chip, (const char *) &cmd, sizeof(cmd)); in tpm2_probe()
889 if (rc < 0) in tpm2_probe()
890 return rc; in tpm2_probe()
891 else if (rc < TPM_HEADER_SIZE) in tpm2_probe()