Update of /cvsroot/alsa/alsa-kernel/core
In directory sc8-pr-cvs1:/tmp/cvs-serv6227/core

Modified Files:
        memalloc.c 
Log Message:
- use pci_set_consistent_dma_mask().





Index: memalloc.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/memalloc.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- memalloc.c  9 Oct 2003 10:21:44 -0000       1.17
+++ memalloc.c  20 Nov 2003 13:22:19 -0000      1.18
@@ -95,25 +95,25 @@
 {
        void *ret;
        u64 dma_mask;
-       unsigned long rmask;
+       unsigned long mask;
 
        if (hwdev == NULL)
                return pci_alloc_consistent(hwdev, size, dma_handle);
-       dma_mask = hwdev->dma_mask;
-       rmask = ~((unsigned long)dma_mask);
-       hwdev->dma_mask = 0xffffffff; /* do without masking */
+       dma_mask = hwdev->consistent_dma_mask;
+       mask = (unsigned long)dma_mask;
+       hwdev->consistent_dma_mask = 0xffffffff; /* do without masking */
        ret = pci_alloc_consistent(hwdev, size, dma_handle);
-       hwdev->dma_mask = dma_mask; /* restore */
+       hwdev->consistent_dma_mask = dma_mask; /* restore */
        if (ret) {
                /* obtained address is out of range? */
-               if (((unsigned long)*dma_handle + size - 1) & rmask) {
+               if (((unsigned long)*dma_handle + size - 1) & ~mask) {
                        /* reallocate with the proper mask */
                        pci_free_consistent(hwdev, size, ret, *dma_handle);
                        ret = pci_alloc_consistent(hwdev, size, dma_handle);
                }
        } else {
                /* wish to success now with the proper mask... */
-               if (dma_mask != 0xffffffff)
+               if (mask != 0xffffffffUL)
                        ret = pci_alloc_consistent(hwdev, size, dma_handle);
        }
        return ret;
@@ -640,13 +640,13 @@
 {
        void *ptr;
        dma_addr_t addr;
-       unsigned long rmask;
+       unsigned long mask;
 
-       rmask = ~(unsigned long)(pci ? pci->dma_mask : 0x00ffffff);
+       mask = pci ? (unsigned long)pci->consistent_dma_mask : 0x00ffffffUL;
        ptr = (void *)__get_free_page(GFP_KERNEL);
        if (ptr) {
                addr = virt_to_phys(ptr);
-               if (((unsigned long)addr + PAGE_SIZE - 1) & rmask) {
+               if (((unsigned long)addr + PAGE_SIZE - 1) & ~mask) {
                        /* try to reallocate with the GFP_DMA */
                        free_page((unsigned long)ptr);
                        /* use GFP_ATOMIC for the DMA zone to avoid stall */
@@ -833,7 +833,7 @@
                        if (! enable[card++])
                                continue;
                        
-                       if (pci_set_dma_mask(pci, dev->dma_mask) < 0) {
+                       if (pci_set_consistent_dma_mask(pci, dev->dma_mask) < 0) {
                                printk(KERN_ERR "snd-page-alloc: cannot set DMA mask 
%lx for pci %04x:%04x\n", dev->dma_mask, dev->vendor, dev->device);
                                continue;
                        }



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to