Commit b2e723de authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: Use driver-model logging in the UHCI driver

The main item in this patch is the conversion of the UHCI driver from
using the old usb.h logging macros to the new driver-model dev_xxx
macros.

There are a few other minor changes too: updated version number, author,
copyright, and maintainer information, removed some unneeded error
messages, added some line breaks, added a convenience macro for the device
pointer.
parent 254a79b9
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* (C) Copyright 2000 Yggdrasil Computing, Inc. (port of new PCI interface * (C) Copyright 2000 Yggdrasil Computing, Inc. (port of new PCI interface
* support from usb-ohci.c by Adam Richter, adam@yggdrasil.com). * support from usb-ohci.c by Adam Richter, adam@yggdrasil.com).
* (C) Copyright 1999 Gregory P. Smith (from usb-ohci.c) * (C) Copyright 1999 Gregory P. Smith (from usb-ohci.c)
* (C) Copyright 2004 Alan Stern, stern@rowland.harvard.edu
* *
* Intel documents this fairly well, and as far as I know there * Intel documents this fairly well, and as far as I know there
* are no royalties or anything like that, but even so there are * are no royalties or anything like that, but even so there are
...@@ -46,6 +47,7 @@ ...@@ -46,6 +47,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/pm.h>
#include <linux/dmapool.h> #include <linux/dmapool.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/usb.h> #include <linux/usb.h>
...@@ -59,13 +61,13 @@ ...@@ -59,13 +61,13 @@
#include "../core/hcd.h" #include "../core/hcd.h"
#include "uhci-hcd.h" #include "uhci-hcd.h"
#include <linux/pm.h>
/* /*
* Version Information * Version Information
*/ */
#define DRIVER_VERSION "v2.1" #define DRIVER_VERSION "v2.2"
#define DRIVER_AUTHOR "Linus 'Frodo Rabbit' Torvalds, Johannes Erdfelt, Randy Dunlap, Georg Acher, Deti Fliegl, Thomas Sailer, Roman Weissgaerber" #define DRIVER_AUTHOR "Linus 'Frodo Rabbit' Torvalds, Johannes Erdfelt, \
Randy Dunlap, Georg Acher, Deti Fliegl, Thomas Sailer, Roman Weissgaerber, \
Alan Stern"
#define DRIVER_DESC "USB Universal Host Controller Interface driver" #define DRIVER_DESC "USB Universal Host Controller Interface driver"
/* /*
...@@ -285,11 +287,11 @@ static void uhci_insert_tds_in_qh(struct uhci_qh *qh, struct urb *urb, u32 bread ...@@ -285,11 +287,11 @@ static void uhci_insert_tds_in_qh(struct uhci_qh *qh, struct urb *urb, u32 bread
static void uhci_free_td(struct uhci_hcd *uhci, struct uhci_td *td) static void uhci_free_td(struct uhci_hcd *uhci, struct uhci_td *td)
{ {
if (!list_empty(&td->list)) if (!list_empty(&td->list))
dbg("td %p is still in list!", td); dev_warn(uhci_dev(uhci), "td %p still in list!\n", td);
if (!list_empty(&td->remove_list)) if (!list_empty(&td->remove_list))
dbg("td %p still in remove_list!", td); dev_warn(uhci_dev(uhci), "td %p still in remove_list!\n", td);
if (!list_empty(&td->fl_list)) if (!list_empty(&td->fl_list))
dbg("td %p is still in fl_list!", td); dev_warn(uhci_dev(uhci), "td %p still in fl_list!\n", td);
if (td->dev) if (td->dev)
usb_put_dev(td->dev); usb_put_dev(td->dev);
...@@ -325,9 +327,9 @@ static struct uhci_qh *uhci_alloc_qh(struct uhci_hcd *uhci, struct usb_device *d ...@@ -325,9 +327,9 @@ static struct uhci_qh *uhci_alloc_qh(struct uhci_hcd *uhci, struct usb_device *d
static void uhci_free_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) static void uhci_free_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
{ {
if (!list_empty(&qh->list)) if (!list_empty(&qh->list))
dbg("qh %p list not empty!", qh); dev_warn(uhci_dev(uhci), "qh %p list not empty!\n", qh);
if (!list_empty(&qh->remove_list)) if (!list_empty(&qh->remove_list))
dbg("qh %p still in remove_list!", qh); dev_warn(uhci_dev(uhci), "qh %p still in remove_list!\n", qh);
if (qh->dev) if (qh->dev)
usb_put_dev(qh->dev); usb_put_dev(qh->dev);
...@@ -657,10 +659,8 @@ static struct urb_priv *uhci_alloc_urb_priv(struct uhci_hcd *uhci, struct urb *u ...@@ -657,10 +659,8 @@ static struct urb_priv *uhci_alloc_urb_priv(struct uhci_hcd *uhci, struct urb *u
struct urb_priv *urbp; struct urb_priv *urbp;
urbp = kmem_cache_alloc(uhci_up_cachep, SLAB_ATOMIC); urbp = kmem_cache_alloc(uhci_up_cachep, SLAB_ATOMIC);
if (!urbp) { if (!urbp)
err("uhci_alloc_urb_priv: couldn't allocate memory for urb_priv\n");
return NULL; return NULL;
}
memset((void *)urbp, 0, sizeof(*urbp)); memset((void *)urbp, 0, sizeof(*urbp));
...@@ -718,7 +718,8 @@ static void uhci_destroy_urb_priv(struct uhci_hcd *uhci, struct urb *urb) ...@@ -718,7 +718,8 @@ static void uhci_destroy_urb_priv(struct uhci_hcd *uhci, struct urb *urb)
return; return;
if (!list_empty(&urbp->urb_list)) if (!list_empty(&urbp->urb_list))
warn("uhci_destroy_urb_priv: urb %p still on uhci->urb_list or uhci->remove_list", urb); dev_warn(uhci_dev(uhci), "urb %p still on uhci->urb_list "
"or uhci->remove_list!\n", urb);
spin_lock_irqsave(&uhci->td_remove_list_lock, flags); spin_lock_irqsave(&uhci->td_remove_list_lock, flags);
...@@ -956,10 +957,8 @@ static int usb_control_retrigger_status(struct uhci_hcd *uhci, struct urb *urb) ...@@ -956,10 +957,8 @@ static int usb_control_retrigger_status(struct uhci_hcd *uhci, struct urb *urb)
} }
urbp->qh = uhci_alloc_qh(uhci, urb->dev); urbp->qh = uhci_alloc_qh(uhci, urb->dev);
if (!urbp->qh) { if (!urbp->qh)
err("unable to allocate new QH for control retrigger");
return -ENOMEM; return -ENOMEM;
}
urbp->qh->urbp = urbp; urbp->qh->urbp = urbp;
...@@ -1068,7 +1067,8 @@ static int uhci_result_control(struct uhci_hcd *uhci, struct urb *urb) ...@@ -1068,7 +1067,8 @@ static int uhci_result_control(struct uhci_hcd *uhci, struct urb *urb)
err: err:
if ((debug == 1 && ret != -EPIPE) || debug > 1) { if ((debug == 1 && ret != -EPIPE) || debug > 1) {
/* Some debugging code */ /* Some debugging code */
dbg("uhci_result_control() failed with status %x", status); dev_dbg(uhci_dev(uhci), "%s: failed with status %x\n",
__FUNCTION__, status);
if (errbuf) { if (errbuf) {
/* Print the chain for debugging purposes */ /* Print the chain for debugging purposes */
...@@ -1233,7 +1233,8 @@ static int uhci_result_common(struct uhci_hcd *uhci, struct urb *urb) ...@@ -1233,7 +1233,8 @@ static int uhci_result_common(struct uhci_hcd *uhci, struct urb *urb)
#if 0 #if 0
if ((debug == 1 && ret != -EPIPE) || debug > 1) { if ((debug == 1 && ret != -EPIPE) || debug > 1) {
/* Some debugging code */ /* Some debugging code */
dbg("uhci_result_common() failed with status %x", status); dev_dbg(uhci_dev(uhci), "%s: failed with status %x\n",
__FUNCTION__, status);
if (errbuf) { if (errbuf) {
/* Print the chain for debugging purposes */ /* Print the chain for debugging purposes */
...@@ -1580,8 +1581,9 @@ static void uhci_transfer_result(struct uhci_hcd *uhci, struct urb *urb) ...@@ -1580,8 +1581,9 @@ static void uhci_transfer_result(struct uhci_hcd *uhci, struct urb *urb)
uhci_unlink_generic(uhci, urb); uhci_unlink_generic(uhci, urb);
break; break;
default: default:
info("uhci_transfer_result: unknown pipe type %d for urb %p\n", dev_info(uhci_dev(uhci), "%s: unknown pipe type %d "
usb_pipetype(urb->pipe), urb); "for urb %p\n",
__FUNCTION__, usb_pipetype(urb->pipe), urb);
} }
/* Move it from uhci->urb_list to uhci->complete_list */ /* Move it from uhci->urb_list to uhci->complete_list */
...@@ -1892,11 +1894,14 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs) ...@@ -1892,11 +1894,14 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs)
if (status & ~(USBSTS_USBINT | USBSTS_ERROR | USBSTS_RD)) { if (status & ~(USBSTS_USBINT | USBSTS_ERROR | USBSTS_RD)) {
if (status & USBSTS_HSE) if (status & USBSTS_HSE)
err("%x: host system error, PCI problems?", io_addr); dev_err(uhci_dev(uhci), "host system error, "
"PCI problems?\n");
if (status & USBSTS_HCPE) if (status & USBSTS_HCPE)
err("%x: host controller process error. something bad happened", io_addr); dev_err(uhci_dev(uhci), "host controller process "
"error, something bad happened!\n");
if ((status & USBSTS_HCH) && uhci->state > 0) { if ((status & USBSTS_HCH) && uhci->state > 0) {
err("%x: host controller halted. very bad", io_addr); dev_err(uhci_dev(uhci), "host controller halted, "
"very bad!\n");
/* FIXME: Reset the controller, fix the offending TD */ /* FIXME: Reset the controller, fix the offending TD */
} }
} }
...@@ -1952,7 +1957,7 @@ static void suspend_hc(struct uhci_hcd *uhci) ...@@ -1952,7 +1957,7 @@ static void suspend_hc(struct uhci_hcd *uhci)
{ {
unsigned int io_addr = uhci->io_addr; unsigned int io_addr = uhci->io_addr;
dbg("%x: suspend_hc", io_addr); dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__);
uhci->state = UHCI_SUSPENDED; uhci->state = UHCI_SUSPENDED;
uhci->resume_detect = 0; uhci->resume_detect = 0;
outw(USBCMD_EGSM, io_addr + USBCMD); outw(USBCMD_EGSM, io_addr + USBCMD);
...@@ -1964,7 +1969,7 @@ static void wakeup_hc(struct uhci_hcd *uhci) ...@@ -1964,7 +1969,7 @@ static void wakeup_hc(struct uhci_hcd *uhci)
switch (uhci->state) { switch (uhci->state) {
case UHCI_SUSPENDED: /* Start the resume */ case UHCI_SUSPENDED: /* Start the resume */
dbg("%x: wakeup_hc", io_addr); dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__);
/* Global resume for >= 20ms */ /* Global resume for >= 20ms */
outw(USBCMD_FGR | USBCMD_EGSM, io_addr + USBCMD); outw(USBCMD_FGR | USBCMD_EGSM, io_addr + USBCMD);
...@@ -2015,8 +2020,7 @@ static int suspend_allowed(struct uhci_hcd *uhci) ...@@ -2015,8 +2020,7 @@ static int suspend_allowed(struct uhci_hcd *uhci)
unsigned int io_addr = uhci->io_addr; unsigned int io_addr = uhci->io_addr;
int i; int i;
if (!uhci->hcd.self.controller || if (to_pci_dev(uhci_dev(uhci))->vendor != PCI_VENDOR_ID_INTEL)
to_pci_dev(uhci->hcd.self.controller)->vendor != PCI_VENDOR_ID_INTEL)
return 1; return 1;
/* Some of Intel's USB controllers have a bug that causes false /* Some of Intel's USB controllers have a bug that causes false
...@@ -2090,7 +2094,7 @@ static void start_hc(struct uhci_hcd *uhci) ...@@ -2090,7 +2094,7 @@ static void start_hc(struct uhci_hcd *uhci)
outw(USBCMD_HCRESET, io_addr + USBCMD); outw(USBCMD_HCRESET, io_addr + USBCMD);
while (inw(io_addr + USBCMD) & USBCMD_HCRESET) { while (inw(io_addr + USBCMD) & USBCMD_HCRESET) {
if (!--timeout) { if (!--timeout) {
printk(KERN_ERR "uhci: USBCMD_HCRESET timed out!\n"); dev_err(uhci_dev(uhci), "USBCMD_HCRESET timed out!\n");
break; break;
} }
} }
...@@ -2140,7 +2144,8 @@ static void release_uhci(struct uhci_hcd *uhci) ...@@ -2140,7 +2144,8 @@ static void release_uhci(struct uhci_hcd *uhci)
} }
if (uhci->fl) { if (uhci->fl) {
dma_free_coherent(uhci->hcd.self.controller, sizeof(*uhci->fl), uhci->fl, uhci->fl->dma_handle); dma_free_coherent(uhci_dev(uhci), sizeof(*uhci->fl),
uhci->fl, uhci->fl->dma_handle);
uhci->fl = NULL; uhci->fl = NULL;
} }
...@@ -2165,7 +2170,8 @@ static int uhci_reset(struct usb_hcd *hcd) ...@@ -2165,7 +2170,8 @@ static int uhci_reset(struct usb_hcd *hcd)
* interrupts from any previous setup. * interrupts from any previous setup.
*/ */
reset_hc(uhci); reset_hc(uhci);
pci_write_config_word(to_pci_dev(hcd->self.controller), USBLEGSUP, USBLEGSUP_DEFAULT); pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP,
USBLEGSUP_DEFAULT);
return 0; return 0;
} }
...@@ -2197,12 +2203,12 @@ static int uhci_start(struct usb_hcd *hcd) ...@@ -2197,12 +2203,12 @@ static int uhci_start(struct usb_hcd *hcd)
struct proc_dir_entry *ent; struct proc_dir_entry *ent;
#endif #endif
io_size = pci_resource_len(to_pci_dev(hcd->self.controller), hcd->region); io_size = pci_resource_len(to_pci_dev(uhci_dev(uhci)), hcd->region);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
ent = create_proc_entry(hcd->self.bus_name, S_IFREG|S_IRUGO|S_IWUSR, uhci_proc_root); ent = create_proc_entry(hcd->self.bus_name, S_IFREG|S_IRUGO|S_IWUSR, uhci_proc_root);
if (!ent) { if (!ent) {
err("couldn't create uhci proc entry"); dev_err(uhci_dev(uhci), "couldn't create uhci proc entry\n");
retval = -ENOMEM; retval = -ENOMEM;
goto err_create_proc_entry; goto err_create_proc_entry;
} }
...@@ -2233,10 +2239,11 @@ static int uhci_start(struct usb_hcd *hcd) ...@@ -2233,10 +2239,11 @@ static int uhci_start(struct usb_hcd *hcd)
spin_lock_init(&uhci->frame_list_lock); spin_lock_init(&uhci->frame_list_lock);
uhci->fl = dma_alloc_coherent(hcd->self.controller, uhci->fl = dma_alloc_coherent(uhci_dev(uhci), sizeof(*uhci->fl),
sizeof(*uhci->fl), &dma_handle, 0); &dma_handle, 0);
if (!uhci->fl) { if (!uhci->fl) {
err("unable to allocate consistent memory for frame list"); dev_err(uhci_dev(uhci), "unable to allocate "
"consistent memory for frame list\n");
goto err_alloc_fl; goto err_alloc_fl;
} }
...@@ -2244,17 +2251,17 @@ static int uhci_start(struct usb_hcd *hcd) ...@@ -2244,17 +2251,17 @@ static int uhci_start(struct usb_hcd *hcd)
uhci->fl->dma_handle = dma_handle; uhci->fl->dma_handle = dma_handle;
uhci->td_pool = dma_pool_create("uhci_td", hcd->self.controller, uhci->td_pool = dma_pool_create("uhci_td", uhci_dev(uhci),
sizeof(struct uhci_td), 16, 0); sizeof(struct uhci_td), 16, 0);
if (!uhci->td_pool) { if (!uhci->td_pool) {
err("unable to create td dma_pool"); dev_err(uhci_dev(uhci), "unable to create td dma_pool\n");
goto err_create_td_pool; goto err_create_td_pool;
} }
uhci->qh_pool = dma_pool_create("uhci_qh", hcd->self.controller, uhci->qh_pool = dma_pool_create("uhci_qh", uhci_dev(uhci),
sizeof(struct uhci_qh), 16, 0); sizeof(struct uhci_qh), 16, 0);
if (!uhci->qh_pool) { if (!uhci->qh_pool) {
err("unable to create qh dma_pool"); dev_err(uhci_dev(uhci), "unable to create qh dma_pool\n");
goto err_create_qh_pool; goto err_create_qh_pool;
} }
...@@ -2272,12 +2279,13 @@ static int uhci_start(struct usb_hcd *hcd) ...@@ -2272,12 +2279,13 @@ static int uhci_start(struct usb_hcd *hcd)
break; break;
} }
if (debug) if (debug)
info("detected %d ports", port); dev_info(uhci_dev(uhci), "detected %d ports\n", port);
/* This is experimental so anything less than 2 or greater than 8 is */ /* This is experimental so anything less than 2 or greater than 8 is */
/* something weird and we'll ignore it */ /* something weird and we'll ignore it */
if (port < 2 || port > UHCI_RH_MAXCHILD) { if (port < 2 || port > UHCI_RH_MAXCHILD) {
info("port count misdetected? forcing to 2 ports"); dev_info(uhci_dev(uhci), "port count misdetected? "
"forcing to 2 ports\n");
port = 2; port = 2;
} }
...@@ -2285,20 +2293,20 @@ static int uhci_start(struct usb_hcd *hcd) ...@@ -2285,20 +2293,20 @@ static int uhci_start(struct usb_hcd *hcd)
hcd->self.root_hub = udev = usb_alloc_dev(NULL, &hcd->self, 0); hcd->self.root_hub = udev = usb_alloc_dev(NULL, &hcd->self, 0);
if (!udev) { if (!udev) {
err("unable to allocate root hub"); dev_err(uhci_dev(uhci), "unable to allocate root hub\n");
goto err_alloc_root_hub; goto err_alloc_root_hub;
} }
uhci->term_td = uhci_alloc_td(uhci, udev); uhci->term_td = uhci_alloc_td(uhci, udev);
if (!uhci->term_td) { if (!uhci->term_td) {
err("unable to allocate terminating TD"); dev_err(uhci_dev(uhci), "unable to allocate terminating TD\n");
goto err_alloc_term_td; goto err_alloc_term_td;
} }
for (i = 0; i < UHCI_NUM_SKELQH; i++) { for (i = 0; i < UHCI_NUM_SKELQH; i++) {
uhci->skelqh[i] = uhci_alloc_qh(uhci, udev); uhci->skelqh[i] = uhci_alloc_qh(uhci, udev);
if (!uhci->skelqh[i]) { if (!uhci->skelqh[i]) {
err("unable to allocate QH %d", i); dev_err(uhci_dev(uhci), "unable to allocate QH\n");
goto err_alloc_skelqh; goto err_alloc_skelqh;
} }
} }
...@@ -2365,8 +2373,8 @@ static int uhci_start(struct usb_hcd *hcd) ...@@ -2365,8 +2373,8 @@ static int uhci_start(struct usb_hcd *hcd)
udev->speed = USB_SPEED_FULL; udev->speed = USB_SPEED_FULL;
if (usb_register_root_hub(udev, hcd->self.controller) != 0) { if (usb_register_root_hub(udev, uhci_dev(uhci)) != 0) {
err("unable to start root hub"); dev_err(uhci_dev(uhci), "unable to start root hub\n");
retval = -ENOMEM; retval = -ENOMEM;
goto err_start_root_hub; goto err_start_root_hub;
} }
...@@ -2404,8 +2412,8 @@ static int uhci_start(struct usb_hcd *hcd) ...@@ -2404,8 +2412,8 @@ static int uhci_start(struct usb_hcd *hcd)
uhci->td_pool = NULL; uhci->td_pool = NULL;
err_create_td_pool: err_create_td_pool:
dma_free_coherent(hcd->self.controller, dma_free_coherent(uhci_dev(uhci), sizeof(*uhci->fl),
sizeof(*uhci->fl), uhci->fl, uhci->fl->dma_handle); uhci->fl, uhci->fl->dma_handle);
uhci->fl = NULL; uhci->fl = NULL;
err_alloc_fl: err_alloc_fl:
...@@ -2461,7 +2469,7 @@ static int uhci_resume(struct usb_hcd *hcd) ...@@ -2461,7 +2469,7 @@ static int uhci_resume(struct usb_hcd *hcd)
{ {
struct uhci_hcd *uhci = hcd_to_uhci(hcd); struct uhci_hcd *uhci = hcd_to_uhci(hcd);
pci_set_master(to_pci_dev(uhci->hcd.self.controller)); pci_set_master(to_pci_dev(uhci_dev(uhci)));
if (uhci->state == UHCI_SUSPENDED) if (uhci->state == UHCI_SUSPENDED)
uhci->resume_detect = 1; uhci->resume_detect = 1;
...@@ -2553,7 +2561,7 @@ static int __init uhci_hcd_init(void) ...@@ -2553,7 +2561,7 @@ static int __init uhci_hcd_init(void)
{ {
int retval = -ENOMEM; int retval = -ENOMEM;
info(DRIVER_DESC " " DRIVER_VERSION); printk(KERN_INFO DRIVER_DESC " " DRIVER_VERSION "\n");
if (usb_disabled()) if (usb_disabled())
return -ENODEV; return -ENODEV;
...@@ -2583,7 +2591,7 @@ static int __init uhci_hcd_init(void) ...@@ -2583,7 +2591,7 @@ static int __init uhci_hcd_init(void)
init_failed: init_failed:
if (kmem_cache_destroy(uhci_up_cachep)) if (kmem_cache_destroy(uhci_up_cachep))
printk(KERN_INFO "uhci: not all urb_priv's were freed\n"); printk(KERN_WARN "uhci: not all urb_priv's were freed!\n");
up_failed: up_failed:
...@@ -2605,7 +2613,7 @@ static void __exit uhci_hcd_cleanup(void) ...@@ -2605,7 +2613,7 @@ static void __exit uhci_hcd_cleanup(void)
pci_unregister_driver(&uhci_pci_driver); pci_unregister_driver(&uhci_pci_driver);
if (kmem_cache_destroy(uhci_up_cachep)) if (kmem_cache_destroy(uhci_up_cachep))
printk(KERN_INFO "uhci: not all urb_priv's were freed\n"); printk(KERN_WARN "uhci: not all urb_priv's were freed!\n");
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
remove_proc_entry("driver/uhci", 0); remove_proc_entry("driver/uhci", 0);
...@@ -2621,4 +2629,3 @@ module_exit(uhci_hcd_cleanup); ...@@ -2621,4 +2629,3 @@ module_exit(uhci_hcd_cleanup);
MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -315,6 +315,7 @@ enum uhci_state { ...@@ -315,6 +315,7 @@ enum uhci_state {
}; };
#define hcd_to_uhci(hcd_ptr) container_of(hcd_ptr, struct uhci_hcd, hcd) #define hcd_to_uhci(hcd_ptr) container_of(hcd_ptr, struct uhci_hcd, hcd)
#define uhci_dev(u) ((u)->hcd.self.controller)
/* /*
* This describes the full uhci information. * This describes the full uhci information.
...@@ -422,4 +423,3 @@ struct urb_priv { ...@@ -422,4 +423,3 @@ struct urb_priv {
*/ */
#endif #endif
/* /*
* Universal Host Controller Interface driver for USB. * Universal Host Controller Interface driver for USB.
* *
* Maintainer: Johannes Erdfelt <johannes@erdfelt.com> * Maintainer: Alan Stern <stern@rowland.harvard.edu>
* *
* (C) Copyright 1999 Linus Torvalds * (C) Copyright 1999 Linus Torvalds
* (C) Copyright 1999-2002 Johannes Erdfelt, johannes@erdfelt.com * (C) Copyright 1999-2002 Johannes Erdfelt, johannes@erdfelt.com
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
* (C) Copyright 1999 Georg Acher, acher@in.tum.de * (C) Copyright 1999 Georg Acher, acher@in.tum.de
* (C) Copyright 1999 Deti Fliegl, deti@fliegl.de * (C) Copyright 1999 Deti Fliegl, deti@fliegl.de
* (C) Copyright 1999 Thomas Sailer, sailer@ife.ee.ethz.ch * (C) Copyright 1999 Thomas Sailer, sailer@ife.ee.ethz.ch
* (C) Copyright 2004 Alan Stern, stern@rowland.harvard.edu
*/ */
static __u8 root_hub_hub_des[] = static __u8 root_hub_hub_des[] =
...@@ -122,9 +123,8 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -122,9 +123,8 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
wPortStatus |= 1 << USB_PORT_FEAT_LOWSPEED; wPortStatus |= 1 << USB_PORT_FEAT_LOWSPEED;
if (wPortChange) if (wPortChange)
dev_dbg (uhci->hcd.self.controller, dev_dbg(uhci_dev(uhci), "port %d portsc %04x\n",
"port %d portsc %04x\n", wIndex, status);
wIndex, status);
*(__u16 *)buf = cpu_to_le16(wPortStatus); *(__u16 *)buf = cpu_to_le16(wPortStatus);
*(__u16 *)(buf + 2) = cpu_to_le16(wPortChange); *(__u16 *)(buf + 2) = cpu_to_le16(wPortChange);
...@@ -209,4 +209,3 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -209,4 +209,3 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
return retval; return retval;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment