[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/14] pcnet: use the DMA memory access interface
From: |
David Gibson |
Subject: |
[Qemu-devel] [PATCH 11/14] pcnet: use the DMA memory access interface |
Date: |
Fri, 3 Jun 2011 01:12:39 +1000 |
This allows the device to work properly with an emulated IOMMU.
Signed-off-by: Eduard - Gabriel Munteanu <address@hidden>
---
hw/pcnet-pci.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c
index 9415a1e..9e962a3 100644
--- a/hw/pcnet-pci.c
+++ b/hw/pcnet-pci.c
@@ -214,16 +214,16 @@ static CPUReadMemoryFunc * const pcnet_mmio_read[] = {
&pcnet_mmio_readl
};
-static void pci_physical_memory_write(void *dma_opaque, target_phys_addr_t
addr,
- uint8_t *buf, int len, int do_bswap)
+static void pci_dma_write(void *dma_opaque, target_phys_addr_t addr,
+ uint8_t *buf, int len, int do_bswap)
{
- cpu_physical_memory_write(addr, buf, len);
+ dma_memory_write(dma_opaque, addr, buf, len);
}
-static void pci_physical_memory_read(void *dma_opaque, target_phys_addr_t addr,
- uint8_t *buf, int len, int do_bswap)
+static void pci_dma_read(void *dma_opaque, target_phys_addr_t addr,
+ uint8_t *buf, int len, int do_bswap)
{
- cpu_physical_memory_read(addr, buf, len);
+ dma_memory_read(dma_opaque, addr, buf, len);
}
static void pci_pcnet_cleanup(VLANClientState *nc)
@@ -290,8 +290,9 @@ static int pci_pcnet_init(PCIDevice *pci_dev)
pci_register_bar_simple(pci_dev, 1, PCNET_PNPMMIO_SIZE, 0, s->mmio_index);
s->irq = pci_dev->irq[0];
- s->phys_mem_read = pci_physical_memory_read;
- s->phys_mem_write = pci_physical_memory_write;
+ s->phys_mem_read = pci_dma_read;
+ s->phys_mem_write = pci_dma_write;
+ s->dma_opaque = &pci_dev->qdev;
if (!pci_dev->qdev.hotplugged) {
static int loaded = 0;
--
1.7.4.4
- Re: [Qemu-devel] [PATCH 01/14] Generic DMA memory access interface, (continued)
[Qemu-devel] [PATCH 10/14] lsi53c895a: use the DMA memory access interface, David Gibson, 2011/06/02
[Qemu-devel] [PATCH 09/14] e1000: use the DMA memory access interface, David Gibson, 2011/06/02
[Qemu-devel] [PATCH 08/14] es1370: use the DMA memory access interface, David Gibson, 2011/06/02
[Qemu-devel] [PATCH 05/14] rtl8139: use the DMA memory access interface, David Gibson, 2011/06/02
[Qemu-devel] [PATCH 07/14] ac97: use the DMA memory access interface, David Gibson, 2011/06/02
[Qemu-devel] [PATCH 03/14] AMD IOMMU emulation, David Gibson, 2011/06/02
[Qemu-devel] [PATCH 11/14] pcnet: use the DMA memory access interface,
David Gibson <=
[Qemu-devel] [PATCH 14/14] Make spapr tces use generic dma layer, David Gibson, 2011/06/02
[Qemu-devel] [PATCH 12/14] usb-uhci: use the DMA memory access interface, David Gibson, 2011/06/02
[Qemu-devel] [PATCH 06/14] eepro100: use the DMA memory access interface, David Gibson, 2011/06/02