diff mbox

[11/13] pcnet: use the DMA memory access interface

Message ID 800fc3514ae6d70eb429a10259b241f8eb790a3c.1296321798.git.eduard.munteanu@linux360.ro (mailing list archive)
State New, archived
Headers show

Commit Message

Eduard - Gabriel Munteanu Jan. 29, 2011, 5:40 p.m. UTC
None
diff mbox

Patch

diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c
index 339a401..3f55c42 100644
--- a/hw/pcnet-pci.c
+++ b/hw/pcnet-pci.c
@@ -230,13 +230,13 @@  static void pcnet_mmio_map(PCIDevice *pci_dev, int region_num,
 static void pci_physical_memory_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)
 {
-    cpu_physical_memory_read(addr, buf, len);
+    dma_memory_read(dma_opaque, addr, buf, len);
 }
 
 static void pci_pcnet_cleanup(VLANClientState *nc)
@@ -306,6 +306,7 @@  static int pci_pcnet_init(PCIDevice *pci_dev)
     s->irq = pci_dev->irq[0];
     s->phys_mem_read = pci_physical_memory_read;
     s->phys_mem_write = pci_physical_memory_write;
+    s->dma_opaque = &pci_dev->dma;
 
     if (!pci_dev->qdev.hotplugged) {
         static int loaded = 0;