Update of /cvsroot/alsa/alsa-kernel/pci/emu10k1
In directory sc8-pr-cvs1:/tmp/cvs-serv10582/pci/emu10k1

Modified Files:
        emu10k1_main.c memory.c 
Log Message:
Cleanups in the PCI DMA masks.


Index: emu10k1_main.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/emu10k1_main.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- emu10k1_main.c      20 Jan 2003 15:08:29 -0000      1.20
+++ emu10k1_main.c      10 Mar 2003 12:54:47 -0000      1.21
@@ -581,22 +581,16 @@
        /* enable PCI device */
        if ((err = pci_enable_device(pci)) < 0)
                return err;
-       /* set the DMA transfer mask */
-       if (is_audigy) {
-               if (pci_set_dma_mask(pci, 0xffffffff) < 0) {
-                       snd_printk(KERN_ERR "architecture does not support 32bit PCI 
busmaster DMA\n");
-                       return -ENXIO;
-               }
-       } else {
-               if (pci_set_dma_mask(pci, 0x1fffffff) < 0) {
-                       snd_printk(KERN_ERR "architecture does not support 29bit PCI 
busmaster DMA\n");
-                       return -ENXIO;
-               }
-       }
 
        emu = snd_magic_kcalloc(emu10k1_t, 0, GFP_KERNEL);
        if (emu == NULL)
                return -ENOMEM;
+       /* set the DMA transfer mask */
+       emu->dma_mask = is_audigy ? AUDIGY_DMA_MASK : EMU10K1_DMA_MASK;
+       if (pci_set_dma_mask(pci, emu->dma_mask) < 0) {
+               snd_printk(KERN_ERR "architecture does not support PCI busmaster DMA 
with mask 0x%lx\n", emu->dma_mask);
+               return -ENXIO;
+       }
        emu->card = card;
        spin_lock_init(&emu->reg_lock);
        spin_lock_init(&emu->emu_lock);

Index: memory.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/memory.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- memory.c    9 Mar 2003 23:59:10 -0000       1.12
+++ memory.c    10 Mar 2003 12:54:47 -0000      1.13
@@ -228,10 +228,10 @@
 /*
  * check if the given pointer is valid for pages
  */
-static int is_valid_page(dma_addr_t addr)
+static int is_valid_page(emu10k1_t *emu, dma_addr_t addr)
 {
-       if (addr & ~0x7fffffffUL) {
-               snd_printk("max memory size is 2GB (addr = 0x%lx)!!\n", (unsigned 
long)addr);
+       if (addr & ~emu->dma_mask) {
+               snd_printk("max memory size is 0x%lx (addr = 0x%lx)!!\n", 
emu->dma_mask, (unsigned long)addr);
                return 0;
        }
        if (addr & (EMUPAGESIZE-1)) {
@@ -323,7 +323,7 @@
                }
 #endif
                addr = sgbuf->table[idx].addr;
-               if (! is_valid_page(addr)) {
+               if (! is_valid_page(emu, addr)) {
                        printk(KERN_ERR "emu: failure page = %d\n", idx);
                        up(&hdr->block_mutex);
                        return NULL;
@@ -446,7 +446,7 @@
                ptr = snd_malloc_pci_page(emu->pci, &addr);
                if (ptr == NULL)
                        goto __fail;
-               if (! is_valid_page(addr)) {
+               if (! is_valid_page(emu, addr)) {
                        snd_free_pci_page(emu->pci, ptr, addr);
                        goto __fail;
                }



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to