===== drivers/usb/host/ehci-mem.c 1.54 vs edited =====
--- 2.6.2-mm1/drivers/usb/host/ehci-mem.c       Sun Dec 28 09:02:23 2003
+++ edited/drivers/usb/host/ehci-mem.c  Wed Feb  4 14:04:36 2004
@@ -24,7 +24,7 @@
  * There's basically three types of memory:
  *     - data used only by the HCD ... kmalloc is fine
  *     - async and periodic schedules, shared by HC and HCD ... these
- *       need to use pci_pool or pci_alloc_consistent
+ *       need to use dma_pool or dma_alloc_coherent
  *     - driver buffers, read/written by HC ... single shot DMA mapped 
  *
  * There's also PCI "register" data, which is memory mapped.
@@ -74,7 +74,7 @@
        struct ehci_qtd         *qtd;
        dma_addr_t              dma;
 
-       qtd = pci_pool_alloc (ehci->qtd_pool, flags, &dma);
+       qtd = dma_pool_alloc (ehci->qtd_pool, flags, &dma);
        if (qtd != 0) {
                ehci_qtd_init (qtd, dma);
        }
@@ -83,7 +83,7 @@
 
 static inline void ehci_qtd_free (struct ehci_hcd *ehci, struct ehci_qtd *qtd)
 {
-       pci_pool_free (ehci->qtd_pool, qtd, qtd->qtd_dma);
+       dma_pool_free (ehci->qtd_pool, qtd, qtd->qtd_dma);
 }
 
 
@@ -93,7 +93,7 @@
        dma_addr_t              dma;
 
        qh = (struct ehci_qh *)
-               pci_pool_alloc (ehci->qh_pool, flags, &dma);
+               dma_pool_alloc (ehci->qh_pool, flags, &dma);
        if (!qh)
                return qh;
 
@@ -107,7 +107,7 @@
        qh->dummy = ehci_qtd_alloc (ehci, flags);
        if (qh->dummy == 0) {
                ehci_dbg (ehci, "no dummy td\n");
-               pci_pool_free (ehci->qh_pool, qh, qh->qh_dma);
+               dma_pool_free (ehci->qh_pool, qh, qh->qh_dma);
                qh = 0;
        }
        return qh;
@@ -132,7 +132,7 @@
        if (qh->dummy)
                ehci_qtd_free (ehci, qh->dummy);
        usb_put_dev (qh->dev);
-       pci_pool_free (ehci->qh_pool, qh, qh->qh_dma);
+       dma_pool_free (ehci->qh_pool, qh, qh->qh_dma);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -148,26 +148,26 @@
                qh_put (ehci, ehci->async);
        ehci->async = 0;
 
-       /* PCI consistent memory and pools */
+       /* DMA consistent memory and pools */
        if (ehci->qtd_pool)
-               pci_pool_destroy (ehci->qtd_pool);
+               dma_pool_destroy (ehci->qtd_pool);
        ehci->qtd_pool = 0;
 
        if (ehci->qh_pool) {
-               pci_pool_destroy (ehci->qh_pool);
+               dma_pool_destroy (ehci->qh_pool);
                ehci->qh_pool = 0;
        }
 
        if (ehci->itd_pool)
-               pci_pool_destroy (ehci->itd_pool);
+               dma_pool_destroy (ehci->itd_pool);
        ehci->itd_pool = 0;
 
        if (ehci->sitd_pool)
-               pci_pool_destroy (ehci->sitd_pool);
+               dma_pool_destroy (ehci->sitd_pool);
        ehci->sitd_pool = 0;
 
        if (ehci->periodic)
-               pci_free_consistent (ehci->hcd.pdev,
+               dma_free_coherent (ehci->hcd.dev,
                        ehci->periodic_size * sizeof (u32),
                        ehci->periodic, ehci->periodic_dma);
        ehci->periodic = 0;
@@ -184,7 +184,7 @@
        int i;
 
        /* QTDs for control/bulk/intr transfers */
-       ehci->qtd_pool = pci_pool_create ("ehci_qtd", ehci->hcd.pdev,
+       ehci->qtd_pool = dma_pool_create ("ehci_qtd", ehci->hcd.dev,
                        sizeof (struct ehci_qtd),
                        32 /* byte alignment (for hw parts) */,
                        4096 /* can't cross 4K */);
@@ -193,7 +193,7 @@
        }
 
        /* QHs for control/bulk/intr transfers */
-       ehci->qh_pool = pci_pool_create ("ehci_qh", ehci->hcd.pdev,
+       ehci->qh_pool = dma_pool_create ("ehci_qh", ehci->hcd.dev,
                        sizeof (struct ehci_qh),
                        32 /* byte alignment (for hw parts) */,
                        4096 /* can't cross 4K */);
@@ -206,7 +206,7 @@
        }
 
        /* ITD for high speed ISO transfers */
-       ehci->itd_pool = pci_pool_create ("ehci_itd", ehci->hcd.pdev,
+       ehci->itd_pool = dma_pool_create ("ehci_itd", ehci->hcd.dev,
                        sizeof (struct ehci_itd),
                        32 /* byte alignment (for hw parts) */,
                        4096 /* can't cross 4K */);
@@ -215,7 +215,7 @@
        }
 
        /* SITD for full/low speed split ISO transfers */
-       ehci->sitd_pool = pci_pool_create ("ehci_sitd", ehci->hcd.pdev,
+       ehci->sitd_pool = dma_pool_create ("ehci_sitd", ehci->hcd.dev,
                        sizeof (struct ehci_sitd),
                        32 /* byte alignment (for hw parts) */,
                        4096 /* can't cross 4K */);
@@ -225,9 +225,9 @@
 
        /* Hardware periodic table */
        ehci->periodic = (u32 *)
-               pci_alloc_consistent (ehci->hcd.pdev,
+               dma_alloc_coherent (ehci->hcd.dev,
                        ehci->periodic_size * sizeof (u32),
-                       &ehci->periodic_dma);
+                       &ehci->periodic_dma, 0);
        if (ehci->periodic == 0) {
                goto fail;
        }
-- 
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

Reply via email to