source: trunk/packages/xen-3.1/xen-3.1/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.h @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 1.4 KB
Line 
1#ifndef TPM_VTPM_H
2#define TPM_VTPM_H
3
4struct tpm_chip;
5struct tpm_private;
6
7struct vtpm_state {
8        struct transmission *current_request;
9        spinlock_t           req_list_lock;
10        wait_queue_head_t    req_wait_queue;
11
12        struct list_head     queued_requests;
13
14        struct transmission *current_response;
15        spinlock_t           resp_list_lock;
16        wait_queue_head_t    resp_wait_queue;     // processes waiting for responses
17
18        u8                   vd_status;
19        u8                   flags;
20
21        unsigned long        disconnect_time;
22
23        /*
24         * The following is a private structure of the underlying
25         * driver. It is passed as parameter in the send function.
26         */
27        struct tpm_private *tpm_private;
28};
29
30
31enum vdev_status {
32        TPM_VD_STATUS_DISCONNECTED = 0x0,
33        TPM_VD_STATUS_CONNECTED = 0x1
34};
35
36/* this function is called from tpm_vtpm.c */
37int vtpm_vd_send(struct tpm_private * tp,
38                 const u8 * buf, size_t count, void *ptr);
39
40/* these functions are offered by tpm_vtpm.c */
41struct tpm_chip *init_vtpm(struct device *,
42                           struct tpm_private *);
43void cleanup_vtpm(struct device *);
44int vtpm_vd_recv(const struct tpm_chip* chip,
45                 const unsigned char *buffer, size_t count, void *ptr);
46void vtpm_vd_status(const struct tpm_chip *, u8 status);
47
48static inline struct tpm_private *tpm_private_from_dev(struct device *dev)
49{
50        struct tpm_chip *chip = dev_get_drvdata(dev);
51        struct vtpm_state *vtpms = chip_get_private(chip);
52        return vtpms->tpm_private;
53}
54
55#endif
Note: See TracBrowser for help on using the repository browser.