Lines Matching refs:tbuf
71 struct tpm_buf tbuf; in tpm2_load_context() local
76 rc = tpm_buf_init(&tbuf, TPM2_ST_NO_SESSIONS, TPM2_CC_CONTEXT_LOAD); in tpm2_load_context()
82 tpm_buf_append(&tbuf, &buf[*offset], body_size); in tpm2_load_context()
84 rc = tpm_transmit_cmd(chip, &tbuf, 4, NULL); in tpm2_load_context()
88 tpm_buf_destroy(&tbuf); in tpm2_load_context()
103 tpm_buf_destroy(&tbuf); in tpm2_load_context()
108 tpm_buf_destroy(&tbuf); in tpm2_load_context()
112 *handle = be32_to_cpup((__be32 *)&tbuf.data[TPM_HEADER_SIZE]); in tpm2_load_context()
115 tpm_buf_destroy(&tbuf); in tpm2_load_context()
122 struct tpm_buf tbuf; in tpm2_save_context() local
126 rc = tpm_buf_init(&tbuf, TPM2_ST_NO_SESSIONS, TPM2_CC_CONTEXT_SAVE); in tpm2_save_context()
130 tpm_buf_append_u32(&tbuf, handle); in tpm2_save_context()
132 rc = tpm_transmit_cmd(chip, &tbuf, 0, NULL); in tpm2_save_context()
136 tpm_buf_destroy(&tbuf); in tpm2_save_context()
139 tpm_buf_destroy(&tbuf); in tpm2_save_context()
144 tpm_buf_destroy(&tbuf); in tpm2_save_context()
148 body_size = tpm_buf_length(&tbuf) - TPM_HEADER_SIZE; in tpm2_save_context()
151 tpm_buf_destroy(&tbuf); in tpm2_save_context()
155 memcpy(&buf[*offset], &tbuf.data[TPM_HEADER_SIZE], body_size); in tpm2_save_context()
157 tpm_buf_destroy(&tbuf); in tpm2_save_context()