Re: [RFC 02/17] usb/ehci: compile ehci-pci as a seperate compile unit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 29, 2011 at 2:51 AM, Sebastian Andrzej Siewior
<sebastian@xxxxxxxxxxxxx> wrote:
> don't include ehci-pci.c into ehci.c but compile it and link it. Most
> parts. The largest part of the patch defines prototypes.
>
> Signed-off-by: Sebastian Andrzej Siewior <sebastian@xxxxxxxxxxxxx>
> ---
>  drivers/usb/host/Makefile     |    1 +
>  drivers/usb/host/ehci-dbg.c   |   39 ++-------------------
>  drivers/usb/host/ehci-hub.c   |   26 ++++----------
>  drivers/usb/host/ehci-lpm.c   |    5 +--
>  drivers/usb/host/ehci-pci.c   |   19 +++++++++-
>  drivers/usb/host/ehci-q.c     |   10 ++++-
>  drivers/usb/host/ehci-sched.c |    2 -
>  drivers/usb/host/ehci.c       |   65 ++++++++++++------------------------
>  drivers/usb/host/ehci.h       |   74 ++++++++++++++++++++++++++++++++++------
>  include/linux/usb/hcd.h       |    1 +
>  10 files changed, 126 insertions(+), 116 deletions(-)
>
> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> index 92dbded..23fb76c 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -19,6 +19,7 @@ obj-$(CONFIG_USB_WHCI_HCD)    += whci/
>  obj-$(CONFIG_PCI)              += pci-quirks.o
>
>  ehci-hcd-y     := ehci.o
> +ehci-hcd-$(CONFIG_PCI) += ehci-pci.o
>  obj-$(CONFIG_USB_EHCI_HCD)     += ehci-hcd.o
>  obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
>  obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
> diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
> index 9952505d..4c3608b 100644
> --- a/drivers/usb/host/ehci-dbg.c
> +++ b/drivers/usb/host/ehci-dbg.c
> @@ -16,30 +16,13 @@
>  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
>  */
>
> -/* this file is part of ehci-hcd.c */
> -
> -#define ehci_dbg(ehci, fmt, args...) \
> -       dev_dbg (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
> -#define ehci_err(ehci, fmt, args...) \
> -       dev_err (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
> -#define ehci_info(ehci, fmt, args...) \
> -       dev_info (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
> -#define ehci_warn(ehci, fmt, args...) \
> -       dev_warn (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
> -
> -#ifdef VERBOSE_DEBUG
> -#      define ehci_vdbg ehci_dbg
> -#else
> -       static inline void ehci_vdbg(struct ehci_hcd *ehci, ...) {}
> -#endif
> -
> -#ifdef DEBUG
> -
>  /* check the values in the HCSPARAMS register
>  * (host controller _Structural_ parameters)
>  * see EHCI spec, Table 2-4 for each value
>  */
> -static void dbg_hcs_params (struct ehci_hcd *ehci, char *label)

This patch should be split further. All these generic part where you
modify ehci-dbg.c, ehci-lpm.c, ehci-q.c, ehci-sched.c should be done
prior to this patch and compiling ehci-pci as a separate unit should
only be taken care in this patch.

> +
> +#ifdef DEBUG
> +void dbg_hcs_params(struct ehci_hcd *ehci, char *label)
>  {
>        u32     params = ehci_readl(ehci, &ehci->caps->hcs_params);
>
> @@ -71,19 +54,12 @@ static void dbg_hcs_params (struct ehci_hcd *ehci, char *label)
>                                label, buf);
>        }
>  }
> -#else
> -
> -static inline void dbg_hcs_params (struct ehci_hcd *ehci, char *label) {}
> -
> -#endif
> -
> -#ifdef DEBUG
>
>  /* check the values in the HCCPARAMS register
>  * (host controller _Capability_ parameters)
>  * see EHCI Spec, Table 2-5 for each value
>  * */
> -static void dbg_hcc_params (struct ehci_hcd *ehci, char *label)
> +void dbg_hcc_params(struct ehci_hcd *ehci, char *label)
>  {
>        u32     params = ehci_readl(ehci, &ehci->caps->hcc_params);
>
> @@ -110,13 +86,6 @@ static void dbg_hcc_params (struct ehci_hcd *ehci, char *label)
>                                " 32 peridic list" : "");
>        }
>  }
> -#else
> -
> -static inline void dbg_hcc_params (struct ehci_hcd *ehci, char *label) {}
> -
> -#endif
> -
> -#ifdef DEBUG
>
>  static void __maybe_unused
>  dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
> diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
> index 77bbb23..86264ea 100644
> --- a/drivers/usb/host/ehci-hub.c
> +++ b/drivers/usb/host/ehci-hub.c
> @@ -33,15 +33,6 @@
>
>  #ifdef CONFIG_PM
>
> -static int ehci_hub_control(
> -       struct usb_hcd  *hcd,
> -       u16             typeReq,
> -       u16             wValue,
> -       u16             wIndex,
> -       char            *buf,
> -       u16             wLength
> -);
> -
>  /* After a power loss, ports that were owned by the companion must be
>  * reset so that the companion can still own them.
>  */
> @@ -128,8 +119,8 @@ static int ehci_port_change(struct ehci_hcd *ehci)
>        return 0;
>  }
>
> -static __maybe_unused void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
> -               bool suspending, bool do_wakeup)
> +void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci, bool suspending,
> +               bool do_wakeup)
>  {
>        int             port;
>        u32             temp;
> @@ -201,7 +192,7 @@ static __maybe_unused void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
>        spin_unlock_irqrestore(&ehci->lock, flags);
>  }
>
> -static int ehci_bus_suspend (struct usb_hcd *hcd)
> +int ehci_bus_suspend(struct usb_hcd *hcd)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
>        int                     port;
> @@ -335,7 +326,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
>
>
>  /* caller has locked the root hub, and should reset/reinit on error */
> -static int ehci_bus_resume (struct usb_hcd *hcd)
> +int ehci_bus_resume(struct usb_hcd *hcd)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
>        u32                     temp;
> @@ -550,8 +541,7 @@ static int check_reset_complete (
>
>  /* build "status change" packet (one or two bytes) from HC registers */
>
> -static int
> -ehci_hub_status_data (struct usb_hcd *hcd, char *buf)
> +int ehci_hub_status_data(struct usb_hcd *hcd, char *buf)
>  {
>        struct ehci_hcd *ehci = hcd_to_ehci (hcd);
>        u32             temp, status = 0;
> @@ -658,7 +648,7 @@ ehci_hub_descriptor (
>
>  /*-------------------------------------------------------------------------*/
>
> -static int ehci_hub_control (
> +int ehci_hub_control(
>        struct usb_hcd  *hcd,
>        u16             typeReq,
>        u16             wValue,
> @@ -1076,7 +1066,7 @@ error_exit:
>        return retval;
>  }
>
> -static void ehci_relinquish_port(struct usb_hcd *hcd, int portnum)
> +void ehci_relinquish_port(struct usb_hcd *hcd, int portnum)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
>
> @@ -1085,7 +1075,7 @@ static void ehci_relinquish_port(struct usb_hcd *hcd, int portnum)
>        set_owner(ehci, --portnum, PORT_OWNER);
>  }
>
> -static int ehci_port_handed_over(struct usb_hcd *hcd, int portnum)
> +int ehci_port_handed_over(struct usb_hcd *hcd, int portnum)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
>        u32 __iomem             *reg;
> diff --git a/drivers/usb/host/ehci-lpm.c b/drivers/usb/host/ehci-lpm.c
> index 2111627..086a54a 100644
> --- a/drivers/usb/host/ehci-lpm.c
> +++ b/drivers/usb/host/ehci-lpm.c
> @@ -17,8 +17,7 @@
>  */
>
>  /* this file is part of ehci-hcd.c */
> -static int __maybe_unused ehci_lpm_set_da(struct ehci_hcd *ehci,
> -       int dev_addr, int port_num)
> +int ehci_lpm_set_da(struct ehci_hcd *ehci, int dev_addr, int port_num)
>  {
>        u32 __iomem portsc;
>
> @@ -38,7 +37,7 @@ static int __maybe_unused ehci_lpm_set_da(struct ehci_hcd *ehci,
>  * this function is used to check if the device support LPM
>  * if yes, mark the PORTSC register with PORT_LPM bit
>  */
> -static int __maybe_unused ehci_lpm_check(struct ehci_hcd *ehci, int port)
> +int ehci_lpm_check(struct ehci_hcd *ehci, int port)
>  {
>        u32 __iomem     *portsc ;
>        u32 val32;
> diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
> index 8311de7..c8c933c 100644
> --- a/drivers/usb/host/ehci-pci.c
> +++ b/drivers/usb/host/ehci-pci.c
> @@ -18,6 +18,11 @@
>  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
>  */
>
> +#include <linux/pci.h>
> +#include <linux/usb/hcd.h>
> +#include "ehci.h"
> +#include "pci-quirks.h"
> +
>  #ifndef CONFIG_PCI
>  #error "This file is PCI bus glue.  CONFIG_PCI must be defined."
>  #endif
> @@ -461,7 +466,7 @@ static int ehci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
>  }
>
>  static const struct hc_driver ehci_pci_hc_driver = {
> -       .description =          hcd_name,
> +       .description =          "ehci_hcd",
>        .product_desc =         "EHCI Host Controller",
>        .hcd_priv_size =        sizeof(struct ehci_hcd),
>
> @@ -528,7 +533,7 @@ MODULE_DEVICE_TABLE(pci, pci_ids);
>
>  /* pci driver glue; this is a "new style" PCI driver module */
>  static struct pci_driver ehci_pci_driver = {
> -       .name =         (char *) hcd_name,
> +       .name =         "ehci_hcd",
>        .id_table =     pci_ids,
>
>        .probe =        usb_hcd_pci_probe,
> @@ -541,3 +546,13 @@ static struct pci_driver ehci_pci_driver = {
>        },
>  #endif
>  };
> +
> +__init int ehci_register_pci(void)
> +{
> +       return pci_register_driver(&ehci_pci_driver);
> +}
> +
> +void ehci_unregister_pci(void)
> +{
> +       pci_unregister_driver(&ehci_pci_driver);
> +}
> diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
> index 6ce0b3a..c7cfe93 100644
> --- a/drivers/usb/host/ehci-q.c
> +++ b/drivers/usb/host/ehci-q.c
> @@ -143,7 +143,7 @@ qh_refresh (struct ehci_hcd *ehci, struct ehci_qh *qh)
>
>  static void qh_link_async(struct ehci_hcd *ehci, struct ehci_qh *qh);
>
> -static void ehci_clear_tt_buffer_complete(struct usb_hcd *hcd,
> +void ehci_clear_tt_buffer_complete(struct usb_hcd *hcd,
>                struct usb_host_endpoint *ep)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
> @@ -1145,10 +1145,16 @@ submit_async (
>  }
>
>  /*-------------------------------------------------------------------------*/
> +static inline void iaa_watchdog_start(struct ehci_hcd *ehci)
> +{
> +       WARN_ON(timer_pending(&ehci->iaa_watchdog));
> +       mod_timer(&ehci->iaa_watchdog,
> +                       jiffies + msecs_to_jiffies(EHCI_IAA_MSECS));
> +}
>
>  /* the async qh for the qtds being reclaimed are now unlinked from the HC */
>
> -static void end_unlink_async (struct ehci_hcd *ehci)
> +void end_unlink_async(struct ehci_hcd *ehci)
>  {
>        struct ehci_qh          *qh = ehci->reclaim;
>        struct ehci_qh          *next;
> diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
> index 488151b..f046fad 100644
> --- a/drivers/usb/host/ehci-sched.c
> +++ b/drivers/usb/host/ehci-sched.c
> @@ -34,8 +34,6 @@
>  * pre-calculated schedule data to make appending to the queue be quick.
>  */
>
> -static int ehci_get_frame (struct usb_hcd *hcd);
> -
>  /*-------------------------------------------------------------------------*/
>
>  /*
> diff --git a/drivers/usb/host/ehci.c b/drivers/usb/host/ehci.c
> index 8696489..9a857be 100644
> --- a/drivers/usb/host/ehci.c
> +++ b/drivers/usb/host/ehci.c
> @@ -21,7 +21,7 @@
>  */
>
>  #include <linux/module.h>
> -#include <linux/pci.h>
> +#include <linux/device.h>
>  #include <linux/dmapool.h>
>  #include <linux/kernel.h>
>  #include <linux/delay.h>
> @@ -34,7 +34,6 @@
>  #include <linux/ktime.h>
>  #include <linux/list.h>
>  #include <linux/interrupt.h>
> -#include <linux/usb.h>
>  #include <linux/usb/hcd.h>
>  #include <linux/moduleparam.h>
>  #include <linux/dma-mapping.h>
> @@ -117,8 +116,6 @@ static unsigned int hird;
>  module_param(hird, int, S_IRUGO);
>  MODULE_PARM_DESC(hird, "host initiated resume duration, +1 for each 75us");
>
> -#define        INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
> -
>  /*-------------------------------------------------------------------------*/
>
>  #include "ehci.h"
> @@ -209,7 +206,7 @@ static int tdi_in_host_mode (struct ehci_hcd *ehci)
>  }
>
>  /* force HC to halt state from unknown (EHCI spec section 2.3) */
> -static int ehci_halt (struct ehci_hcd *ehci)
> +int ehci_halt(struct ehci_hcd *ehci)
>  {
>        u32     temp = ehci_readl(ehci, &ehci->regs->status);
>
> @@ -247,7 +244,7 @@ static int handshake_on_error_set_halt(struct ehci_hcd *ehci, void __iomem *ptr,
>  }
>
>  /* put TDI/ARC silicon into EHCI mode */
> -static void tdi_reset (struct ehci_hcd *ehci)
> +void tdi_reset(struct ehci_hcd *ehci)
>  {
>        u32 __iomem     *reg_ptr;
>        u32             tmp;
> @@ -265,7 +262,7 @@ static void tdi_reset (struct ehci_hcd *ehci)
>  }
>
>  /* reset a non-running (STS_HALT == 1) controller */
> -static int ehci_reset (struct ehci_hcd *ehci)
> +int ehci_reset(struct ehci_hcd *ehci)
>  {
>        int     retval;
>        u32     command = ehci_readl(ehci, &ehci->regs->command);
> @@ -329,9 +326,7 @@ static void ehci_quiesce (struct ehci_hcd *ehci)
>  }
>
>  /*-------------------------------------------------------------------------*/
> -
> -static void end_unlink_async(struct ehci_hcd *ehci);
> -static void ehci_work(struct ehci_hcd *ehci);
> +static void free_cached_lists(struct ehci_hcd *ehci);
>
>  #include "ehci-hub.c"
>  #include "ehci-lpm.c"
> @@ -440,7 +435,7 @@ static void ehci_silence_controller(struct ehci_hcd *ehci)
>  * This forcibly disables dma and IRQs, helping kexec and other cases
>  * where the next system software may expect clean state.
>  */
> -static void ehci_shutdown(struct usb_hcd *hcd)
> +void ehci_shutdown(struct usb_hcd *hcd)
>  {
>        struct ehci_hcd *ehci = hcd_to_ehci(hcd);
>
> @@ -452,7 +447,7 @@ static void ehci_shutdown(struct usb_hcd *hcd)
>        spin_unlock_irq(&ehci->lock);
>  }
>
> -static void ehci_port_power (struct ehci_hcd *ehci, int is_on)
> +void ehci_port_power(struct ehci_hcd *ehci, int is_on)
>  {
>        unsigned port;
>
> @@ -476,7 +471,7 @@ static void ehci_port_power (struct ehci_hcd *ehci, int is_on)
>  * ehci_work is called from some interrupts, timers, and so on.
>  * it calls driver completion functions, after dropping ehci->lock.
>  */
> -static void ehci_work (struct ehci_hcd *ehci)
> +void ehci_work(struct ehci_hcd *ehci)
>  {
>        timer_action_done (ehci, TIMER_IO_WATCHDOG);
>
> @@ -505,7 +500,7 @@ static void ehci_work (struct ehci_hcd *ehci)
>  /*
>  * Called when the ehci_hcd module is removed.
>  */
> -static void ehci_stop (struct usb_hcd *hcd)
> +void ehci_stop(struct usb_hcd *hcd)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
>
> @@ -549,7 +544,7 @@ static void ehci_stop (struct usb_hcd *hcd)
>  }
>
>  /* one-time init, only for memory state */
> -static int ehci_init(struct usb_hcd *hcd)
> +int ehci_init(struct usb_hcd *hcd)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
>        u32                     temp;
> @@ -674,7 +669,7 @@ static int ehci_init(struct usb_hcd *hcd)
>  }
>
>  /* start HC running; it's halted, ehci_init() has been run (once) */
> -static int ehci_run (struct usb_hcd *hcd)
> +int ehci_run(struct usb_hcd *hcd)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
>        int                     retval;
> @@ -770,7 +765,7 @@ static int ehci_run (struct usb_hcd *hcd)
>
>  /*-------------------------------------------------------------------------*/
>
> -static irqreturn_t ehci_irq (struct usb_hcd *hcd)
> +irqreturn_t ehci_irq(struct usb_hcd *hcd)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
>        u32                     status, masked_status, pcd_status = 0, cmd;
> @@ -912,11 +907,8 @@ dead:
>  * NOTE:  control, bulk, and interrupt share the same code to append TDs
>  * to a (possibly active) QH, and the same QH scanning code.
>  */
> -static int ehci_urb_enqueue (
> -       struct usb_hcd  *hcd,
> -       struct urb      *urb,
> -       gfp_t           mem_flags
> -) {
> +int ehci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
> +{
>        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
>        struct list_head        qtd_list;
>
> @@ -985,7 +977,7 @@ static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
>  * completions normally happen asynchronously
>  */
>
> -static int ehci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
> +int ehci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
>        struct ehci_qh          *qh;
> @@ -1055,8 +1047,7 @@ done:
>
>  // bulk qh holds the data toggle
>
> -static void
> -ehci_endpoint_disable (struct usb_hcd *hcd, struct usb_host_endpoint *ep)
> +void ehci_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *ep)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
>        unsigned long           flags;
> @@ -1122,8 +1113,7 @@ done:
>        spin_unlock_irqrestore (&ehci->lock, flags);
>  }
>
> -static void
> -ehci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep)
> +void ehci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
>        struct ehci_qh          *qh;
> @@ -1163,7 +1153,7 @@ ehci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep)
>        spin_unlock_irqrestore(&ehci->lock, flags);
>  }
>
> -static int ehci_get_frame (struct usb_hcd *hcd)
> +int ehci_get_frame(struct usb_hcd *hcd)
>  {
>        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
>        return (ehci_readl(ehci, &ehci->regs->frame_index) >> 3) %
> @@ -1176,11 +1166,6 @@ MODULE_DESCRIPTION(DRIVER_DESC);
>  MODULE_AUTHOR (DRIVER_AUTHOR);
>  MODULE_LICENSE ("GPL");
>
> -#ifdef CONFIG_PCI
> -#include "ehci-pci.c"
> -#define        PCI_DRIVER              ehci_pci_driver
> -#endif
> -
>  #ifdef CONFIG_USB_EHCI_FSL
>  #include "ehci-fsl.c"
>  #define        PLATFORM_DRIVER         ehci_fsl_driver
> @@ -1301,7 +1286,7 @@ MODULE_LICENSE ("GPL");
>  #define PLATFORM_DRIVER                ehci_xls_driver
>  #endif
>
> -#if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
> +#if !defined(CONFIG_PCI) && !defined(PLATFORM_DRIVER) && \
>     !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) && \
>     !defined(XILINX_OF_PLATFORM_DRIVER)
>  #error "missing bus glue for ehci-hcd"
> @@ -1340,11 +1325,9 @@ static int __init ehci_hcd_init(void)
>                goto clean0;
>  #endif
>
> -#ifdef PCI_DRIVER
> -       retval = pci_register_driver(&PCI_DRIVER);
> +       retval = ehci_register_pci();
>        if (retval < 0)
>                goto clean1;
> -#endif
>
>  #ifdef PS3_SYSTEM_BUS_DRIVER
>        retval = ps3_ehci_driver_register(&PS3_SYSTEM_BUS_DRIVER);
> @@ -1377,10 +1360,8 @@ clean3:
>        ps3_ehci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
>  clean2:
>  #endif
> -#ifdef PCI_DRIVER
> -       pci_unregister_driver(&PCI_DRIVER);
> +       ehci_unregister_pci();
>  clean1:
> -#endif
>  #ifdef PLATFORM_DRIVER
>        platform_driver_unregister(&PLATFORM_DRIVER);
>  clean0:
> @@ -1406,9 +1387,7 @@ static void __exit ehci_hcd_cleanup(void)
>  #ifdef PLATFORM_DRIVER
>        platform_driver_unregister(&PLATFORM_DRIVER);
>  #endif
> -#ifdef PCI_DRIVER
> -       pci_unregister_driver(&PCI_DRIVER);
> -#endif
> +       ehci_unregister_pci();
>  #ifdef PS3_SYSTEM_BUS_DRIVER
>        ps3_ehci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
>  #endif
> diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
> index c161d97..3d53c53 100644
> --- a/drivers/usb/host/ehci.h
> +++ b/drivers/usb/host/ehci.h
> @@ -188,15 +188,6 @@ static inline struct usb_hcd *ehci_to_hcd (struct ehci_hcd *ehci)
>        return container_of ((void *) ehci, struct usb_hcd, hcd_priv);
>  }
>
> -
> -static inline void
> -iaa_watchdog_start(struct ehci_hcd *ehci)
> -{
> -       WARN_ON(timer_pending(&ehci->iaa_watchdog));
> -       mod_timer(&ehci->iaa_watchdog,
> -                       jiffies + msecs_to_jiffies(EHCI_IAA_MSECS));
> -}
> -
>  static inline void iaa_watchdog_done(struct ehci_hcd *ehci)
>  {
>        del_timer(&ehci->iaa_watchdog);
> @@ -214,8 +205,6 @@ timer_action_done (struct ehci_hcd *ehci, enum ehci_timer_action action)
>        clear_bit (action, &ehci->actions);
>  }
>
> -static void free_cached_lists(struct ehci_hcd *ehci);
> -
>  /*-------------------------------------------------------------------------*/
>
>  #include <linux/usb/ehci_def.h>
> @@ -745,6 +734,69 @@ static inline u32 hc32_to_cpup (const struct ehci_hcd *ehci, const __hc32 *x)
>
>  #endif
>
> +#define INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
> +
> +#define ehci_dbg(ehci, fmt, args...) \
> +       dev_dbg(ehci_to_hcd(ehci)->self.controller, fmt, ## args)
> +#define ehci_err(ehci, fmt, args...) \
> +       dev_err(ehci_to_hcd(ehci)->self.controller, fmt, ## args)
> +#define ehci_info(ehci, fmt, args...) \
> +       dev_info(ehci_to_hcd(ehci)->self.controller, fmt, ## args)
> +#define ehci_warn(ehci, fmt, args...) \
> +       dev_warn(ehci_to_hcd(ehci)->self.controller, fmt, ## args)
> +
> +#ifdef VERBOSE_DEBUG
> +#define ehci_vdbg ehci_dbg
> +#else
> +static inline void ehci_vdbg(struct ehci_hcd *ehci, ...) {}
> +#endif
> +
> +#ifdef DEBUG
> +void dbg_hcs_params(struct ehci_hcd *ehci, char *label);
> +void dbg_hcc_params(struct ehci_hcd *ehci, char *label);
> +#else
> +static inline void dbg_hcs_params(struct ehci_hcd *ehci, char *label) {}
> +static inline void dbg_hcc_params(struct ehci_hcd *ehci, char *label) {}
> +#endif
> +
> +int ehci_bus_suspend(struct usb_hcd *hcd);
> +int ehci_bus_resume(struct usb_hcd *hcd);
> +int ehci_hub_status_data(struct usb_hcd *hcd, char *buf);
> +int ehci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
> +               char *buf, u16 wLength);
> +void ehci_relinquish_port(struct usb_hcd *hcd, int portnum);
> +int ehci_port_handed_over(struct usb_hcd *hcd, int portnum);
> +void ehci_clear_tt_buffer_complete(struct usb_hcd *hcd,
> +               struct usb_host_endpoint *ep);
> +int ehci_get_frame(struct usb_hcd *hcd);
> +void ehci_shutdown(struct usb_hcd *hcd);
> +void ehci_port_power(struct ehci_hcd *ehci, int is_on);
> +void ehci_stop(struct usb_hcd *hcd);
> +int ehci_init(struct usb_hcd *hcd);
> +int ehci_run(struct usb_hcd *hcd);
> +irqreturn_t ehci_irq(struct usb_hcd *hcd);
> +int ehci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags);
> +int ehci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status);
> +void ehci_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *ep);
> +void ehci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep);
> +int ehci_halt(struct ehci_hcd *ehci);
> +void tdi_reset(struct ehci_hcd *ehci);
> +int ehci_reset(struct ehci_hcd *ehci);
> +void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci, bool suspending,
> +               bool do_wakeup);
> +void end_unlink_async(struct ehci_hcd *ehci);
> +void ehci_work(struct ehci_hcd *ehci);
> +int ehci_lpm_set_da(struct ehci_hcd *ehci, int dev_addr, int port_num);
> +int ehci_lpm_check(struct ehci_hcd *ehci, int port);
> +
> +#ifdef CONFIG_PCI
> +int ehci_register_pci(void);
> +void ehci_unregister_pci(void);
> +#else
> +static inline int ehci_register_pci(void) { return 0; }
> +static inline void ehci_unregister_pci(void) {};
> +#endif
> +
>  /*-------------------------------------------------------------------------*/
>
>  #ifndef DEBUG
> diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
> index 0097136..d29a8a0 100644
> --- a/include/linux/usb/hcd.h
> +++ b/include/linux/usb/hcd.h
> @@ -22,6 +22,7 @@
>  #ifdef __KERNEL__
>
>  #include <linux/rwsem.h>
> +#include <linux/usb.h>
>
>  #define MAX_TOPO_LEVEL         6
>
> --
> 1.7.5.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux