diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-05-30 02:59:32 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2015-01-21 00:58:54 -0500 |
commit | 89461c4a12faa643fd7564037440d626b777b033 (patch) | |
tree | a55669d93922f0e31d9f6ee397b6cdaef11e688e /include/uapi | |
parent | 1fcf0512c9c870e78e1c9898ecb9458593403466 (diff) |
virtio_pci: macros for PCI layout offsets
QEMU wants it, so why not? Trust, but verify.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/uapi')
-rw-r--r-- | include/uapi/linux/virtio_pci.h | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h index a2b2e1353e30..3b7e4d2765fb 100644 --- a/include/uapi/linux/virtio_pci.h +++ b/include/uapi/linux/virtio_pci.h | |||
@@ -124,11 +124,6 @@ struct virtio_pci_cap { | |||
124 | __le32 length; /* Length of the structure, in bytes. */ | 124 | __le32 length; /* Length of the structure, in bytes. */ |
125 | }; | 125 | }; |
126 | 126 | ||
127 | #define VIRTIO_PCI_CAP_BAR_SHIFT 5 | ||
128 | #define VIRTIO_PCI_CAP_BAR_MASK 0x7 | ||
129 | #define VIRTIO_PCI_CAP_TYPE_SHIFT 0 | ||
130 | #define VIRTIO_PCI_CAP_TYPE_MASK 0x7 | ||
131 | |||
132 | struct virtio_pci_notify_cap { | 127 | struct virtio_pci_notify_cap { |
133 | struct virtio_pci_cap cap; | 128 | struct virtio_pci_cap cap; |
134 | __le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */ | 129 | __le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */ |
@@ -160,6 +155,37 @@ struct virtio_pci_common_cfg { | |||
160 | __le32 queue_used_hi; /* read-write */ | 155 | __le32 queue_used_hi; /* read-write */ |
161 | }; | 156 | }; |
162 | 157 | ||
158 | /* Macro versions of offsets for the Old Timers! */ | ||
159 | #define VIRTIO_PCI_CAP_VNDR 0 | ||
160 | #define VIRTIO_PCI_CAP_NEXT 1 | ||
161 | #define VIRTIO_PCI_CAP_LEN 2 | ||
162 | #define VIRTIO_PCI_CAP_CFG_TYPE 3 | ||
163 | #define VIRTIO_PCI_CAP_BAR 4 | ||
164 | #define VIRTIO_PCI_CAP_OFFSET 8 | ||
165 | #define VIRTIO_PCI_CAP_LENGTH 12 | ||
166 | |||
167 | #define VIRTIO_PCI_NOTIFY_CAP_MULT 16 | ||
168 | |||
169 | #define VIRTIO_PCI_COMMON_DFSELECT 0 | ||
170 | #define VIRTIO_PCI_COMMON_DF 4 | ||
171 | #define VIRTIO_PCI_COMMON_GFSELECT 8 | ||
172 | #define VIRTIO_PCI_COMMON_GF 12 | ||
173 | #define VIRTIO_PCI_COMMON_MSIX 16 | ||
174 | #define VIRTIO_PCI_COMMON_NUMQ 18 | ||
175 | #define VIRTIO_PCI_COMMON_STATUS 20 | ||
176 | #define VIRTIO_PCI_COMMON_CFGGENERATION 21 | ||
177 | #define VIRTIO_PCI_COMMON_Q_SELECT 22 | ||
178 | #define VIRTIO_PCI_COMMON_Q_SIZE 24 | ||
179 | #define VIRTIO_PCI_COMMON_Q_MSIX 26 | ||
180 | #define VIRTIO_PCI_COMMON_Q_ENABLE 28 | ||
181 | #define VIRTIO_PCI_COMMON_Q_NOFF 30 | ||
182 | #define VIRTIO_PCI_COMMON_Q_DESCLO 32 | ||
183 | #define VIRTIO_PCI_COMMON_Q_DESCHI 36 | ||
184 | #define VIRTIO_PCI_COMMON_Q_AVAILLO 40 | ||
185 | #define VIRTIO_PCI_COMMON_Q_AVAILHI 44 | ||
186 | #define VIRTIO_PCI_COMMON_Q_USEDLO 48 | ||
187 | #define VIRTIO_PCI_COMMON_Q_USEDHI 52 | ||
188 | |||
163 | #endif /* VIRTIO_PCI_NO_MODERN */ | 189 | #endif /* VIRTIO_PCI_NO_MODERN */ |
164 | 190 | ||
165 | #endif | 191 | #endif |