===== drivers/usb/host/uhci-hcd.h 1.10 vs edited =====
--- 2.6.2-mm1/drivers/usb/host/uhci-hcd.c Mon Aug 11 03:25:33 2003
+++ edited/drivers/usb/host/uhci-hcd.c Wed Feb 4 10:40:43 2004
@@ -41,6 +41,8 @@
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/proc_fs.h>
+#include <linux/dmapool.h>
+#include <linux/dma-mapping.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
@@ -143,7 +145,7 @@
dma_addr_t dma_handle;
struct uhci_td *td;
- td = pci_pool_alloc(uhci->td_pool, GFP_ATOMIC, &dma_handle);
+ td = dma_pool_alloc(uhci->td_pool, GFP_ATOMIC, &dma_handle);
if (!td)
return NULL;
@@ -295,7 +297,7 @@
if (td->dev)
usb_put_dev(td->dev);
- pci_pool_free(uhci->td_pool, td, td->dma_handle);
+ dma_pool_free(uhci->td_pool, td, td->dma_handle);
}
static struct uhci_qh *uhci_alloc_qh(struct uhci_hcd *uhci, struct usb_device *dev)
@@ -303,7 +305,7 @@
dma_addr_t dma_handle;
struct uhci_qh *qh;
- qh = pci_pool_alloc(uhci->qh_pool, GFP_ATOMIC, &dma_handle);
+ qh = dma_pool_alloc(uhci->qh_pool, GFP_ATOMIC, &dma_handle);
if (!qh)
return NULL;
@@ -333,7 +335,7 @@
if (qh->dev)
usb_put_dev(qh->dev);
- pci_pool_free(uhci->qh_pool, qh, qh->dma_handle);
+ dma_pool_free(uhci->qh_pool, qh, qh->dma_handle);
}
/*
@@ -2049,7 +2051,7 @@
unsigned int io_addr = uhci->io_addr;
int i;
- if (!uhci->hcd.pdev || uhci->hcd.pdev->vendor != PCI_VENDOR_ID_INTEL)
+ if (!uhci->hcd.dev || to_pci_dev(uhci->hcd.dev)->vendor != PCI_VENDOR_ID_INTEL)
return 1;
/* Some of Intel's USB controllers have a bug that causes false
@@ -2163,17 +2165,17 @@
}
if (uhci->qh_pool) {
- pci_pool_destroy(uhci->qh_pool);
+ dma_pool_destroy(uhci->qh_pool);
uhci->qh_pool = NULL;
}
if (uhci->td_pool) {
- pci_pool_destroy(uhci->td_pool);
+ dma_pool_destroy(uhci->td_pool);
uhci->td_pool = NULL;
}
if (uhci->fl) {
- pci_free_consistent(uhci->hcd.pdev, sizeof(*uhci->fl), uhci->fl,
uhci->fl->dma_handle);
+ dma_free_coherent(uhci->hcd.dev, sizeof(*uhci->fl), uhci->fl,
uhci->fl->dma_handle);
uhci->fl = NULL;
}
@@ -2198,7 +2200,7 @@
* interrupts from any previous setup.
*/
reset_hc(uhci);
- pci_write_config_word(hcd->pdev, USBLEGSUP, USBLEGSUP_DEFAULT);
+ pci_write_config_word(to_pci_dev(hcd->dev), USBLEGSUP, USBLEGSUP_DEFAULT);
return 0;
}
@@ -2230,7 +2232,7 @@
struct proc_dir_entry *ent;
#endif
- io_size = pci_resource_len(hcd->pdev, hcd->region);
+ io_size = pci_resource_len(to_pci_dev(hcd->dev), hcd->region);
#ifdef CONFIG_PROC_FS
ent = create_proc_entry(hcd->self.bus_name, S_IFREG|S_IRUGO|S_IWUSR,
uhci_proc_root);
@@ -2266,7 +2268,7 @@
spin_lock_init(&uhci->frame_list_lock);
- uhci->fl = pci_alloc_consistent(hcd->pdev, sizeof(*uhci->fl), &dma_handle);
+ uhci->fl = dma_alloc_coherent(hcd->dev, sizeof(*uhci->fl), &dma_handle, 0);
if (!uhci->fl) {
err("unable to allocate consistent memory for frame list");
goto err_alloc_fl;
@@ -2276,17 +2278,17 @@
uhci->fl->dma_handle = dma_handle;
- uhci->td_pool = pci_pool_create("uhci_td", hcd->pdev,
+ uhci->td_pool = dma_pool_create("uhci_td", hcd->dev,
sizeof(struct uhci_td), 16, 0);
if (!uhci->td_pool) {
- err("unable to create td pci_pool");
+ err("unable to create td dma_pool");
goto err_create_td_pool;
}
- uhci->qh_pool = pci_pool_create("uhci_qh", hcd->pdev,
+ uhci->qh_pool = dma_pool_create("uhci_qh", hcd->dev,
sizeof(struct uhci_qh), 16, 0);
if (!uhci->qh_pool) {
- err("unable to create qh pci_pool");
+ err("unable to create qh dma_pool");
goto err_create_qh_pool;
}
@@ -2402,7 +2404,7 @@
udev->speed = USB_SPEED_FULL;
- if (usb_register_root_hub(udev, &hcd->pdev->dev) != 0) {
+ if (usb_register_root_hub(udev, hcd->dev) != 0) {
err("unable to start root hub");
retval = -ENOMEM;
goto err_start_root_hub;
@@ -2433,15 +2435,15 @@
hcd->self.root_hub = NULL;
err_alloc_root_hub:
- pci_pool_destroy(uhci->qh_pool);
+ dma_pool_destroy(uhci->qh_pool);
uhci->qh_pool = NULL;
err_create_qh_pool:
- pci_pool_destroy(uhci->td_pool);
+ dma_pool_destroy(uhci->td_pool);
uhci->td_pool = NULL;
err_create_td_pool:
- pci_free_consistent(hcd->pdev, sizeof(*uhci->fl), uhci->fl,
uhci->fl->dma_handle);
+ dma_free_coherent(hcd->dev, sizeof(*uhci->fl), uhci->fl, uhci->fl->dma_handle);
uhci->fl = NULL;
err_alloc_fl:
@@ -2494,7 +2496,7 @@
{
struct uhci_hcd *uhci = hcd_to_uhci(hcd);
- pci_set_master(uhci->hcd.pdev);
+ pci_set_master(to_pci_dev(uhci->hcd.dev));
if (uhci->state == UHCI_SUSPENDED)
uhci->resume_detect = 1;
--
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