~ubuntu-branches/ubuntu/precise/trousers/precise-proposed

« back to all changes in this revision

Viewing changes to src/include/tss/tddli.h

  • Committer: Bazaar Package Importer
  • Author(s): William Lima
  • Date: 2007-04-18 16:39:38 UTC
  • Revision ID: james.westby@ubuntu.com-20070418163938-opscl2mvvi76jiec
Tags: upstream-0.2.9.1
ImportĀ upstreamĀ versionĀ 0.2.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*++
 
2
 
 
3
  TPM Device Driver Library interface
 
4
 
 
5
  --*/
 
6
 
 
7
#ifndef __TDDLI_H__
 
8
#define __TDDLI_H__
 
9
 
 
10
#ifdef _WINDOWS_
 
11
 
 
12
// --- This should be used on Windows platforms
 
13
#ifdef TDDLI_EXPORTS
 
14
#define TDDLI __declspec(dllexport)
 
15
#else
 
16
#define TDDLI __declspec(dllimport)
 
17
#endif
 
18
#else
 
19
#define TDDLI
 
20
#endif
 
21
 
 
22
 
 
23
// Errata: Change spec from TCPA_CAP_PROP_MANUFACTURER to TPM_CAP_PROP_MANUFACTURER
 
24
#define TDDL_CAP_VERSION   0x0100
 
25
#define TDDL_CAP_VER_DRV   0x0101
 
26
#define TDDL_CAP_VER_FW    0x0102
 
27
#define TDDL_CAP_VER_FW_DATE   0x0103
 
28
 
 
29
#define TDDL_CAP_PROPERTY   0x0200
 
30
#define TDDL_CAP_PROP_MANUFACTURER  0x0201
 
31
#define TDDL_CAP_PROP_MODULE_TYPE  0x0202
 
32
#define TDDL_CAP_PROP_GLOBAL_STATE  0x0203
 
33
 
 
34
//--------------------------------------------------------------------
 
35
// TDDL specific helper redefinitions
 
36
 
 
37
#ifdef __cplusplus
 
38
extern "C" {
 
39
 
 
40
        //establish a connection to the TPM device driver
 
41
        TDDLI TSS_RESULT Tddli_Open();
 
42
 
 
43
        //close a open connection to the TPM device driver
 
44
        TDDLI TSS_RESULT Tddli_Close();
 
45
 
 
46
        //cancels the last outstanding TPM command
 
47
        TDDLI TSS_RESULT Tddli_Cancel();
 
48
 
 
49
        // read the attributes returned by the TPM HW/FW
 
50
        TDDLI TSS_RESULT Tddli_GetCapability(
 
51
                        UINT32        CapArea,
 
52
                        UINT32        SubCap,
 
53
                        BYTE*         pCapBuf,
 
54
                        UINT32*       puntCapBufLen
 
55
                        );
 
56
 
 
57
        // set parameters to the TPM HW/FW
 
58
        TDDLI TSS_RESULT Tddli_SetCapability(
 
59
                        UINT32        CapArea,
 
60
                        UINT32        SubCap,
 
61
                        BYTE*         pCapBuf,
 
62
                        UINT32       puntCapBufLen
 
63
                        );
 
64
 
 
65
        // get status of the TPM driver and device
 
66
        TDDLI TSS_RESULT Tddli_GetStatus(
 
67
                        UINT32        ReqStatusType,
 
68
                        UINT32*       puntStatus
 
69
                        );
 
70
 
 
71
        // send any data to the TPM module
 
72
        TDDLI TSS_RESULT Tddli_TransmitData(
 
73
                        BYTE*         pTransmitBuf,
 
74
                        UINT32        TransmitBufLen,
 
75
                        BYTE*         pReceiveBuf,
 
76
                        UINT32*       puntReceiveBufLen
 
77
                        );
 
78
}
 
79
#else
 
80
 
 
81
//establish a connection to the TPM device driver
 
82
extern TDDLI TSS_RESULT Tddli_Open();
 
83
 
 
84
//close a open connection to the TPM device driver
 
85
extern TDDLI TSS_RESULT Tddli_Close();
 
86
 
 
87
//cancels the last outstanding TPM command
 
88
extern TDDLI TSS_RESULT Tddli_Cancel();
 
89
 
 
90
// read the attributes returned by the TPM HW/FW
 
91
extern TDDLI TSS_RESULT Tddli_GetCapability(
 
92
                UINT32       CapArea,
 
93
                UINT32       SubCap,
 
94
                BYTE*        pCapBuf,
 
95
                UINT32*      puntCapBufLen
 
96
                );
 
97
 
 
98
// set parameters to the TPM HW/FW
 
99
extern TDDLI TSS_RESULT Tddli_SetCapability(
 
100
                UINT32       CapArea,
 
101
                UINT32       SubCap,
 
102
                BYTE*        pCapBuf,
 
103
                UINT32      puntCapBufLen
 
104
                );
 
105
 
 
106
// get status of the TPM driver and device
 
107
extern TDDLI TSS_RESULT Tddli_GetStatus(
 
108
                UINT32       ReqStatusType,
 
109
                UINT32*      puntStatus
 
110
                );
 
111
 
 
112
// send any data to the TPM module
 
113
extern TDDLI TSS_RESULT Tddli_TransmitData(
 
114
                BYTE*        pTransmitBuf,
 
115
                UINT32       TransmitBufLen,
 
116
                BYTE*        pReceiveBuf,
 
117
                UINT32*      puntReceiveBufLen
 
118
                );
 
119
#endif
 
120
 
 
121
#endif // __TDDLI_H__
 
122