From: Jack Lange Date: Thu, 23 Jul 2009 20:06:19 +0000 (-0500) Subject: added PCI subclass and class codes to clear up the opaque PCI configuration stuff.... X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=a623576ca0618c548af2b96308e996eb32158c49 added PCI subclass and class codes to clear up the opaque PCI configuration stuff.... --- diff --git a/palacios/src/devices/i440fx.c b/palacios/src/devices/i440fx.c index 4f7b48f..d631235 100644 --- a/palacios/src/devices/i440fx.c +++ b/palacios/src/devices/i440fx.c @@ -66,7 +66,7 @@ static int i440_init(struct vm_device * dev) { pci_dev->config_header.device_id = 0x1237; pci_dev->config_header.revision = 0x02; pci_dev->config_header.subclass = 0x00; // SubClass: host2pci - pci_dev->config_header.class = 0x06; // Class: PCI bridge + pci_dev->config_header.class = PCI_CLASS_BRIDGE; // Class: PCI bridge pci_dev->config_space[0x72] = 0x02; // SMRAM (?) diff --git a/palacios/src/devices/ide.c b/palacios/src/devices/ide.c index d661648..17d9461 100644 --- a/palacios/src/devices/ide.c +++ b/palacios/src/devices/ide.c @@ -1536,9 +1536,9 @@ static int init_ide(struct vm_device * dev) { pci_dev->config_header.device_id = 0x7010; pci_dev->config_header.revision = 0x00; - pci_dev->config_header.prog_if = 0x80; - pci_dev->config_header.subclass = 0x01; - pci_dev->config_header.class = 0x01; + pci_dev->config_header.prog_if = 0x80; // Master IDE device + pci_dev->config_header.subclass = PCI_STORAGE_SUBCLASS_IDE; + pci_dev->config_header.class = PCI_CLASS_STORAGE; pci_dev->config_header.command = 0; pci_dev->config_header.status = 0x0280; @@ -1575,8 +1575,6 @@ struct vm_device * v3_create_ide(struct vm_device * pci_bus, struct vm_device * memset(ide, 0, sizeof(struct ide_internal)); - struct vm_device * device = v3_create_device("IDE", &dev_ops, ide); - if (pci_bus != NULL) { if (southbridge_dev == NULL) { PrintError("PCI Enabled BUT southbridge is NULL\n"); @@ -1590,7 +1588,7 @@ struct vm_device * v3_create_ide(struct vm_device * pci_bus, struct vm_device * PrintDebug("IDE: Creating IDE bus x 2\n"); - return device; + return v3_create_device("IDE", &dev_ops, ide); }