This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / xen / interface / io / pciif.h
1 /*
2  * PCI Backend/Frontend Common Data Structures & Macros
3  *
4  *   Author: Ryan Wilson <hap9@epoch.ncsc.mil>
5  */
6 #ifndef __XEN_PCI_COMMON_H__
7 #define __XEN_PCI_COMMON_H__
8
9 /* Be sure to bump this number if you change this file */
10 #define XEN_PCI_MAGIC           "7"
11
12 /* xen_pci_sharedinfo flags */
13 #define _XEN_PCIF_active     (0)
14 #define XEN_PCIF_active      (1<<_XEN_PCI_active)
15
16 /* xen_pci_op commands */
17 #define XEN_PCI_OP_conf_read    (0)
18 #define XEN_PCI_OP_conf_write   (1)
19
20 /* xen_pci_op error numbers */
21 #define XEN_PCI_ERR_success          (0)
22 #define XEN_PCI_ERR_dev_not_found   (-1)
23 #define XEN_PCI_ERR_invalid_offset  (-2)
24 #define XEN_PCI_ERR_access_denied   (-3)
25 #define XEN_PCI_ERR_not_implemented (-4)
26 /* XEN_PCI_ERR_op_failed - backend failed to complete the operation */
27 #define XEN_PCI_ERR_op_failed       (-5)
28
29 struct xen_pci_op {
30         /* IN: what action to perform: XEN_PCI_OP_* */
31         uint32_t cmd;
32
33         /* OUT: will contain an error number (if any) from errno.h */
34         int32_t err;
35
36         /* IN: which device to touch */
37         uint32_t domain; /* PCI Domain/Segment */
38         uint32_t bus;
39         uint32_t devfn;
40
41         /* IN: which configuration registers to touch */
42         int32_t offset;
43         int32_t size;
44
45         /* IN/OUT: Contains the result after a READ or the value to WRITE */
46         uint32_t value;
47 };
48
49 struct xen_pci_sharedinfo {
50         /* flags - XEN_PCIF_* */
51         uint32_t flags;
52         struct xen_pci_op op;
53 };
54
55 #endif /* __XEN_PCI_COMMON_H__ */