mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 12:09:58 +00:00
ide/piix: convert to PCIDeviceInfo to initialize ids
use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
92f9a4f13e
commit
25f8e2f512
@ -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 */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user