diff -Nru a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c
--- a/drivers/usb/core/buffer.c Wed Feb 11 11:42:39 2004
+++ b/drivers/usb/core/buffer.c Wed Feb 11 11:42:39 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->self.controller,
                                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->self.controller, 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->self.controller, size, addr, dma);
 }


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to