]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - sys/dev/tpm/tpmvar.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / sys / dev / tpm / tpmvar.h
1 /*
2  * Copyright (c) 2008, 2009 Michael Shalayeff
3  * Copyright (c) 2009, 2010 Hans-Joerg Hoexer
4  * All rights reserved.
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN
15  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
16  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  *
18  * $FreeBSD$
19  */
20
21 #ifndef _TPMVAR_H
22 #define _TPMVAR_H
23
24 struct tpm_softc {
25 #ifndef __FreeBSD__
26         struct device sc_dev;
27 #endif
28         void *sc_ih;
29
30         int     (*sc_init)(struct tpm_softc *, int, const char *);
31         int     (*sc_start)(struct tpm_softc *, int);
32         int     (*sc_read)(struct tpm_softc *, void *, int, size_t *, int);
33         int     (*sc_write)(struct tpm_softc *, void *, int);
34         int     (*sc_end)(struct tpm_softc *, int, int);
35
36         bus_space_tag_t sc_bt, sc_batm;
37         bus_space_handle_t sc_bh, sc_bahm;
38
39         u_int32_t sc_devid;
40         u_int32_t sc_rev;
41         u_int32_t sc_stat;
42         u_int32_t sc_capabilities;
43
44         int sc_flags;
45 #define TPM_OPEN        0x0001
46
47         int      sc_vector;
48 #ifdef __FreeBSD__
49         void    *intr_cookie;
50         int mem_rid, irq_rid;
51         struct resource *mem_res, *irq_res;
52         struct cdev *sc_cdev;
53 #endif
54
55 #ifndef __FreeBSD__
56         void    *sc_powerhook;
57 #endif
58         int      sc_suspend;
59 };
60
61 int tpm_tis12_probe(bus_space_tag_t iot, bus_space_handle_t ioh);
62 int tpm_attach(device_t dev);
63 int tpm_detach(device_t dev);
64 int tpm_suspend(device_t dev);
65 int tpm_resume(device_t dev);
66 #endif