Lines Matching refs:tpm
34 struct tpm_passthru *tpm; in tpm_passthru_init() local
37 tpm = calloc(1, sizeof(struct tpm_passthru)); in tpm_passthru_init()
38 if (tpm == NULL) { in tpm_passthru_init()
44 tpm->fd = open(path, O_RDWR); in tpm_passthru_init()
45 if (tpm->fd < 0) { in tpm_passthru_init()
50 *sc = tpm; in tpm_passthru_init()
59 struct tpm_passthru *tpm; in tpm_passthru_execute_cmd() local
67 tpm = sc; in tpm_passthru_execute_cmd()
69 len = write(tpm->fd, cmd, cmd_size); in tpm_passthru_execute_cmd()
76 len = read(tpm->fd, rsp, rsp_size); in tpm_passthru_execute_cmd()
89 struct tpm_passthru *tpm; in tpm_passthru_deinit() local
91 tpm = sc; in tpm_passthru_deinit()
92 if (tpm == NULL) in tpm_passthru_deinit()
95 if (tpm->fd >= 0) in tpm_passthru_deinit()
96 close(tpm->fd); in tpm_passthru_deinit()
98 free(tpm); in tpm_passthru_deinit()