4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 /* Duration index is SHORT, MEDIUM, LONG, UNDEFINED */
31 #define TPM_DURATION_MAX_IDX 3
34 * IO buffer size: this seems sufficient, but feel free to modify
35 * This should be at minimum 765
37 #define TPM_IO_BUF_SIZE 4096
39 #define TPM_IO_TIMEOUT 10000000
42 * Flags to keep track of for the allocated resources
43 * so we know what to deallocate later on
45 enum tpm_ddi_resources_flags
{
48 TPM_DIDREGSMAP
= 0x004,
49 TPM_DIDINTMUTEX
= 0x008,
51 TPM_DID_IO_ALLOC
= 0x100,
52 TPM_DID_IO_MUTEX
= 0x200,
53 TPM_DID_IO_CV
= 0x400,
54 TPM_DID_MUTEX
= 0x800,
55 TPM_DID_SOFT_STATE
= 0x1000,
57 TPM_HSVC_REGISTERED
= 0x2000
61 typedef struct tpm_state tpm_state_t
;
63 /* TPM specific data structure */
66 TPM_CAP_VERSION_INFO vers_info
;
71 ddi_acc_handle_t handle
;
86 * For supporting the interrupt
89 ddi_intr_handle_t
*h_array
;
93 uint8_t *addr
; /* where TPM is mapped to */
94 char locality
; /* keep track of the locality */
96 uint32_t flags
; /* flags to keep track of what is allocated */
97 clock_t duration
[4]; /* short,medium,long,undefined */
102 clock_t timeout_poll
;
104 ddi_device_acc_attr_t accattr
;
106 /* For power management. */
108 kcondvar_t suspend_cv
;
111 #ifdef KCF_TPM_RNG_PROVIDER
113 crypto_kcf_provider_handle_t n_prov
;
117 #endif /* _TPM_DDI_H */