[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 06/39] ide/piix: convert to PCIDeviceInfo to init
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH v3 06/39] ide/piix: convert to PCIDeviceInfo to initialize ids |
Date: |
Wed, 25 May 2011 10:58:03 +0900 |
use PCIDeviceInfo to initialize ids.
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/ide/piix.c | 32 ++++++++++----------------------
1 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index c349644..84f72b0 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -131,12 +131,12 @@ static void pci_piix_init_ports(PCIIDEState *d) {
}
}
-static int pci_piix_ide_initfn(PCIIDEState *d)
+static int pci_piix_ide_initfn(PCIDevice *dev)
{
+ PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev);
uint8_t *pci_conf = d->dev.config;
pci_conf[PCI_CLASS_PROG] = 0x80; // legacy ATA mode
- pci_config_set_class(pci_conf, PCI_CLASS_STORAGE_IDE);
qemu_register_reset(piix3_reset, d);
@@ -149,24 +149,6 @@ static int pci_piix_ide_initfn(PCIIDEState *d)
return 0;
}
-static int pci_piix3_ide_initfn(PCIDevice *dev)
-{
- PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev);
-
- pci_config_set_vendor_id(d->dev.config, PCI_VENDOR_ID_INTEL);
- pci_config_set_device_id(d->dev.config, PCI_DEVICE_ID_INTEL_82371SB_1);
- return pci_piix_ide_initfn(d);
-}
-
-static int pci_piix4_ide_initfn(PCIDevice *dev)
-{
- PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev);
-
- pci_config_set_vendor_id(d->dev.config, PCI_VENDOR_ID_INTEL);
- pci_config_set_device_id(d->dev.config, PCI_DEVICE_ID_INTEL_82371AB);
- return pci_piix_ide_initfn(d);
-}
-
/* hd_table must contain 4 block drivers */
/* NOTE: for the PIIX3, the IRQs and IOports are hardcoded */
PCIDevice *pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
@@ -195,13 +177,19 @@ static PCIDeviceInfo piix_ide_info[] = {
.qdev.size = sizeof(PCIIDEState),
.qdev.no_user = 1,
.no_hotplug = 1,
- .init = pci_piix3_ide_initfn,
+ .init = pci_piix_ide_initfn,
+ .vendor_id = PCI_VENDOR_ID_INTEL,
+ .device_id = PCI_DEVICE_ID_INTEL_82371SB_1,
+ .class_id = PCI_CLASS_STORAGE_IDE,
},{
.qdev.name = "piix4-ide",
.qdev.size = sizeof(PCIIDEState),
.qdev.no_user = 1,
.no_hotplug = 1,
- .init = pci_piix4_ide_initfn,
+ .init = pci_piix_ide_initfn,
+ .vendor_id = PCI_VENDOR_ID_INTEL,
+ .device_id = PCI_DEVICE_ID_INTEL_82371AB,
+ .class_id = PCI_CLASS_STORAGE_IDE,
},{
/* end of list */
}
--
1.7.1.1
- [Qemu-devel] [PATCH v3 00/39] pci: initialize ids in pci common code, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 13/39] hw/es1370.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 20/39] hw/ioh3420.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 01/39] pci: move ids of config space into PCIDeviceInfo, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 18/39] hw/ide/via.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 16/39] hw/ide/cmd646.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 22/39] hw/lsi53c895a.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 07/39] vmware_vga.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 12/39] hw/e1000.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 06/39] ide/piix: convert to PCIDeviceInfo to initialize ids,
Isaku Yamahata <=
- [Qemu-devel] [PATCH v3 30/39] hw/sun4u.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 19/39] hw/intel-hda.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 04/39] dec_pci: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 03/39] eepro100: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 11/39] hw/cirrus_vga.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 33/39] hw/versatile_pci.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 24/39] hw/pcnet-pci.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 17/39] hw/ide/ich.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 25/39] hw/piix4.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24
- [Qemu-devel] [PATCH v3 29/39] hw/sh_pci.c: convert to PCIDeviceInfo to initialize ids, Isaku Yamahata, 2011/05/24