===== drivers/usb/core/hcd-pci.c 1.23 vs edited ===== --- 2.6.2-mm1/drivers/usb/core/buffer.c Tue Jan 6 06:50:11 2004 +++ edited/drivers/usb/core/buffer.c Wed Feb 4 10:40:42 2004 @@ -2,14 +2,19 @@ * DMA memory management for framework level HCD code (hc_driver) * * This implementation plugs in through generic "usb_bus" level methods, - * and works with real PCI, or when "pci device == null" makes sense. + * and should work with all USB controllers, regardles of bus type. */ #include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/pci.h> +#include <linux/device.h> +#include <linux/mm.h> +#include <asm/io.h> +#include <asm/scatterlist.h> +#include <linux/dma-mapping.h> +#include <linux/dmapool.h> #ifdef CONFIG_USB_DEBUG @@ -62,7 +67,7 @@ if (!(size = pool_max [i])) continue; snprintf (name, sizeof name, "buffer-%d", size); - hcd->pool [i] = pci_pool_create (name, hcd->pdev, + hcd->pool [i] = dma_pool_create (name, hcd->dev, size, size, 0); if (!hcd->pool [i]) { hcd_buffer_destroy (hcd); @@ -86,9 +91,9 @@ int i; for (i = 0; i < HCD_BUFFER_POOLS; i++) { - struct pci_pool *pool = hcd->pool [i]; + struct dma_pool *pool = hcd->pool [i]; if (pool) { - pci_pool_destroy (pool); + dma_pool_destroy (pool); hcd->pool [i] = 0; } } @@ -112,9 +117,9 @@ for (i = 0; i < HCD_BUFFER_POOLS; i++) { if (size <= pool_max [i]) - return pci_pool_alloc (hcd->pool [i], mem_flags, dma); + return dma_pool_alloc (hcd->pool [i], mem_flags, dma); } - return pci_alloc_consistent (hcd->pdev, size, dma); + return dma_alloc_coherent (hcd->dev, size, dma, 0); } void hcd_buffer_free ( @@ -131,9 +136,9 @@ return; for (i = 0; i < HCD_BUFFER_POOLS; i++) { if (size <= pool_max [i]) { - pci_pool_free (hcd->pool [i], addr, dma); + dma_pool_free (hcd->pool [i], addr, dma); return; } } - pci_free_consistent (hcd->pdev, size, addr, dma); + dma_free_coherent (hcd->dev, size, addr, dma); }
-- Deepak Saxena - dsaxena at plexity dot net - http://www.plexity.net/ ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel