blob: f1072aa21defc4480307e458c3c802afb417104f [file] [log] [blame]
Nick Kralevicha67e4de2013-01-14 11:28:26 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
Ben Cheng655a7c02013-10-16 16:09:24 -070019#ifndef _LINUX_VIRTIO_PCI_H
20#define _LINUX_VIRTIO_PCI_H
Christopher Ferris05d08e92016-02-04 13:16:38 -080021#include <linux/types.h>
22#ifndef VIRTIO_PCI_NO_LEGACY
Nick Kralevicha67e4de2013-01-14 11:28:26 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080024#define VIRTIO_PCI_HOST_FEATURES 0
Ben Cheng655a7c02013-10-16 16:09:24 -070025#define VIRTIO_PCI_GUEST_FEATURES 4
26#define VIRTIO_PCI_QUEUE_PFN 8
27#define VIRTIO_PCI_QUEUE_NUM 12
Nick Kralevicha67e4de2013-01-14 11:28:26 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080029#define VIRTIO_PCI_QUEUE_SEL 14
Ben Cheng655a7c02013-10-16 16:09:24 -070030#define VIRTIO_PCI_QUEUE_NOTIFY 16
31#define VIRTIO_PCI_STATUS 18
32#define VIRTIO_PCI_ISR 19
Nick Kralevicha67e4de2013-01-14 11:28:26 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070034#define VIRTIO_MSI_CONFIG_VECTOR 20
35#define VIRTIO_MSI_QUEUE_VECTOR 22
Christopher Ferris38062f92014-07-09 15:33:25 -070036#define VIRTIO_PCI_CONFIG_OFF(msix_enabled) ((msix_enabled) ? 24 : 20)
Christopher Ferris38062f92014-07-09 15:33:25 -070037#define VIRTIO_PCI_CONFIG(dev) VIRTIO_PCI_CONFIG_OFF((dev)->msix_enabled)
Christopher Ferris05d08e92016-02-04 13:16:38 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define VIRTIO_PCI_ABI_VERSION 0
40#define VIRTIO_PCI_QUEUE_ADDR_SHIFT 12
41#define VIRTIO_PCI_VRING_ALIGN 4096
Christopher Ferris38062f92014-07-09 15:33:25 -070042#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define VIRTIO_PCI_ISR_CONFIG 0x2
45#define VIRTIO_MSI_NO_VECTOR 0xffff
46#ifndef VIRTIO_PCI_NO_MODERN
47#define VIRTIO_PCI_CAP_COMMON_CFG 1
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define VIRTIO_PCI_CAP_NOTIFY_CFG 2
50#define VIRTIO_PCI_CAP_ISR_CFG 3
51#define VIRTIO_PCI_CAP_DEVICE_CFG 4
52#define VIRTIO_PCI_CAP_PCI_CFG 5
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54struct virtio_pci_cap {
55 __u8 cap_vndr;
56 __u8 cap_next;
57 __u8 cap_len;
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 __u8 cfg_type;
60 __u8 bar;
61 __u8 padding[3];
62 __le32 offset;
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64 __le32 length;
65};
66struct virtio_pci_notify_cap {
67 struct virtio_pci_cap cap;
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 __le32 notify_off_multiplier;
70};
71struct virtio_pci_common_cfg {
72 __le32 device_feature_select;
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 __le32 device_feature;
75 __le32 guest_feature_select;
76 __le32 guest_feature;
77 __le16 msix_config;
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 __le16 num_queues;
80 __u8 device_status;
81 __u8 config_generation;
82 __le16 queue_select;
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 __le16 queue_size;
85 __le16 queue_msix_vector;
86 __le16 queue_enable;
87 __le16 queue_notify_off;
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 __le32 queue_desc_lo;
90 __le32 queue_desc_hi;
91 __le32 queue_avail_lo;
92 __le32 queue_avail_hi;
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 __le32 queue_used_lo;
95 __le32 queue_used_hi;
96};
97struct virtio_pci_cfg_cap {
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 struct virtio_pci_cap cap;
100 __u8 pci_cfg_data[4];
101};
102#define VIRTIO_PCI_CAP_VNDR 0
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104#define VIRTIO_PCI_CAP_NEXT 1
105#define VIRTIO_PCI_CAP_LEN 2
106#define VIRTIO_PCI_CAP_CFG_TYPE 3
107#define VIRTIO_PCI_CAP_BAR 4
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109#define VIRTIO_PCI_CAP_OFFSET 8
110#define VIRTIO_PCI_CAP_LENGTH 12
111#define VIRTIO_PCI_NOTIFY_CAP_MULT 16
112#define VIRTIO_PCI_COMMON_DFSELECT 0
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114#define VIRTIO_PCI_COMMON_DF 4
115#define VIRTIO_PCI_COMMON_GFSELECT 8
116#define VIRTIO_PCI_COMMON_GF 12
117#define VIRTIO_PCI_COMMON_MSIX 16
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119#define VIRTIO_PCI_COMMON_NUMQ 18
120#define VIRTIO_PCI_COMMON_STATUS 20
121#define VIRTIO_PCI_COMMON_CFGGENERATION 21
122#define VIRTIO_PCI_COMMON_Q_SELECT 22
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124#define VIRTIO_PCI_COMMON_Q_SIZE 24
125#define VIRTIO_PCI_COMMON_Q_MSIX 26
126#define VIRTIO_PCI_COMMON_Q_ENABLE 28
127#define VIRTIO_PCI_COMMON_Q_NOFF 30
128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129#define VIRTIO_PCI_COMMON_Q_DESCLO 32
130#define VIRTIO_PCI_COMMON_Q_DESCHI 36
131#define VIRTIO_PCI_COMMON_Q_AVAILLO 40
132#define VIRTIO_PCI_COMMON_Q_AVAILHI 44
133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134#define VIRTIO_PCI_COMMON_Q_USEDLO 48
135#define VIRTIO_PCI_COMMON_Q_USEDHI 52
136#endif
137#endif
138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */