2 * Copyright 2013 Google Inc.
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
18 #ifndef __DRIVERS_TPM_TPM_H__
19 #define __DRIVERS_TPM_TPM_H__
25 TpmCmdCountOffset = 2,
26 TpmCmdOrdinalOffset = 6,
32 int (*xmit)(struct TpmOps *me, const uint8_t *sendbuf, size_t send_size,
33 uint8_t *recvbuf, size_t *recv_len);
36 void tpm_set_ops(TpmOps *ops);
41 * Send the requested data to the TPM and then try to get its response
43 * @sendbuf - buffer of the data to send
44 * @send_size size of the data to send
45 * @recvbuf - memory to save the response to
46 * @recv_len - pointer to the size of the response buffer, set to the number
47 * of received bytes on completion
49 * Returns 0 on success or -1 on failure.
51 int tpm_xmit(const uint8_t *sendbuf, size_t send_size,
52 uint8_t *recvbuf, size_t *recv_len);
54 #endif /* __DRIVERS_TPM_TPM_H__ */