Lines Matching refs:tpm_cmd

436 	struct tpm_cmd_t tpm_cmd;  in tpm_getcap()  local
440 tpm_cmd.header.in = tpm_getcap_header; in tpm_getcap()
442 tpm_cmd.params.getcap_in.cap = subcap_id; in tpm_getcap()
444 tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(0); in tpm_getcap()
445 tpm_cmd.header.in.length -= cpu_to_be32(sizeof(__be32)); in tpm_getcap()
449 tpm_cmd.params.getcap_in.cap = TPM_CAP_FLAG; in tpm_getcap()
451 tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP; in tpm_getcap()
452 tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4); in tpm_getcap()
453 tpm_cmd.params.getcap_in.subcap = subcap_id; in tpm_getcap()
455 rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, desc); in tpm_getcap()
457 *cap = tpm_cmd.params.getcap_out.cap; in tpm_getcap()
463 struct tpm_cmd_t tpm_cmd; in tpm_gen_interrupt() local
466 tpm_cmd.header.in = tpm_getcap_header; in tpm_gen_interrupt()
467 tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP; in tpm_gen_interrupt()
468 tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4); in tpm_gen_interrupt()
469 tpm_cmd.params.getcap_in.subcap = TPM_CAP_PROP_TIS_TIMEOUT; in tpm_gen_interrupt()
471 rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, in tpm_gen_interrupt()
498 struct tpm_cmd_t tpm_cmd; in tpm_get_timeouts() local
504 tpm_cmd.header.in = tpm_getcap_header; in tpm_get_timeouts()
505 tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP; in tpm_get_timeouts()
506 tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4); in tpm_get_timeouts()
507 tpm_cmd.params.getcap_in.subcap = TPM_CAP_PROP_TIS_TIMEOUT; in tpm_get_timeouts()
508 rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, NULL); in tpm_get_timeouts()
517 tpm_cmd.header.in = tpm_getcap_header; in tpm_get_timeouts()
518 tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP; in tpm_get_timeouts()
519 tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4); in tpm_get_timeouts()
520 tpm_cmd.params.getcap_in.subcap = TPM_CAP_PROP_TIS_TIMEOUT; in tpm_get_timeouts()
521 rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, in tpm_get_timeouts()
531 if (be32_to_cpu(tpm_cmd.header.out.return_code) != 0 || in tpm_get_timeouts()
532 be32_to_cpu(tpm_cmd.header.out.length) in tpm_get_timeouts()
533 != sizeof(tpm_cmd.header.out) + sizeof(u32) + 4 * sizeof(u32)) in tpm_get_timeouts()
536 old_timeout[0] = be32_to_cpu(tpm_cmd.params.getcap_out.cap.timeout.a); in tpm_get_timeouts()
537 old_timeout[1] = be32_to_cpu(tpm_cmd.params.getcap_out.cap.timeout.b); in tpm_get_timeouts()
538 old_timeout[2] = be32_to_cpu(tpm_cmd.params.getcap_out.cap.timeout.c); in tpm_get_timeouts()
539 old_timeout[3] = be32_to_cpu(tpm_cmd.params.getcap_out.cap.timeout.d); in tpm_get_timeouts()
578 tpm_cmd.header.in = tpm_getcap_header; in tpm_get_timeouts()
579 tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP; in tpm_get_timeouts()
580 tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4); in tpm_get_timeouts()
581 tpm_cmd.params.getcap_in.subcap = TPM_CAP_PROP_TIS_DURATION; in tpm_get_timeouts()
583 rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, in tpm_get_timeouts()
588 if (be32_to_cpu(tpm_cmd.header.out.return_code) != 0 || in tpm_get_timeouts()
589 be32_to_cpu(tpm_cmd.header.out.length) in tpm_get_timeouts()
590 != sizeof(tpm_cmd.header.out) + sizeof(u32) + 3 * sizeof(u32)) in tpm_get_timeouts()
593 duration_cap = &tpm_cmd.params.getcap_out.cap.duration; in tpm_get_timeouts()
1007 struct tpm_cmd_t tpm_cmd; in tpm_get_random() local
1026 tpm_cmd.header.in = tpm_getrandom_header; in tpm_get_random()
1027 tpm_cmd.params.getrandom_in.num_bytes = cpu_to_be32(num_bytes); in tpm_get_random()
1029 err = tpm_transmit_cmd(chip, &tpm_cmd, in tpm_get_random()
1035 recd = be32_to_cpu(tpm_cmd.params.getrandom_out.rng_data_len); in tpm_get_random()
1036 memcpy(dest, tpm_cmd.params.getrandom_out.rng_data, recd); in tpm_get_random()