Lines Matching refs:tpm
38 struct tpm_swtpm *tpm; in tpm_swtpm_init() local
42 tpm = calloc(1, sizeof (struct tpm_swtpm)); in tpm_swtpm_init()
43 if (tpm == NULL) { in tpm_swtpm_init()
54 tpm->fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); in tpm_swtpm_init()
55 if (tpm->fd < 0) { in tpm_swtpm_init()
64 if (connect(tpm->fd, (struct sockaddr *)&tpm_addr, sizeof (tpm_addr)) == in tpm_swtpm_init()
71 *sc = tpm; in tpm_swtpm_init()
80 struct tpm_swtpm *tpm; in tpm_swtpm_execute_cmd() local
88 tpm = sc; in tpm_swtpm_execute_cmd()
90 len = send(tpm->fd, cmd, cmd_size, MSG_NOSIGNAL|MSG_DONTWAIT); in tpm_swtpm_execute_cmd()
99 len = recv(tpm->fd, rsp, rsp_size, 0); in tpm_swtpm_execute_cmd()
114 struct tpm_swtpm *tpm; in tpm_swtpm_deinit() local
116 tpm = sc; in tpm_swtpm_deinit()
117 if (tpm == NULL) in tpm_swtpm_deinit()
120 if (tpm->fd >= 0) in tpm_swtpm_deinit()
121 close(tpm->fd); in tpm_swtpm_deinit()
123 free(tpm); in tpm_swtpm_deinit()