From 2c4b9d0ea42c27ec2112e437a0fa954afe73bd23 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 1 Feb 2011 15:51:31 +0100 Subject: ahci: make number of ports runtime determined Different AHCI controllers have a different number of ports, so the core shouldn't care about the amount of ports available. This patch makes the number of ports available to the AHCI core runtime configurable, allowing us to have multiple different AHCI implementations with different amounts of ports. Signed-off-by: Alexander Graf Signed-off-by: Kevin Wolf --- hw/ide/ich.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/ide/ich.c') diff --git a/hw/ide/ich.c b/hw/ide/ich.c index 70cb766990..f242d7a81f 100644 --- a/hw/ide/ich.c +++ b/hw/ide/ich.c @@ -100,7 +100,7 @@ static int pci_ich9_ahci_init(PCIDevice *dev) msi_init(dev, 0x50, 1, true, false); - ahci_init(&d->ahci, &dev->qdev); + ahci_init(&d->ahci, &dev->qdev, 6); d->ahci.irq = d->card.irq[0]; return 0; @@ -116,6 +116,7 @@ static int pci_ich9_uninit(PCIDevice *dev) } qemu_unregister_reset(ahci_reset, d); + ahci_uninit(&d->ahci); return 0; } -- cgit 1.4.1