Port-cobalt archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Qube2700



> I'll take a look at emuxki(4) driver once after I track
> the network problem..

Could you try this one? (untested)

(I wonder where we should call BUS_DMASYNC_POST{READ,WRITE} ops...)
---
Izumi Tsutsui


Index: emuxki.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/emuxki.c,v
retrieving revision 1.50
diff -u -r1.50 emuxki.c
--- emuxki.c    4 Mar 2007 06:02:18 -0000       1.50
+++ emuxki.c    16 Mar 2008 10:18:01 -0000
@@ -1020,6 +1020,10 @@
                                            j * EMU_PTESIZE)) << 1) | (i + j));
                                LIST_INSERT_HEAD(&(sc->mem), mem, next);
                                splx(s);
+                               bus_dmamap_sync(sc->sc_dmat, sc->ptb->map,
+                                   sizeof(uint32_t) * i,
+                                   sizeof(uint32_t) * numblocks,
+                                   BUS_DMASYNC_PREWRITE);
                                return (KERNADDR(mem->dmamem));
                        } else
                                i += j;
@@ -1647,8 +1651,7 @@
 /* voice audio parms (see just before) must be set prior to this */
 static int
 emuxki_voice_set_bufparms(struct emuxki_voice *voice, void *ptr,
-    uint32_t bufsize, uint16_t blksize)
-{
+    uint32_t bufsize, uint16_t blksize) {
        struct emuxki_mem *mem;
        struct emuxki_channel **chan;
        uint32_t start, end;
@@ -1683,6 +1686,8 @@
                            voice->blksize / voice->sample_rate;
                        if (voice->timerate < 5)
                                error = EINVAL;
+                       bus_dmamap_sync(mem->dmamem->dmat, mem->dmamem->map,
+                           start, bufsize, BUS_DMASYNC_PREWRITE);
                } else {
                        voice->blksize = blksize;
                        for(idx = sizeof(emuxki_recbuf_sz) /
@@ -1695,6 +1700,8 @@
 #endif
                                return EINVAL;
                        }
+                       bus_dmamap_sync(mem->dmamem->dmat, mem->dmamem->map,
+                           0, bufsize, BUS_DMASYNC_PREREAD);
                        emuxki_write(voice->sc, 0,
                            emuxki_recsrc_szreg[voice->dataloc.source], idx);
                        emuxki_write(voice->sc, 0,


Home | Main Index | Thread Index | Old Index