On Tuesday 19 September 2006 18:40, Larry Finger wrote:
> The patch below implements a quick-and-dirty approach to solving the problem 
> of
> DMA with more than 1 GB memory. Unfortunately, I don't have the hardware to 
> test
> it. The patch is intended for the wireless-2.6 tree. It will not work with
> 2.6.18-rcX. Please report your results, and the log messages.

Q: Does this help > 1GB memory problem?
A: No ;)

Please lookup old SVN archives, where I implemented such a
dirty workaround like this.
1) We also need to have descriptor buffers under 1G
2) I think it's clear to you, that this is based on pure
   luck, as retrying 10 times can easily fail as well
   as only trying once.

If you want >1G, get a device which supports this.

> Thanks,
> 
> Larry
> 
> 
> Index: wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
> ===================================================================
> --- wireless-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
> +++ wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
> @@ -215,15 +215,36 @@ void free_descriptor_buffer(struct bcm43
>   static int alloc_ringmemory(struct bcm43xx_dmaring *ring)
>   {
>       struct device *dev = &(ring->bcm->pci_dev->dev);
> +     int i, j;
> +     struct {
> +             dma_addr_t dmabase;
> +             void *descbase;
> +     } dma_trial[10];
> 
> -     ring->descbase = dma_alloc_coherent(dev, BCM43xx_DMA_RINGMEMSIZE,
> +     for (i=0; i<10; i++) {
> +             ring->descbase = dma_alloc_coherent(dev, 
> BCM43xx_DMA_RINGMEMSIZE,
>                                           &(ring->dmabase), GFP_KERNEL);
> -     if (!ring->descbase) {
> -             printk(KERN_ERR PFX "DMA ringmemory allocation failed\n");
> -             return -ENOMEM;
> +             if (!ring->descbase) {
> +                     printk(KERN_ERR PFX "DMA ringmemory allocation 
> failed\n");
> +                     return -ENOMEM;
> +             }
> +             if (ring->dmabase + BCM43xx_DMA_RINGMEMSIZE < 0x3fffffff)
> +                     goto low_mem_ok;
> +             dma_trial[i].descbase = ring->descbase;
> +             dma_trial[i].dmabase = ring->dmabase;
> +             printk(KERN_INFO PFX "Trial %d: dmabase = 0x%.8x\n", i+1, 
> ring->dmabase);
>       }
> +     printk(KERN_INFO PFX "Unable to get DMA memory below 1 GB boundary.\n");
> +
> +low_mem_ok:
>       memset(ring->descbase, 0, BCM43xx_DMA_RINGMEMSIZE);
> 
> +     if (i != 0) {
> +             for (j=0; j<i; j++)    /* get rid of any trials that failed */
> +                     dma_free_coherent(dev, BCM43xx_DMA_RINGMEMSIZE,
> +                                       dma_trial[j].descbase, 
> dma_trial[j].dmabase);
> +     }       
> +
>       return 0;
>   }
> 
> 
> 
> _______________________________________________
> Bcm43xx-dev mailing list
> Bcm43xx-dev@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
> 

-- 
Greetings Michael.
_______________________________________________
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev

Reply via email to