Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tpm_ibmvtpm.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 IBM Corporation
3  *
4  * Author: Ashley Lai <[email protected]>
5  *
6  * Maintained by: <[email protected]>
7  *
8  * Device driver for TCG/TCPA TPM (trusted platform module).
9  * Specifications at www.trustedcomputinggroup.org
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License as
13  * published by the Free Software Foundation, version 2 of the
14  * License.
15  *
16  */
17 
18 #ifndef __TPM_IBMVTPM_H__
19 #define __TPM_IBMVTPM_H__
20 
21 /* vTPM Message Format 1 */
22 struct ibmvtpm_crq {
28 } __attribute__((packed, aligned(8)));
29 
34 };
35 
36 struct ibmvtpm_dev {
37  struct device *dev;
38  struct vio_dev *vdev;
49 };
50 
51 #define CRQ_RES_BUF_SIZE PAGE_SIZE
52 
53 /* Initialize CRQ */
54 #define INIT_CRQ_CMD 0xC001000000000000LL /* Init cmd */
55 #define INIT_CRQ_COMP_CMD 0xC002000000000000LL /* Init complete cmd */
56 #define INIT_CRQ_RES 0x01 /* Init respond */
57 #define INIT_CRQ_COMP_RES 0x02 /* Init complete respond */
58 #define VALID_INIT_CRQ 0xC0 /* Valid command for init crq */
59 
60 /* vTPM CRQ response is the message type | 0x80 */
61 #define VTPM_MSG_RES 0x80
62 #define IBMVTPM_VALID_CMD 0x80
63 
64 /* vTPM CRQ message types */
65 #define VTPM_GET_VERSION 0x01
66 #define VTPM_GET_VERSION_RES (0x01 | VTPM_MSG_RES)
67 
68 #define VTPM_TPM_COMMAND 0x02
69 #define VTPM_TPM_COMMAND_RES (0x02 | VTPM_MSG_RES)
70 
71 #define VTPM_GET_RTCE_BUFFER_SIZE 0x03
72 #define VTPM_GET_RTCE_BUFFER_SIZE_RES (0x03 | VTPM_MSG_RES)
73 
74 #define VTPM_PREPARE_TO_SUSPEND 0x04
75 #define VTPM_PREPARE_TO_SUSPEND_RES (0x04 | VTPM_MSG_RES)
76 
77 #endif