Lines Matching refs:tbuf
74 struct tpm_buf tbuf; in tpm2_load_context() local
79 rc = tpm_buf_init(&tbuf, TPM2_ST_NO_SESSIONS, TPM2_CC_CONTEXT_LOAD); in tpm2_load_context()
85 tpm_buf_append(&tbuf, &buf[*offset], body_size); in tpm2_load_context()
87 rc = tpm_transmit_cmd(chip, &tbuf, 4, NULL); in tpm2_load_context()
91 tpm_buf_destroy(&tbuf); in tpm2_load_context()
106 tpm_buf_destroy(&tbuf); in tpm2_load_context()
111 tpm_buf_destroy(&tbuf); in tpm2_load_context()
115 *handle = be32_to_cpup((__be32 *)&tbuf.data[TPM_HEADER_SIZE]); in tpm2_load_context()
118 tpm_buf_destroy(&tbuf); in tpm2_load_context()
125 struct tpm_buf tbuf; in tpm2_save_context() local
129 rc = tpm_buf_init(&tbuf, TPM2_ST_NO_SESSIONS, TPM2_CC_CONTEXT_SAVE); in tpm2_save_context()
133 tpm_buf_append_u32(&tbuf, handle); in tpm2_save_context()
135 rc = tpm_transmit_cmd(chip, &tbuf, 0, NULL); in tpm2_save_context()
139 tpm_buf_destroy(&tbuf); in tpm2_save_context()
142 tpm_buf_destroy(&tbuf); in tpm2_save_context()
147 tpm_buf_destroy(&tbuf); in tpm2_save_context()
151 body_size = tpm_buf_length(&tbuf) - TPM_HEADER_SIZE; in tpm2_save_context()
154 tpm_buf_destroy(&tbuf); in tpm2_save_context()
158 memcpy(&buf[*offset], &tbuf.data[TPM_HEADER_SIZE], body_size); in tpm2_save_context()
160 tpm_buf_destroy(&tbuf); in tpm2_save_context()