1 /*
2  * pir_types.h - data structure definitions for Xen HVM $PIR support
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; If not, see <http://www.gnu.org/licenses/>.
16  *
17  * Copyright (C) Citrix Systems, 2011
18  *
19  * See the PCI Interrupt Routing spec for more detail:
20  *   http://www.microsoft.com/taiwan/whdc/archive/pciirq.mspx
21  */
22 
23 #ifndef PIR_TYPES_H
24 #define PIR_TYPES_H
25 
26 #include <stdint.h>
27 
28 #define NR_PIR_SLOTS 6
29 
30 struct pir_slot {
31     uint8_t bus;
32     uint8_t dev;
33     uint8_t link_a;
34     uint16_t bitmap_a;
35     uint8_t link_b;
36     uint16_t bitmap_b;
37     uint8_t link_c;
38     uint16_t bitmap_c;
39     uint8_t link_d;
40     uint16_t bitmap_d;
41     uint8_t slot;
42     uint8_t reserved;
43 } __attribute__ ((packed));
44 
45 struct pir_table {
46     char signature[4];
47     uint16_t version;
48     uint16_t length;
49     uint8_t router_bus;
50     uint8_t router_devfn;
51     uint16_t pci_irqs;
52     uint16_t router_vid;
53     uint16_t router_did;
54     uint32_t miniport_data;
55     uint8_t reserved[11];
56     uint8_t checksum;
57     struct pir_slot slots[0];
58 } __attribute__ ((packed));
59 
60 #endif
61 
62 /*
63  * Local variables:
64  * mode: C
65  * c-file-style: "BSD"
66  * c-basic-offset: 4
67  * tab-width: 4
68  * indent-tabs-mode: nil
69  * End:
70  */
71