1181624Skmacy/******************************************************************************
2181624Skmacy * tpmif.h
3181624Skmacy *
4181624Skmacy * TPM I/O interface for Xen guest OSes.
5181624Skmacy *
6181624Skmacy * Permission is hereby granted, free of charge, to any person obtaining a copy
7181624Skmacy * of this software and associated documentation files (the "Software"), to
8181624Skmacy * deal in the Software without restriction, including without limitation the
9181624Skmacy * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10181624Skmacy * sell copies of the Software, and to permit persons to whom the Software is
11181624Skmacy * furnished to do so, subject to the following conditions:
12181624Skmacy *
13181624Skmacy * The above copyright notice and this permission notice shall be included in
14181624Skmacy * all copies or substantial portions of the Software.
15181624Skmacy *
16181624Skmacy * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17181624Skmacy * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18181624Skmacy * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19181624Skmacy * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20181624Skmacy * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21181624Skmacy * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22181624Skmacy * DEALINGS IN THE SOFTWARE.
23181624Skmacy *
24181624Skmacy * Copyright (c) 2005, IBM Corporation
25181624Skmacy *
26181624Skmacy * Author: Stefan Berger, stefanb@us.ibm.com
27181624Skmacy * Grant table support: Mahadevan Gomathisankaran
28181624Skmacy *
29181624Skmacy * This code has been derived from tools/libxc/xen/io/netif.h
30181624Skmacy *
31181624Skmacy * Copyright (c) 2003-2004, Keir Fraser
32181624Skmacy */
33181624Skmacy
34181624Skmacy#ifndef __XEN_PUBLIC_IO_TPMIF_H__
35181624Skmacy#define __XEN_PUBLIC_IO_TPMIF_H__
36181624Skmacy
37181624Skmacy#include "../grant_table.h"
38181624Skmacy
39181624Skmacystruct tpmif_tx_request {
40181624Skmacy    unsigned long addr;   /* Machine address of packet.   */
41181624Skmacy    grant_ref_t ref;      /* grant table access reference */
42181624Skmacy    uint16_t unused;
43181624Skmacy    uint16_t size;        /* Packet size in bytes.        */
44181624Skmacy};
45181624Skmacytypedef struct tpmif_tx_request tpmif_tx_request_t;
46181624Skmacy
47181624Skmacy/*
48181624Skmacy * The TPMIF_TX_RING_SIZE defines the number of pages the
49181624Skmacy * front-end and backend can exchange (= size of array).
50181624Skmacy */
51181624Skmacytypedef uint32_t TPMIF_RING_IDX;
52181624Skmacy
53181624Skmacy#define TPMIF_TX_RING_SIZE 1
54181624Skmacy
55181624Skmacy/* This structure must fit in a memory page. */
56181624Skmacy
57181624Skmacystruct tpmif_ring {
58181624Skmacy    struct tpmif_tx_request req;
59181624Skmacy};
60181624Skmacytypedef struct tpmif_ring tpmif_ring_t;
61181624Skmacy
62181624Skmacystruct tpmif_tx_interface {
63181624Skmacy    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
64181624Skmacy};
65181624Skmacytypedef struct tpmif_tx_interface tpmif_tx_interface_t;
66181624Skmacy
67181624Skmacy#endif
68181624Skmacy
69181624Skmacy/*
70181624Skmacy * Local variables:
71181624Skmacy * mode: C
72181624Skmacy * c-set-style: "BSD"
73181624Skmacy * c-basic-offset: 4
74181624Skmacy * tab-width: 4
75181624Skmacy * indent-tabs-mode: nil
76181624Skmacy * End:
77181624Skmacy */
78