[OpenBIOS] [PATCH 1/2] pci: identify virtio-scsi devices

Blue Swirl blauwirbel at gmail.com
Sat May 12 13:42:39 CEST 2012


Identify virtio SCSI device in PCI probe.

Signed-off-by: Blue Swirl <blauwirbel at gmail.com>
---
 drivers/pci_database.c |   19 ++++++++++++++++++-
 include/drivers/pci.h  |    3 +++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/pci_database.c b/drivers/pci_database.c
index ac47621..7d420c3 100644
--- a/drivers/pci_database.c
+++ b/drivers/pci_database.c
@@ -45,6 +45,23 @@ static const pci_subclass_t undef_subclass[] = {
     },
 };

+static const pci_dev_t scsi_devices[] = {
+    {
+        /* Virtio-block controller */
+        PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_BLOCK,
+        NULL, "virtio-scsi", NULL,
+        "pci1af4,1001\0pci1af4,1001\0pciclass,01018f\0",
+        0, 0, 0,
+        NULL, NULL,
+    },
+    {
+        0xFFFF, 0xFFFF,
+        NULL, NULL, NULL, NULL,
+        -1, -1, -1,
+        NULL, NULL,
+    },
+};
+
 static const pci_dev_t ide_devices[] = {
     {
         PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_646, /* CMD646 IDE controller */
@@ -64,7 +81,7 @@ static const pci_dev_t ide_devices[] = {
 static const pci_subclass_t mass_subclass[] = {
     {
         PCI_SUBCLASS_STORAGE_SCSI, "SCSI bus controller",
-        NULL, NULL, NULL,
+        "scsi", scsi_devices, NULL,
         NULL, NULL,
     },
     {
diff --git a/include/drivers/pci.h b/include/drivers/pci.h
index 562a43e..4c996c0 100644
--- a/include/drivers/pci.h
+++ b/include/drivers/pci.h
@@ -205,6 +205,9 @@ extern const pci_arch_t *arch;
 #define PCI_VENDOR_ID_QEMU               0x1234
 #define PCI_DEVICE_ID_QEMU_VGA           0x1111

+#define PCI_VENDOR_ID_REDHAT_QUMRANET    0x1af4
+#define PCI_DEVICE_ID_VIRTIO_BLOCK       0x1001
+
 #define PCI_VENDOR_ID_INTEL              0x8086
 #define PCI_DEVICE_ID_INTEL_82441        0x1237

-- 
1.7.10



More information about the OpenBIOS mailing list