diff options
author | Juan Quintela <quintela@redhat.com> | 2009-10-07 16:56:25 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-12 09:42:30 -0500 |
commit | 58c0e7326e3396c2a0f8734f852cee5ecdf13047 (patch) | |
tree | 5e62f7dfc1d52b68a3d56fc928401abf5d95ec1c /hw | |
parent | 4c3df0ecc2e6a73440c9b934e33e3ed6e74c1153 (diff) |
ide: PCIIDEState type field is not needed anymore
We have split the functions that needed it for cmd646
Patchworks-ID: 35302
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ide/cmd646.c | 34 | ||||
-rw-r--r-- | hw/ide/pci.h | 5 | ||||
-rw-r--r-- | hw/ide/piix.c | 2 |
3 files changed, 11 insertions, 30 deletions
diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index 8c8daa146e..2107209e32 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -80,24 +80,17 @@ static uint32_t bmdma_readb(void *opaque, uint32_t addr) break; case 1: pci_dev = bm->pci_dev; - if (pci_dev->type == IDE_TYPE_CMD646) { - val = pci_dev->dev.config[MRDMODE]; - } else { - val = 0xff; - } + val = pci_dev->dev.config[MRDMODE]; break; case 2: val = bm->status; break; case 3: pci_dev = bm->pci_dev; - if (pci_dev->type == IDE_TYPE_CMD646) { - if (bm == &pci_dev->bmdma[0]) - val = pci_dev->dev.config[UDIDETCR0]; - else - val = pci_dev->dev.config[UDIDETCR1]; + if (bm == &pci_dev->bmdma[0]) { + val = pci_dev->dev.config[UDIDETCR0]; } else { - val = 0xff; + val = pci_dev->dev.config[UDIDETCR1]; } break; default: @@ -120,23 +113,19 @@ static void bmdma_writeb(void *opaque, uint32_t addr, uint32_t val) switch(addr & 3) { case 1: pci_dev = bm->pci_dev; - if (pci_dev->type == IDE_TYPE_CMD646) { - pci_dev->dev.config[MRDMODE] = - (pci_dev->dev.config[MRDMODE] & ~0x30) | (val & 0x30); - cmd646_update_irq(pci_dev); - } + pci_dev->dev.config[MRDMODE] = + (pci_dev->dev.config[MRDMODE] & ~0x30) | (val & 0x30); + cmd646_update_irq(pci_dev); break; case 2: bm->status = (val & 0x60) | (bm->status & 1) | (bm->status & ~val & 0x06); break; case 3: pci_dev = bm->pci_dev; - if (pci_dev->type == IDE_TYPE_CMD646) { - if (bm == &pci_dev->bmdma[0]) - pci_dev->dev.config[UDIDETCR0] = val; - else - pci_dev->dev.config[UDIDETCR1] = val; - } + if (bm == &pci_dev->bmdma[0]) + pci_dev->dev.config[UDIDETCR0] = val; + else + pci_dev->dev.config[UDIDETCR1] = val; break; } } @@ -211,7 +200,6 @@ static int pci_cmd646_ide_initfn(PCIDevice *dev) uint8_t *pci_conf = d->dev.config; qemu_irq *irq; - d->type = IDE_TYPE_CMD646; pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_CMD); pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_CMD_646); diff --git a/hw/ide/pci.h b/hw/ide/pci.h index 063ae96c76..690d0579a6 100644 --- a/hw/ide/pci.h +++ b/hw/ide/pci.h @@ -3,15 +3,10 @@ #include <hw/ide/internal.h> -#define IDE_TYPE_PIIX3 0 -#define IDE_TYPE_CMD646 1 -#define IDE_TYPE_PIIX4 2 - typedef struct PCIIDEState { PCIDevice dev; IDEBus bus[2]; BMDMAState bmdma[2]; - int type; /* see IDE_TYPE_xxx */ uint32_t secondary; } PCIIDEState; diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 47d736d624..4583c42ec8 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -141,7 +141,6 @@ static int pci_piix3_ide_initfn(PCIDevice *dev) { PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev); - d->type = IDE_TYPE_PIIX3; 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); @@ -151,7 +150,6 @@ static int pci_piix4_ide_initfn(PCIDevice *dev) { PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev); - d->type = IDE_TYPE_PIIX4; 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); |