tpmif.h revision 296373
179845Salfred/******************************************************************************
279845Salfred * tpmif.h
379845Salfred *
479845Salfred * TPM I/O interface for Xen guest OSes.
579845Salfred *
679845Salfred * Permission is hereby granted, free of charge, to any person obtaining a copy
779845Salfred * of this software and associated documentation files (the "Software"), to
879845Salfred * deal in the Software without restriction, including without limitation the
979845Salfred * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
1079845Salfred * sell copies of the Software, and to permit persons to whom the Software is
1179845Salfred * furnished to do so, subject to the following conditions:
1279845Salfred *
1379845Salfred * The above copyright notice and this permission notice shall be included in
1479845Salfred * all copies or substantial portions of the Software.
1579845Salfred *
1679845Salfred * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1779845Salfred * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1879845Salfred * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1979845Salfred * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2079845Salfred * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2179845Salfred * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2279845Salfred * DEALINGS IN THE SOFTWARE.
2379845Salfred *
2479845Salfred * Copyright (c) 2005, IBM Corporation
2579845Salfred *
2679845Salfred * Author: Stefan Berger, stefanb@us.ibm.com
2779845Salfred * Grant table support: Mahadevan Gomathisankaran
2879845Salfred *
2979845Salfred * This code has been derived from tools/libxc/xen/io/netif.h
3079845Salfred *
3179845Salfred * Copyright (c) 2003-2004, Keir Fraser
3279845Salfred */
3379845Salfred
3479845Salfred#ifndef __XEN_PUBLIC_IO_TPMIF_H__
3579845Salfred#define __XEN_PUBLIC_IO_TPMIF_H__
3679845Salfred
3779845Salfred#include "../grant_table.h"
3879845Salfred
3979845Salfredstruct tpmif_tx_request {
4079845Salfred    unsigned long addr;   /* Machine address of packet.   */
4179845Salfred    grant_ref_t ref;      /* grant table access reference */
4279845Salfred    uint16_t unused;
4379845Salfred    uint16_t size;        /* Packet size in bytes.        */
4479845Salfred};
4579845Salfredtypedef struct tpmif_tx_request tpmif_tx_request_t;
4679845Salfred
4779845Salfred/*
4879845Salfred * The TPMIF_TX_RING_SIZE defines the number of pages the
4979845Salfred * front-end and backend can exchange (= size of array).
5079845Salfred */
5180679Salfredtypedef uint32_t TPMIF_RING_IDX;
5280679Salfred
5380679Salfred#define TPMIF_TX_RING_SIZE 1
5480679Salfred
5580679Salfred/* This structure must fit in a memory page. */
5680679Salfred
5780679Salfredstruct tpmif_ring {
5880679Salfred    struct tpmif_tx_request req;
5979845Salfred};
6079845Salfredtypedef struct tpmif_ring tpmif_ring_t;
6179845Salfred
6279845Salfredstruct tpmif_tx_interface {
6379845Salfred    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
6479845Salfred};
6579845Salfredtypedef struct tpmif_tx_interface tpmif_tx_interface_t;
6679845Salfred
67119964Sru#endif
6879845Salfred
6979845Salfred/*
7079845Salfred * Local variables:
7179845Salfred * mode: C
7279845Salfred * c-set-style: "BSD"
7379845Salfred * c-basic-offset: 4
7479845Salfred * tab-width: 4
7579845Salfred * indent-tabs-mode: nil
7679845Salfred * End:
7779845Salfred */
7879845Salfred