aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio_pci_legacy.h
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-07-16 12:55:42 +0000
committerBenoƮt Ganne <bganne@cisco.com>2020-08-20 09:33:23 +0000
commita0a68339b783c1663776225c264b309506934722 (patch)
tree0517cc802ecb63e90f5a2878bcea89edf53ac4c1 /src/vnet/devices/virtio/virtio_pci_legacy.h
parent224735bf090cde43827499405f663f859f82e161 (diff)
virtio: refactor pci device code
Type: refactor Change-Id: I7342178f9ab9adb99b91a4f984bc22bef2ce8021 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/virtio_pci_legacy.h')
-rw-r--r--src/vnet/devices/virtio/virtio_pci_legacy.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/virtio_pci_legacy.h b/src/vnet/devices/virtio/virtio_pci_legacy.h
new file mode 100644
index 00000000000..0db04c1966a
--- /dev/null
+++ b/src/vnet/devices/virtio/virtio_pci_legacy.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __included_virtio_pci_legacy_h__
+#define __included_virtio_pci_legacy_h__
+
+/*
+ * VirtIO Header, located in BAR 0.
+ */
+#define VIRTIO_PCI_HOST_FEATURES 0 /* host's supported features (32bit, RO) */
+#define VIRTIO_PCI_GUEST_FEATURES 4 /* guest's supported features (32, RW) */
+#define VIRTIO_PCI_QUEUE_PFN 8 /* physical address of VQ (32, RW) */
+#define VIRTIO_PCI_QUEUE_NUM 12 /* number of ring entries (16, RO) */
+#define VIRTIO_PCI_QUEUE_SEL 14 /* current VQ selection (16, RW) */
+#define VIRTIO_PCI_QUEUE_NOTIFY 16 /* notify host regarding VQ (16, RW) */
+#define VIRTIO_PCI_STATUS 18 /* device status register (8, RW) */
+#define VIRTIO_PCI_ISR 19 /* interrupt status register, reading
+ * also clears the register (8, RO) */
+/* Only if MSIX is enabled: */
+#define VIRTIO_MSI_CONFIG_VECTOR 20 /* configuration change vector (16, RW) */
+#define VIRTIO_MSI_QUEUE_VECTOR 22 /* vector for selected VQ notifications
+ (16, RW) */
+#define VIRTIO_PCI_QUEUE_ADDR_SHIFT 12
+
+#endif /* __included_virtio_pci_legacy_h__ */
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */