aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorEric Lescouet <Eric.Lescouet@virtuallogix.com>2010-04-24 17:21:52 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:30 -0400
commit27729aadd31dafddaaf64c24f8ef6d0ff750f3aa (patch)
tree20499b4132eaad36fb177b028600694fc4d0626a /drivers/usb
parent44ebd037c54f80db3121ac9f5fe6e677b76e11d5 (diff)
USB: make hcd.h public (drivers dependency)
The usbcore headers: hcd.h and hub.h are shared between usbcore, HCDs and a couple of other drivers (e.g. USBIP modules). So, it makes sense to move them into a more public location and to cleanup dependency of those modules on kernel internal headers. This patch moves hcd.h from drivers/usb/core into include/linux/usb/ Signed-of-by: Eric Lescouet <eric@lescouet.org> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/c67x00/c67x00-hcd.h2
-rw-r--r--drivers/usb/core/buffer.c2
-rw-r--r--drivers/usb/core/config.c3
-rw-r--r--drivers/usb/core/devices.c2
-rw-r--r--drivers/usb/core/devio.c3
-rw-r--r--drivers/usb/core/driver.c3
-rw-r--r--drivers/usb/core/generic.c2
-rw-r--r--drivers/usb/core/hcd-pci.c2
-rw-r--r--drivers/usb/core/hcd.c3
-rw-r--r--drivers/usb/core/hcd.h578
-rw-r--r--drivers/usb/core/hub.c3
-rw-r--r--drivers/usb/core/inode.c2
-rw-r--r--drivers/usb/core/message.c2
-rw-r--r--drivers/usb/core/urb.c2
-rw-r--r--drivers/usb/core/usb.c2
-rw-r--r--drivers/usb/gadget/dummy_hcd.c4
-rw-r--r--drivers/usb/host/ehci-hcd.c3
-rw-r--r--drivers/usb/host/fhci-dbg.c2
-rw-r--r--drivers/usb/host/fhci-hcd.c2
-rw-r--r--drivers/usb/host/fhci-hub.c2
-rw-r--r--drivers/usb/host/fhci-mem.c2
-rw-r--r--drivers/usb/host/fhci-q.c2
-rw-r--r--drivers/usb/host/fhci-sched.c2
-rw-r--r--drivers/usb/host/fhci-tds.c2
-rw-r--r--drivers/usb/host/fhci.h2
-rw-r--r--drivers/usb/host/imx21-hcd.c2
-rw-r--r--drivers/usb/host/isp116x-hcd.c2
-rw-r--r--drivers/usb/host/isp1362-hcd.c2
-rw-r--r--drivers/usb/host/isp1760-hcd.c2
-rw-r--r--drivers/usb/host/isp1760-if.c2
-rw-r--r--drivers/usb/host/ohci-hcd.c2
-rw-r--r--drivers/usb/host/oxu210hp-hcd.c3
-rw-r--r--drivers/usb/host/r8a66597-hcd.c2
-rw-r--r--drivers/usb/host/sl811-hcd.c2
-rw-r--r--drivers/usb/host/u132-hcd.c2
-rw-r--r--drivers/usb/host/uhci-hcd.c2
-rw-r--r--drivers/usb/host/xhci.h2
-rw-r--r--drivers/usb/misc/ftdi-elan.c2
-rw-r--r--drivers/usb/mon/mon_main.c3
-rw-r--r--drivers/usb/musb/musb_core.h2
-rw-r--r--drivers/usb/wusbcore/wusbhc.h4
41 files changed, 43 insertions, 627 deletions
diff --git a/drivers/usb/c67x00/c67x00-hcd.h b/drivers/usb/c67x00/c67x00-hcd.h
index e8c6d94b2514..74e44621e313 100644
--- a/drivers/usb/c67x00/c67x00-hcd.h
+++ b/drivers/usb/c67x00/c67x00-hcd.h
@@ -28,7 +28,7 @@
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29#include <linux/list.h> 29#include <linux/list.h>
30#include <linux/usb.h> 30#include <linux/usb.h>
31#include "../core/hcd.h" 31#include <linux/usb/hcd.h>
32#include "c67x00.h" 32#include "c67x00.h"
33 33
34/* 34/*
diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c
index 3ba2fff71490..2c6965484fe8 100644
--- a/drivers/usb/core/buffer.c
+++ b/drivers/usb/core/buffer.c
@@ -14,7 +14,7 @@
14#include <linux/dma-mapping.h> 14#include <linux/dma-mapping.h>
15#include <linux/dmapool.h> 15#include <linux/dmapool.h>
16#include <linux/usb.h> 16#include <linux/usb.h>
17#include "hcd.h" 17#include <linux/usb/hcd.h>
18 18
19 19
20/* 20/*
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 0d3af6a6ee49..77e0dda3a2fb 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -1,12 +1,13 @@
1#include <linux/usb.h> 1#include <linux/usb.h>
2#include <linux/usb/ch9.h> 2#include <linux/usb/ch9.h>
3#include <linux/usb/hcd.h>
3#include <linux/module.h> 4#include <linux/module.h>
4#include <linux/init.h> 5#include <linux/init.h>
5#include <linux/slab.h> 6#include <linux/slab.h>
6#include <linux/device.h> 7#include <linux/device.h>
7#include <asm/byteorder.h> 8#include <asm/byteorder.h>
8#include "usb.h" 9#include "usb.h"
9#include "hcd.h" 10
10 11
11#define USB_MAXALTSETTING 128 /* Hard limit */ 12#define USB_MAXALTSETTING 128 /* Hard limit */
12#define USB_MAXENDPOINTS 30 /* Hard limit */ 13#define USB_MAXENDPOINTS 30 /* Hard limit */
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index 19bc03a9fecf..75077215a8b8 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -55,11 +55,11 @@
55#include <linux/usb.h> 55#include <linux/usb.h>
56#include <linux/smp_lock.h> 56#include <linux/smp_lock.h>
57#include <linux/usbdevice_fs.h> 57#include <linux/usbdevice_fs.h>
58#include <linux/usb/hcd.h>
58#include <linux/mutex.h> 59#include <linux/mutex.h>
59#include <asm/uaccess.h> 60#include <asm/uaccess.h>
60 61
61#include "usb.h" 62#include "usb.h"
62#include "hcd.h"
63 63
64/* Define ALLOW_SERIAL_NUMBER if you want to see the serial number of devices */ 64/* Define ALLOW_SERIAL_NUMBER if you want to see the serial number of devices */
65#define ALLOW_SERIAL_NUMBER 65#define ALLOW_SERIAL_NUMBER
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 3466fdc5bb11..c2f62a3993d2 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -43,6 +43,7 @@
43#include <linux/module.h> 43#include <linux/module.h>
44#include <linux/usb.h> 44#include <linux/usb.h>
45#include <linux/usbdevice_fs.h> 45#include <linux/usbdevice_fs.h>
46#include <linux/usb/hcd.h> /* for usbcore internals */
46#include <linux/cdev.h> 47#include <linux/cdev.h>
47#include <linux/notifier.h> 48#include <linux/notifier.h>
48#include <linux/security.h> 49#include <linux/security.h>
@@ -50,9 +51,7 @@
50#include <asm/byteorder.h> 51#include <asm/byteorder.h>
51#include <linux/moduleparam.h> 52#include <linux/moduleparam.h>
52 53
53#include "hcd.h" /* for usbcore internals */
54#include "usb.h" 54#include "usb.h"
55#include "hub.h"
56 55
57#define USB_MAXBUS 64 56#define USB_MAXBUS 64
58#define USB_DEVICE_MAX USB_MAXBUS * 128 57#define USB_DEVICE_MAX USB_MAXBUS * 128
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 2f3dc4cdf79b..edff55a32575 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -26,8 +26,9 @@
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/usb.h> 27#include <linux/usb.h>
28#include <linux/usb/quirks.h> 28#include <linux/usb/quirks.h>
29#include <linux/usb/hcd.h>
29#include <linux/pm_runtime.h> 30#include <linux/pm_runtime.h>
30#include "hcd.h" 31
31#include "usb.h" 32#include "usb.h"
32 33
33 34
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index 2c95153c0f24..9a34ccb0a1c0 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -18,8 +18,8 @@
18 */ 18 */
19 19
20#include <linux/usb.h> 20#include <linux/usb.h>
21#include <linux/usb/hcd.h>
21#include "usb.h" 22#include "usb.h"
22#include "hcd.h"
23 23
24static inline const char *plural(int n) 24static inline const char *plural(int n)
25{ 25{
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 15286533c15a..1cf2d1e79a5c 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -21,6 +21,7 @@
21#include <linux/pci.h> 21#include <linux/pci.h>
22#include <linux/pm_runtime.h> 22#include <linux/pm_runtime.h>
23#include <linux/usb.h> 23#include <linux/usb.h>
24#include <linux/usb/hcd.h>
24 25
25#include <asm/io.h> 26#include <asm/io.h>
26#include <asm/irq.h> 27#include <asm/irq.h>
@@ -33,7 +34,6 @@
33#endif 34#endif
34 35
35#include "usb.h" 36#include "usb.h"
36#include "hcd.h"
37 37
38 38
39/* PCI-based HCs are common, but plenty of non-PCI HCs are used too */ 39/* PCI-based HCs are common, but plenty of non-PCI HCs are used too */
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 2f8cedda8007..4a24843cfc61 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -42,10 +42,9 @@
42#include <linux/pm_runtime.h> 42#include <linux/pm_runtime.h>
43 43
44#include <linux/usb.h> 44#include <linux/usb.h>
45#include <linux/usb/hcd.h>
45 46
46#include "usb.h" 47#include "usb.h"
47#include "hcd.h"
48#include "hub.h"
49 48
50 49
51/*-------------------------------------------------------------------------*/ 50/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
deleted file mode 100644
index a3cdb09734ab..000000000000
--- a/drivers/usb/core/hcd.h
+++ /dev/null
@@ -1,578 +0,0 @@
1/*
2 * Copyright (c) 2001-2002 by David Brownell
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef __USB_CORE_HCD_H
20#define __USB_CORE_HCD_H
21
22#ifdef __KERNEL__
23
24#include <linux/rwsem.h>
25
26#define MAX_TOPO_LEVEL 6
27
28/* This file contains declarations of usbcore internals that are mostly
29 * used or exposed by Host Controller Drivers.
30 */
31
32/*
33 * USB Packet IDs (PIDs)
34 */
35#define USB_PID_EXT 0xf0 /* USB 2.0 LPM ECN */
36#define USB_PID_OUT 0xe1
37#define USB_PID_ACK 0xd2
38#define USB_PID_DATA0 0xc3
39#define USB_PID_PING 0xb4 /* USB 2.0 */
40#define USB_PID_SOF 0xa5
41#define USB_PID_NYET 0x96 /* USB 2.0 */
42#define USB_PID_DATA2 0x87 /* USB 2.0 */
43#define USB_PID_SPLIT 0x78 /* USB 2.0 */
44#define USB_PID_IN 0x69
45#define USB_PID_NAK 0x5a
46#define USB_PID_DATA1 0x4b
47#define USB_PID_PREAMBLE 0x3c /* Token mode */
48#define USB_PID_ERR 0x3c /* USB 2.0: handshake mode */
49#define USB_PID_SETUP 0x2d
50#define USB_PID_STALL 0x1e
51#define USB_PID_MDATA 0x0f /* USB 2.0 */
52
53/*-------------------------------------------------------------------------*/
54
55/*
56 * USB Host Controller Driver (usb_hcd) framework
57 *
58 * Since "struct usb_bus" is so thin, you can't share much code in it.
59 * This framework is a layer over that, and should be more sharable.
60 *
61 * @authorized_default: Specifies if new devices are authorized to
62 * connect by default or they require explicit
63 * user space authorization; this bit is settable
64 * through /sys/class/usb_host/X/authorized_default.
65 * For the rest is RO, so we don't lock to r/w it.
66 */
67
68/*-------------------------------------------------------------------------*/
69
70struct usb_hcd {
71
72 /*
73 * housekeeping
74 */
75 struct usb_bus self; /* hcd is-a bus */
76 struct kref kref; /* reference counter */
77
78 const char *product_desc; /* product/vendor string */
79 char irq_descr[24]; /* driver + bus # */
80
81 struct timer_list rh_timer; /* drives root-hub polling */
82 struct urb *status_urb; /* the current status urb */
83#ifdef CONFIG_USB_SUSPEND
84 struct work_struct wakeup_work; /* for remote wakeup */
85#endif
86
87 /*
88 * hardware info/state
89 */
90 const struct hc_driver *driver; /* hw-specific hooks */
91
92 /* Flags that need to be manipulated atomically */
93 unsigned long flags;
94#define HCD_FLAG_HW_ACCESSIBLE 0x00000001
95#define HCD_FLAG_SAW_IRQ 0x00000002
96
97 unsigned rh_registered:1;/* is root hub registered? */
98
99 /* The next flag is a stopgap, to be removed when all the HCDs
100 * support the new root-hub polling mechanism. */
101 unsigned uses_new_polling:1;
102 unsigned poll_rh:1; /* poll for rh status? */
103 unsigned poll_pending:1; /* status has changed? */
104 unsigned wireless:1; /* Wireless USB HCD */
105 unsigned authorized_default:1;
106 unsigned has_tt:1; /* Integrated TT in root hub */
107
108 int irq; /* irq allocated */
109 void __iomem *regs; /* device memory/io */
110 u64 rsrc_start; /* memory/io resource start */
111 u64 rsrc_len; /* memory/io resource length */
112 unsigned power_budget; /* in mA, 0 = no limit */
113
114 /* bandwidth_mutex should be taken before adding or removing
115 * any new bus bandwidth constraints:
116 * 1. Before adding a configuration for a new device.
117 * 2. Before removing the configuration to put the device into
118 * the addressed state.
119 * 3. Before selecting a different configuration.
120 * 4. Before selecting an alternate interface setting.
121 *
122 * bandwidth_mutex should be dropped after a successful control message
123 * to the device, or resetting the bandwidth after a failed attempt.
124 */
125 struct mutex bandwidth_mutex;
126
127
128#define HCD_BUFFER_POOLS 4
129 struct dma_pool *pool [HCD_BUFFER_POOLS];
130
131 int state;
132# define __ACTIVE 0x01
133# define __SUSPEND 0x04
134# define __TRANSIENT 0x80
135
136# define HC_STATE_HALT 0
137# define HC_STATE_RUNNING (__ACTIVE)
138# define HC_STATE_QUIESCING (__SUSPEND|__TRANSIENT|__ACTIVE)
139# define HC_STATE_RESUMING (__SUSPEND|__TRANSIENT)
140# define HC_STATE_SUSPENDED (__SUSPEND)
141
142#define HC_IS_RUNNING(state) ((state) & __ACTIVE)
143#define HC_IS_SUSPENDED(state) ((state) & __SUSPEND)
144
145 /* more shared queuing code would be good; it should support
146 * smarter scheduling, handle transaction translators, etc;
147 * input size of periodic table to an interrupt scheduler.
148 * (ohci 32, uhci 1024, ehci 256/512/1024).
149 */
150
151 /* The HC driver's private data is stored at the end of
152 * this structure.
153 */
154 unsigned long hcd_priv[0]
155 __attribute__ ((aligned(sizeof(unsigned long))));
156};
157
158/* 2.4 does this a bit differently ... */
159static inline struct usb_bus *hcd_to_bus(struct usb_hcd *hcd)
160{
161 return &hcd->self;
162}
163
164static inline struct usb_hcd *bus_to_hcd(struct usb_bus *bus)
165{
166 return container_of(bus, struct usb_hcd, self);
167}
168
169struct hcd_timeout { /* timeouts we allocate */
170 struct list_head timeout_list;
171 struct timer_list timer;
172};
173
174/*-------------------------------------------------------------------------*/
175
176
177struct hc_driver {
178 const char *description; /* "ehci-hcd" etc */
179 const char *product_desc; /* product/vendor string */
180 size_t hcd_priv_size; /* size of private data */
181
182 /* irq handler */
183 irqreturn_t (*irq) (struct usb_hcd *hcd);
184
185 int flags;
186#define HCD_MEMORY 0x0001 /* HC regs use memory (else I/O) */
187#define HCD_LOCAL_MEM 0x0002 /* HC needs local memory */
188#define HCD_USB11 0x0010 /* USB 1.1 */
189#define HCD_USB2 0x0020 /* USB 2.0 */
190#define HCD_USB3 0x0040 /* USB 3.0 */
191#define HCD_MASK 0x0070
192
193 /* called to init HCD and root hub */
194 int (*reset) (struct usb_hcd *hcd);
195 int (*start) (struct usb_hcd *hcd);
196
197 /* NOTE: these suspend/resume calls relate to the HC as
198 * a whole, not just the root hub; they're for PCI bus glue.
199 */
200 /* called after suspending the hub, before entering D3 etc */
201 int (*pci_suspend)(struct usb_hcd *hcd);
202
203 /* called after entering D0 (etc), before resuming the hub */
204 int (*pci_resume)(struct usb_hcd *hcd, bool hibernated);
205
206 /* cleanly make HCD stop writing memory and doing I/O */
207 void (*stop) (struct usb_hcd *hcd);
208
209 /* shutdown HCD */
210 void (*shutdown) (struct usb_hcd *hcd);
211
212 /* return current frame number */
213 int (*get_frame_number) (struct usb_hcd *hcd);
214
215 /* manage i/o requests, device state */
216 int (*urb_enqueue)(struct usb_hcd *hcd,
217 struct urb *urb, gfp_t mem_flags);
218 int (*urb_dequeue)(struct usb_hcd *hcd,
219 struct urb *urb, int status);
220
221 /* hw synch, freeing endpoint resources that urb_dequeue can't */
222 void (*endpoint_disable)(struct usb_hcd *hcd,
223 struct usb_host_endpoint *ep);
224
225 /* (optional) reset any endpoint state such as sequence number
226 and current window */
227 void (*endpoint_reset)(struct usb_hcd *hcd,
228 struct usb_host_endpoint *ep);
229
230 /* root hub support */
231 int (*hub_status_data) (struct usb_hcd *hcd, char *buf);
232 int (*hub_control) (struct usb_hcd *hcd,
233 u16 typeReq, u16 wValue, u16 wIndex,
234 char *buf, u16 wLength);
235 int (*bus_suspend)(struct usb_hcd *);
236 int (*bus_resume)(struct usb_hcd *);
237 int (*start_port_reset)(struct usb_hcd *, unsigned port_num);
238
239 /* force handover of high-speed port to full-speed companion */
240 void (*relinquish_port)(struct usb_hcd *, int);
241 /* has a port been handed over to a companion? */
242 int (*port_handed_over)(struct usb_hcd *, int);
243
244 /* CLEAR_TT_BUFFER completion callback */
245 void (*clear_tt_buffer_complete)(struct usb_hcd *,
246 struct usb_host_endpoint *);
247
248 /* xHCI specific functions */
249 /* Called by usb_alloc_dev to alloc HC device structures */
250 int (*alloc_dev)(struct usb_hcd *, struct usb_device *);
251 /* Called by usb_disconnect to free HC device structures */
252 void (*free_dev)(struct usb_hcd *, struct usb_device *);
253
254 /* Bandwidth computation functions */
255 /* Note that add_endpoint() can only be called once per endpoint before
256 * check_bandwidth() or reset_bandwidth() must be called.
257 * drop_endpoint() can only be called once per endpoint also.
258 * A call to xhci_drop_endpoint() followed by a call to xhci_add_endpoint() will
259 * add the endpoint to the schedule with possibly new parameters denoted by a
260 * different endpoint descriptor in usb_host_endpoint.
261 * A call to xhci_add_endpoint() followed by a call to xhci_drop_endpoint() is
262 * not allowed.
263 */
264 /* Allocate endpoint resources and add them to a new schedule */
265 int (*add_endpoint)(struct usb_hcd *, struct usb_device *, struct usb_host_endpoint *);
266 /* Drop an endpoint from a new schedule */
267 int (*drop_endpoint)(struct usb_hcd *, struct usb_device *, struct usb_host_endpoint *);
268 /* Check that a new hardware configuration, set using
269 * endpoint_enable and endpoint_disable, does not exceed bus
270 * bandwidth. This must be called before any set configuration
271 * or set interface requests are sent to the device.
272 */
273 int (*check_bandwidth)(struct usb_hcd *, struct usb_device *);
274 /* Reset the device schedule to the last known good schedule,
275 * which was set from a previous successful call to
276 * check_bandwidth(). This reverts any add_endpoint() and
277 * drop_endpoint() calls since that last successful call.
278 * Used for when a check_bandwidth() call fails due to resource
279 * or bandwidth constraints.
280 */
281 void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *);
282 /* Returns the hardware-chosen device address */
283 int (*address_device)(struct usb_hcd *, struct usb_device *udev);
284 /* Notifies the HCD after a hub descriptor is fetched.
285 * Will block.
286 */
287 int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev,
288 struct usb_tt *tt, gfp_t mem_flags);
289 int (*reset_device)(struct usb_hcd *, struct usb_device *);
290};
291
292extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
293extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb,
294 int status);
295extern void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd, struct urb *urb);
296
297extern int usb_hcd_submit_urb(struct urb *urb, gfp_t mem_flags);
298extern int usb_hcd_unlink_urb(struct urb *urb, int status);
299extern void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb,
300 int status);
301extern void usb_hcd_flush_endpoint(struct usb_device *udev,
302 struct usb_host_endpoint *ep);
303extern void usb_hcd_disable_endpoint(struct usb_device *udev,
304 struct usb_host_endpoint *ep);
305extern void usb_hcd_reset_endpoint(struct usb_device *udev,
306 struct usb_host_endpoint *ep);
307extern void usb_hcd_synchronize_unlinks(struct usb_device *udev);
308extern int usb_hcd_alloc_bandwidth(struct usb_device *udev,
309 struct usb_host_config *new_config,
310 struct usb_host_interface *old_alt,
311 struct usb_host_interface *new_alt);
312extern int usb_hcd_get_frame_number(struct usb_device *udev);
313
314extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver,
315 struct device *dev, const char *bus_name);
316extern struct usb_hcd *usb_get_hcd(struct usb_hcd *hcd);
317extern void usb_put_hcd(struct usb_hcd *hcd);
318extern int usb_add_hcd(struct usb_hcd *hcd,
319 unsigned int irqnum, unsigned long irqflags);
320extern void usb_remove_hcd(struct usb_hcd *hcd);
321
322struct platform_device;
323extern void usb_hcd_platform_shutdown(struct platform_device *dev);
324
325#ifdef CONFIG_PCI
326struct pci_dev;
327struct pci_device_id;
328extern int usb_hcd_pci_probe(struct pci_dev *dev,
329 const struct pci_device_id *id);
330extern void usb_hcd_pci_remove(struct pci_dev *dev);
331extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
332
333#ifdef CONFIG_PM_SLEEP
334extern const struct dev_pm_ops usb_hcd_pci_pm_ops;
335#endif
336#endif /* CONFIG_PCI */
337
338/* pci-ish (pdev null is ok) buffer alloc/mapping support */
339int hcd_buffer_create(struct usb_hcd *hcd);
340void hcd_buffer_destroy(struct usb_hcd *hcd);
341
342void *hcd_buffer_alloc(struct usb_bus *bus, size_t size,
343 gfp_t mem_flags, dma_addr_t *dma);
344void hcd_buffer_free(struct usb_bus *bus, size_t size,
345 void *addr, dma_addr_t dma);
346
347/* generic bus glue, needed for host controllers that don't use PCI */
348extern irqreturn_t usb_hcd_irq(int irq, void *__hcd);
349
350extern void usb_hc_died(struct usb_hcd *hcd);
351extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd);
352
353/* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */
354#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1)
355#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep)))
356#define usb_settoggle(dev, ep, out, bit) \
357 ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | \
358 ((bit) << (ep)))
359
360/* -------------------------------------------------------------------------- */
361
362/* Enumeration is only for the hub driver, or HCD virtual root hubs */
363extern struct usb_device *usb_alloc_dev(struct usb_device *parent,
364 struct usb_bus *, unsigned port);
365extern int usb_new_device(struct usb_device *dev);
366extern void usb_disconnect(struct usb_device **);
367
368extern int usb_get_configuration(struct usb_device *dev);
369extern void usb_destroy_configuration(struct usb_device *dev);
370
371/*-------------------------------------------------------------------------*/
372
373/*
374 * HCD Root Hub support
375 */
376
377#include "hub.h"
378
379/* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */
380#define DeviceRequest \
381 ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)
382#define DeviceOutRequest \
383 ((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)
384
385#define InterfaceRequest \
386 ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
387
388#define EndpointRequest \
389 ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
390#define EndpointOutRequest \
391 ((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
392
393/* class requests from the USB 2.0 hub spec, table 11-15 */
394/* GetBusState and SetHubDescriptor are optional, omitted */
395#define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE)
396#define ClearPortFeature (0x2300 | USB_REQ_CLEAR_FEATURE)
397#define GetHubDescriptor (0xa000 | USB_REQ_GET_DESCRIPTOR)
398#define GetHubStatus (0xa000 | USB_REQ_GET_STATUS)
399#define GetPortStatus (0xa300 | USB_REQ_GET_STATUS)
400#define SetHubFeature (0x2000 | USB_REQ_SET_FEATURE)
401#define SetPortFeature (0x2300 | USB_REQ_SET_FEATURE)
402
403
404/*-------------------------------------------------------------------------*/
405
406/*
407 * Generic bandwidth allocation constants/support
408 */
409#define FRAME_TIME_USECS 1000L
410#define BitTime(bytecount) (7 * 8 * bytecount / 6) /* with integer truncation */
411 /* Trying not to use worst-case bit-stuffing
412 * of (7/6 * 8 * bytecount) = 9.33 * bytecount */
413 /* bytecount = data payload byte count */
414
415#define NS_TO_US(ns) ((ns + 500L) / 1000L)
416 /* convert & round nanoseconds to microseconds */
417
418
419/*
420 * Full/low speed bandwidth allocation constants/support.
421 */
422#define BW_HOST_DELAY 1000L /* nanoseconds */
423#define BW_HUB_LS_SETUP 333L /* nanoseconds */
424 /* 4 full-speed bit times (est.) */
425
426#define FRAME_TIME_BITS 12000L /* frame = 1 millisecond */
427#define FRAME_TIME_MAX_BITS_ALLOC (90L * FRAME_TIME_BITS / 100L)
428#define FRAME_TIME_MAX_USECS_ALLOC (90L * FRAME_TIME_USECS / 100L)
429
430/*
431 * Ceiling [nano/micro]seconds (typical) for that many bytes at high speed
432 * ISO is a bit less, no ACK ... from USB 2.0 spec, 5.11.3 (and needed
433 * to preallocate bandwidth)
434 */
435#define USB2_HOST_DELAY 5 /* nsec, guess */
436#define HS_NSECS(bytes) (((55 * 8 * 2083) \
437 + (2083UL * (3 + BitTime(bytes))))/1000 \
438 + USB2_HOST_DELAY)
439#define HS_NSECS_ISO(bytes) (((38 * 8 * 2083) \
440 + (2083UL * (3 + BitTime(bytes))))/1000 \
441 + USB2_HOST_DELAY)
442#define HS_USECS(bytes) NS_TO_US (HS_NSECS(bytes))
443#define HS_USECS_ISO(bytes) NS_TO_US (HS_NSECS_ISO(bytes))
444
445extern long usb_calc_bus_time(int speed, int is_input,
446 int isoc, int bytecount);
447
448/*-------------------------------------------------------------------------*/
449
450extern void usb_set_device_state(struct usb_device *udev,
451 enum usb_device_state new_state);
452
453/*-------------------------------------------------------------------------*/
454
455/* exported only within usbcore */
456
457extern struct list_head usb_bus_list;
458extern struct mutex usb_bus_list_lock;
459extern wait_queue_head_t usb_kill_urb_queue;
460
461extern int usb_find_interface_driver(struct usb_device *dev,
462 struct usb_interface *interface);
463
464#define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN))
465
466#ifdef CONFIG_PM
467extern void usb_root_hub_lost_power(struct usb_device *rhdev);
468extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg);
469extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg);
470#endif /* CONFIG_PM */
471
472#ifdef CONFIG_USB_SUSPEND
473extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd);
474#else
475static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd)
476{
477 return;
478}
479#endif /* CONFIG_USB_SUSPEND */
480
481
482/*
483 * USB device fs stuff
484 */
485
486#ifdef CONFIG_USB_DEVICEFS
487
488/*
489 * these are expected to be called from the USB core/hub thread
490 * with the kernel lock held
491 */
492extern void usbfs_update_special(void);
493extern int usbfs_init(void);
494extern void usbfs_cleanup(void);
495
496#else /* CONFIG_USB_DEVICEFS */
497
498static inline void usbfs_update_special(void) {}
499static inline int usbfs_init(void) { return 0; }
500static inline void usbfs_cleanup(void) { }
501
502#endif /* CONFIG_USB_DEVICEFS */
503
504/*-------------------------------------------------------------------------*/
505
506#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
507
508struct usb_mon_operations {
509 void (*urb_submit)(struct usb_bus *bus, struct urb *urb);
510 void (*urb_submit_error)(struct usb_bus *bus, struct urb *urb, int err);
511 void (*urb_complete)(struct usb_bus *bus, struct urb *urb, int status);
512 /* void (*urb_unlink)(struct usb_bus *bus, struct urb *urb); */
513};
514
515extern struct usb_mon_operations *mon_ops;
516
517static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb)
518{
519 if (bus->monitored)
520 (*mon_ops->urb_submit)(bus, urb);
521}
522
523static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb,
524 int error)
525{
526 if (bus->monitored)
527 (*mon_ops->urb_submit_error)(bus, urb, error);
528}
529
530static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
531 int status)
532{
533 if (bus->monitored)
534 (*mon_ops->urb_complete)(bus, urb, status);
535}
536
537int usb_mon_register(struct usb_mon_operations *ops);
538void usb_mon_deregister(void);
539
540#else
541
542static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb) {}
543static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb,
544 int error) {}
545static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
546 int status) {}
547
548#endif /* CONFIG_USB_MON || CONFIG_USB_MON_MODULE */
549
550/*-------------------------------------------------------------------------*/
551
552/* hub.h ... DeviceRemovable in 2.4.2-ac11, gone in 2.4.10 */
553/* bleech -- resurfaced in 2.4.11 or 2.4.12 */
554#define bitmap DeviceRemovable
555
556
557/*-------------------------------------------------------------------------*/
558
559/* random stuff */
560
561#define RUN_CONTEXT (in_irq() ? "in_irq" \
562 : (in_interrupt() ? "in_interrupt" : "can sleep"))
563
564
565/* This rwsem is for use only by the hub driver and ehci-hcd.
566 * Nobody else should touch it.
567 */
568extern struct rw_semaphore ehci_cf_port_reset_rwsem;
569
570/* Keep track of which host controller drivers are loaded */
571#define USB_UHCI_LOADED 0
572#define USB_OHCI_LOADED 1
573#define USB_EHCI_LOADED 2
574extern unsigned long usb_hcds_loaded;
575
576#endif /* __KERNEL__ */
577
578#endif /* __USB_CORE_HCD_H */
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 0940ccd6f4f4..1883c3c7b69b 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -19,6 +19,7 @@
19#include <linux/ioctl.h> 19#include <linux/ioctl.h>
20#include <linux/usb.h> 20#include <linux/usb.h>
21#include <linux/usbdevice_fs.h> 21#include <linux/usbdevice_fs.h>
22#include <linux/usb/hcd.h>
22#include <linux/kthread.h> 23#include <linux/kthread.h>
23#include <linux/mutex.h> 24#include <linux/mutex.h>
24#include <linux/freezer.h> 25#include <linux/freezer.h>
@@ -28,8 +29,6 @@
28#include <asm/byteorder.h> 29#include <asm/byteorder.h>
29 30
30#include "usb.h" 31#include "usb.h"
31#include "hcd.h"
32#include "hub.h"
33 32
34/* if we are in debug mode, always announce new devices */ 33/* if we are in debug mode, always announce new devices */
35#ifdef DEBUG 34#ifdef DEBUG
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index 111a01a747fc..1a27618b67d6 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -40,9 +40,9 @@
40#include <linux/notifier.h> 40#include <linux/notifier.h>
41#include <linux/seq_file.h> 41#include <linux/seq_file.h>
42#include <linux/smp_lock.h> 42#include <linux/smp_lock.h>
43#include <linux/usb/hcd.h>
43#include <asm/byteorder.h> 44#include <asm/byteorder.h>
44#include "usb.h" 45#include "usb.h"
45#include "hcd.h"
46 46
47#define USBFS_DEFAULT_DEVMODE (S_IWUSR | S_IRUGO) 47#define USBFS_DEFAULT_DEVMODE (S_IWUSR | S_IRUGO)
48#define USBFS_DEFAULT_BUSMODE (S_IXUGO | S_IRUGO) 48#define USBFS_DEFAULT_BUSMODE (S_IXUGO | S_IRUGO)
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index cd220277c6c3..619c44fb8a96 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -14,9 +14,9 @@
14#include <linux/device.h> 14#include <linux/device.h>
15#include <linux/scatterlist.h> 15#include <linux/scatterlist.h>
16#include <linux/usb/quirks.h> 16#include <linux/usb/quirks.h>
17#include <linux/usb/hcd.h> /* for usbcore internals */
17#include <asm/byteorder.h> 18#include <asm/byteorder.h>
18 19
19#include "hcd.h" /* for usbcore internals */
20#include "usb.h" 20#include "usb.h"
21 21
22static void cancel_async_set_config(struct usb_device *udev); 22static void cancel_async_set_config(struct usb_device *udev);
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index 45a32dadb406..09301f4b7225 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -6,7 +6,7 @@
6#include <linux/log2.h> 6#include <linux/log2.h>
7#include <linux/usb.h> 7#include <linux/usb.h>
8#include <linux/wait.h> 8#include <linux/wait.h>
9#include "hcd.h" 9#include <linux/usb/hcd.h>
10 10
11#define to_urb(d) container_of(d, struct urb, kref) 11#define to_urb(d) container_of(d, struct urb, kref)
12 12
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 0561430f2ede..1088abb4416c 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -32,6 +32,7 @@
32#include <linux/spinlock.h> 32#include <linux/spinlock.h>
33#include <linux/errno.h> 33#include <linux/errno.h>
34#include <linux/usb.h> 34#include <linux/usb.h>
35#include <linux/usb/hcd.h>
35#include <linux/mutex.h> 36#include <linux/mutex.h>
36#include <linux/workqueue.h> 37#include <linux/workqueue.h>
37#include <linux/debugfs.h> 38#include <linux/debugfs.h>
@@ -41,7 +42,6 @@
41#include <linux/mm.h> 42#include <linux/mm.h>
42#include <linux/dma-mapping.h> 43#include <linux/dma-mapping.h>
43 44
44#include "hcd.h"
45#include "usb.h" 45#include "usb.h"
46 46
47 47
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 5e0966485188..4f9e578cde9d 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -47,6 +47,7 @@
47#include <linux/platform_device.h> 47#include <linux/platform_device.h>
48#include <linux/usb.h> 48#include <linux/usb.h>
49#include <linux/usb/gadget.h> 49#include <linux/usb/gadget.h>
50#include <linux/usb/hcd.h>
50 51
51#include <asm/byteorder.h> 52#include <asm/byteorder.h>
52#include <asm/io.h> 53#include <asm/io.h>
@@ -55,9 +56,6 @@
55#include <asm/unaligned.h> 56#include <asm/unaligned.h>
56 57
57 58
58#include "../core/hcd.h"
59
60
61#define DRIVER_DESC "USB Host+Gadget Emulator" 59#define DRIVER_DESC "USB Host+Gadget Emulator"
62#define DRIVER_VERSION "02 May 2005" 60#define DRIVER_VERSION "02 May 2005"
63 61
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 13ead00aecd5..ef3e88f0b3c3 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -31,13 +31,12 @@
31#include <linux/list.h> 31#include <linux/list.h>
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/usb.h> 33#include <linux/usb.h>
34#include <linux/usb/hcd.h>
34#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
35#include <linux/dma-mapping.h> 36#include <linux/dma-mapping.h>
36#include <linux/debugfs.h> 37#include <linux/debugfs.h>
37#include <linux/slab.h> 38#include <linux/slab.h>
38 39
39#include "../core/hcd.h"
40
41#include <asm/byteorder.h> 40#include <asm/byteorder.h>
42#include <asm/io.h> 41#include <asm/io.h>
43#include <asm/irq.h> 42#include <asm/irq.h>
diff --git a/drivers/usb/host/fhci-dbg.c b/drivers/usb/host/fhci-dbg.c
index e799f86dab11..6fe550049119 100644
--- a/drivers/usb/host/fhci-dbg.c
+++ b/drivers/usb/host/fhci-dbg.c
@@ -20,7 +20,7 @@
20#include <linux/debugfs.h> 20#include <linux/debugfs.h>
21#include <linux/seq_file.h> 21#include <linux/seq_file.h>
22#include <linux/usb.h> 22#include <linux/usb.h>
23#include "../core/hcd.h" 23#include <linux/usb/hcd.h>
24#include "fhci.h" 24#include "fhci.h"
25 25
26void fhci_dbg_isr(struct fhci_hcd *fhci, int usb_er) 26void fhci_dbg_isr(struct fhci_hcd *fhci, int usb_er)
diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c
index 15379c636143..90453379a434 100644
--- a/drivers/usb/host/fhci-hcd.c
+++ b/drivers/usb/host/fhci-hcd.c
@@ -25,12 +25,12 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/usb.h> 27#include <linux/usb.h>
28#include <linux/usb/hcd.h>
28#include <linux/of_platform.h> 29#include <linux/of_platform.h>
29#include <linux/of_gpio.h> 30#include <linux/of_gpio.h>
30#include <linux/slab.h> 31#include <linux/slab.h>
31#include <asm/qe.h> 32#include <asm/qe.h>
32#include <asm/fsl_gtm.h> 33#include <asm/fsl_gtm.h>
33#include "../core/hcd.h"
34#include "fhci.h" 34#include "fhci.h"
35 35
36void fhci_start_sof_timer(struct fhci_hcd *fhci) 36void fhci_start_sof_timer(struct fhci_hcd *fhci)
diff --git a/drivers/usb/host/fhci-hub.c b/drivers/usb/host/fhci-hub.c
index 0cfaedc3e124..348fe62e94f7 100644
--- a/drivers/usb/host/fhci-hub.c
+++ b/drivers/usb/host/fhci-hub.c
@@ -22,9 +22,9 @@
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/usb.h> 24#include <linux/usb.h>
25#include <linux/usb/hcd.h>
25#include <linux/gpio.h> 26#include <linux/gpio.h>
26#include <asm/qe.h> 27#include <asm/qe.h>
27#include "../core/hcd.h"
28#include "fhci.h" 28#include "fhci.h"
29 29
30/* virtual root hub specific descriptor */ 30/* virtual root hub specific descriptor */
diff --git a/drivers/usb/host/fhci-mem.c b/drivers/usb/host/fhci-mem.c
index 5591bfb499d1..b0b88f57a5ac 100644
--- a/drivers/usb/host/fhci-mem.c
+++ b/drivers/usb/host/fhci-mem.c
@@ -21,7 +21,7 @@
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/usb.h> 23#include <linux/usb.h>
24#include "../core/hcd.h" 24#include <linux/usb/hcd.h>
25#include "fhci.h" 25#include "fhci.h"
26 26
27static void init_td(struct td *td) 27static void init_td(struct td *td)
diff --git a/drivers/usb/host/fhci-q.c b/drivers/usb/host/fhci-q.c
index f73c92359beb..03be7494a476 100644
--- a/drivers/usb/host/fhci-q.c
+++ b/drivers/usb/host/fhci-q.c
@@ -22,7 +22,7 @@
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/list.h> 23#include <linux/list.h>
24#include <linux/usb.h> 24#include <linux/usb.h>
25#include "../core/hcd.h" 25#include <linux/usb/hcd.h>
26#include "fhci.h" 26#include "fhci.h"
27 27
28/* maps the hardware error code to the USB error code */ 28/* maps the hardware error code to the USB error code */
diff --git a/drivers/usb/host/fhci-sched.c b/drivers/usb/host/fhci-sched.c
index ff43747a614f..4f2cbdcc0273 100644
--- a/drivers/usb/host/fhci-sched.c
+++ b/drivers/usb/host/fhci-sched.c
@@ -24,9 +24,9 @@
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/usb.h> 26#include <linux/usb.h>
27#include <linux/usb/hcd.h>
27#include <asm/qe.h> 28#include <asm/qe.h>
28#include <asm/fsl_gtm.h> 29#include <asm/fsl_gtm.h>
29#include "../core/hcd.h"
30#include "fhci.h" 30#include "fhci.h"
31 31
32static void recycle_frame(struct fhci_usb *usb, struct packet *pkt) 32static void recycle_frame(struct fhci_usb *usb, struct packet *pkt)
diff --git a/drivers/usb/host/fhci-tds.c b/drivers/usb/host/fhci-tds.c
index 57013479d7f7..7be548ca2183 100644
--- a/drivers/usb/host/fhci-tds.c
+++ b/drivers/usb/host/fhci-tds.c
@@ -22,7 +22,7 @@
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/usb.h> 24#include <linux/usb.h>
25#include "../core/hcd.h" 25#include <linux/usb/hcd.h>
26#include "fhci.h" 26#include "fhci.h"
27 27
28#define DUMMY_BD_BUFFER 0xdeadbeef 28#define DUMMY_BD_BUFFER 0xdeadbeef
diff --git a/drivers/usb/host/fhci.h b/drivers/usb/host/fhci.h
index 72dae1c5ab38..649ab07308f2 100644
--- a/drivers/usb/host/fhci.h
+++ b/drivers/usb/host/fhci.h
@@ -25,8 +25,8 @@
25#include <linux/kfifo.h> 25#include <linux/kfifo.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/usb.h> 27#include <linux/usb.h>
28#include <linux/usb/hcd.h>
28#include <asm/qe.h> 29#include <asm/qe.h>
29#include "../core/hcd.h"
30 30
31#define USB_CLOCK 48000000 31#define USB_CLOCK 48000000
32 32
diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c
index 8a12f297645f..ca0e98d8e1f4 100644
--- a/drivers/usb/host/imx21-hcd.c
+++ b/drivers/usb/host/imx21-hcd.c
@@ -56,8 +56,8 @@
56#include <linux/platform_device.h> 56#include <linux/platform_device.h>
57#include <linux/slab.h> 57#include <linux/slab.h>
58#include <linux/usb.h> 58#include <linux/usb.h>
59#include <linux/usb/hcd.h>
59 60
60#include "../core/hcd.h"
61#include "imx21-hcd.h" 61#include "imx21-hcd.h"
62 62
63#ifdef DEBUG 63#ifdef DEBUG
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 92de71dc7729..d9e82123de2a 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -65,6 +65,7 @@
65#include <linux/slab.h> 65#include <linux/slab.h>
66#include <linux/usb.h> 66#include <linux/usb.h>
67#include <linux/usb/isp116x.h> 67#include <linux/usb/isp116x.h>
68#include <linux/usb/hcd.h>
68#include <linux/platform_device.h> 69#include <linux/platform_device.h>
69 70
70#include <asm/io.h> 71#include <asm/io.h>
@@ -72,7 +73,6 @@
72#include <asm/system.h> 73#include <asm/system.h>
73#include <asm/byteorder.h> 74#include <asm/byteorder.h>
74 75
75#include "../core/hcd.h"
76#include "isp116x.h" 76#include "isp116x.h"
77 77
78#define DRIVER_VERSION "03 Nov 2005" 78#define DRIVER_VERSION "03 Nov 2005"
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
index 217fb5170200..acc157da7275 100644
--- a/drivers/usb/host/isp1362-hcd.c
+++ b/drivers/usb/host/isp1362-hcd.c
@@ -77,6 +77,7 @@
77#include <linux/interrupt.h> 77#include <linux/interrupt.h>
78#include <linux/usb.h> 78#include <linux/usb.h>
79#include <linux/usb/isp1362.h> 79#include <linux/usb/isp1362.h>
80#include <linux/usb/hcd.h>
80#include <linux/platform_device.h> 81#include <linux/platform_device.h>
81#include <linux/pm.h> 82#include <linux/pm.h>
82#include <linux/io.h> 83#include <linux/io.h>
@@ -95,7 +96,6 @@ module_param(dbg_level, int, 0);
95#define STUB_DEBUG_FILE 96#define STUB_DEBUG_FILE
96#endif 97#endif
97 98
98#include "../core/hcd.h"
99#include "../core/usb.h" 99#include "../core/usb.h"
100#include "isp1362.h" 100#include "isp1362.h"
101 101
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
index 9f01293600b0..c7ac1d97d176 100644
--- a/drivers/usb/host/isp1760-hcd.c
+++ b/drivers/usb/host/isp1760-hcd.c
@@ -14,6 +14,7 @@
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/usb.h> 16#include <linux/usb.h>
17#include <linux/usb/hcd.h>
17#include <linux/debugfs.h> 18#include <linux/debugfs.h>
18#include <linux/uaccess.h> 19#include <linux/uaccess.h>
19#include <linux/io.h> 20#include <linux/io.h>
@@ -21,7 +22,6 @@
21#include <asm/unaligned.h> 22#include <asm/unaligned.h>
22#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
23 24
24#include "../core/hcd.h"
25#include "isp1760-hcd.h" 25#include "isp1760-hcd.h"
26 26
27static struct kmem_cache *qtd_cachep; 27static struct kmem_cache *qtd_cachep;
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c
index 4293cfd28d61..42a094605c92 100644
--- a/drivers/usb/host/isp1760-if.c
+++ b/drivers/usb/host/isp1760-if.c
@@ -13,8 +13,8 @@
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/usb/isp1760.h> 15#include <linux/usb/isp1760.h>
16#include <linux/usb/hcd.h>
16 17
17#include "../core/hcd.h"
18#include "isp1760-hcd.h" 18#include "isp1760-hcd.h"
19 19
20#ifdef CONFIG_PPC_OF 20#ifdef CONFIG_PPC_OF
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index afe59be23645..d15d2478493e 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -32,6 +32,7 @@
32#include <linux/list.h> 32#include <linux/list.h>
33#include <linux/usb.h> 33#include <linux/usb.h>
34#include <linux/usb/otg.h> 34#include <linux/usb/otg.h>
35#include <linux/usb/hcd.h>
35#include <linux/dma-mapping.h> 36#include <linux/dma-mapping.h>
36#include <linux/dmapool.h> 37#include <linux/dmapool.h>
37#include <linux/workqueue.h> 38#include <linux/workqueue.h>
@@ -43,7 +44,6 @@
43#include <asm/unaligned.h> 44#include <asm/unaligned.h>
44#include <asm/byteorder.h> 45#include <asm/byteorder.h>
45 46
46#include "../core/hcd.h"
47 47
48#define DRIVER_AUTHOR "Roman Weissgaerber, David Brownell" 48#define DRIVER_AUTHOR "Roman Weissgaerber, David Brownell"
49#define DRIVER_DESC "USB 1.1 'Open' Host Controller (OHCI) Driver" 49#define DRIVER_DESC "USB 1.1 'Open' Host Controller (OHCI) Driver"
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index e62b30b3e429..2891203200ce 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -34,12 +34,11 @@
34#include <linux/list.h> 34#include <linux/list.h>
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/usb.h> 36#include <linux/usb.h>
37#include <linux/usb/hcd.h>
37#include <linux/moduleparam.h> 38#include <linux/moduleparam.h>
38#include <linux/dma-mapping.h> 39#include <linux/dma-mapping.h>
39#include <linux/io.h> 40#include <linux/io.h>
40 41
41#include "../core/hcd.h"
42
43#include <asm/irq.h> 42#include <asm/irq.h>
44#include <asm/system.h> 43#include <asm/system.h>
45#include <asm/unaligned.h> 44#include <asm/unaligned.h>
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index d478ffad59b4..1398de140ead 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -33,6 +33,7 @@
33#include <linux/list.h> 33#include <linux/list.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/usb.h> 35#include <linux/usb.h>
36#include <linux/usb/hcd.h>
36#include <linux/platform_device.h> 37#include <linux/platform_device.h>
37#include <linux/io.h> 38#include <linux/io.h>
38#include <linux/mm.h> 39#include <linux/mm.h>
@@ -40,7 +41,6 @@
40#include <linux/slab.h> 41#include <linux/slab.h>
41#include <asm/cacheflush.h> 42#include <asm/cacheflush.h>
42 43
43#include "../core/hcd.h"
44#include "r8a66597.h" 44#include "r8a66597.h"
45 45
46MODULE_DESCRIPTION("R8A66597 USB Host Controller Driver"); 46MODULE_DESCRIPTION("R8A66597 USB Host Controller Driver");
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 3b867a8af7b2..8f2f477890c4 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -45,6 +45,7 @@
45#include <linux/interrupt.h> 45#include <linux/interrupt.h>
46#include <linux/usb.h> 46#include <linux/usb.h>
47#include <linux/usb/sl811.h> 47#include <linux/usb/sl811.h>
48#include <linux/usb/hcd.h>
48#include <linux/platform_device.h> 49#include <linux/platform_device.h>
49 50
50#include <asm/io.h> 51#include <asm/io.h>
@@ -53,7 +54,6 @@
53#include <asm/byteorder.h> 54#include <asm/byteorder.h>
54#include <asm/unaligned.h> 55#include <asm/unaligned.h>
55 56
56#include "../core/hcd.h"
57#include "sl811.h" 57#include "sl811.h"
58 58
59 59
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index 228f2b070f2b..fbd7adafd61c 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -49,6 +49,7 @@
49#include <linux/list.h> 49#include <linux/list.h>
50#include <linux/interrupt.h> 50#include <linux/interrupt.h>
51#include <linux/usb.h> 51#include <linux/usb.h>
52#include <linux/usb/hcd.h>
52#include <linux/workqueue.h> 53#include <linux/workqueue.h>
53#include <linux/platform_device.h> 54#include <linux/platform_device.h>
54#include <linux/mutex.h> 55#include <linux/mutex.h>
@@ -56,7 +57,6 @@
56#include <asm/irq.h> 57#include <asm/irq.h>
57#include <asm/system.h> 58#include <asm/system.h>
58#include <asm/byteorder.h> 59#include <asm/byteorder.h>
59#include "../core/hcd.h"
60 60
61 /* FIXME ohci.h is ONLY for internal use by the OHCI driver. 61 /* FIXME ohci.h is ONLY for internal use by the OHCI driver.
62 * If you're going to try stuff like this, you need to split 62 * If you're going to try stuff like this, you need to split
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index 09197067fe6b..6637e52736dd 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -38,6 +38,7 @@
38#include <linux/dmapool.h> 38#include <linux/dmapool.h>
39#include <linux/dma-mapping.h> 39#include <linux/dma-mapping.h>
40#include <linux/usb.h> 40#include <linux/usb.h>
41#include <linux/usb/hcd.h>
41#include <linux/bitops.h> 42#include <linux/bitops.h>
42#include <linux/dmi.h> 43#include <linux/dmi.h>
43 44
@@ -46,7 +47,6 @@
46#include <asm/irq.h> 47#include <asm/irq.h>
47#include <asm/system.h> 48#include <asm/system.h>
48 49
49#include "../core/hcd.h"
50#include "uhci-hcd.h" 50#include "uhci-hcd.h"
51#include "pci-quirks.h" 51#include "pci-quirks.h"
52 52
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index ea389e9a4931..a7c4e1122902 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -26,8 +26,8 @@
26#include <linux/usb.h> 26#include <linux/usb.h>
27#include <linux/timer.h> 27#include <linux/timer.h>
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <linux/usb/hcd.h>
29 30
30#include "../core/hcd.h"
31/* Code sharing between pci-quirks and xhci hcd */ 31/* Code sharing between pci-quirks and xhci hcd */
32#include "xhci-ext-caps.h" 32#include "xhci-ext-caps.h"
33 33
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index 1edb6d361896..2300a51d48b7 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -73,7 +73,7 @@ static struct list_head ftdi_static_list;
73*/ 73*/
74#include "usb_u132.h" 74#include "usb_u132.h"
75#include <asm/io.h> 75#include <asm/io.h>
76#include "../core/hcd.h" 76#include <linux/usb/hcd.h>
77 77
78 /* FIXME ohci.h is ONLY for internal use by the OHCI driver. 78 /* FIXME ohci.h is ONLY for internal use by the OHCI driver.
79 * If you're going to try stuff like this, you need to split 79 * If you're going to try stuff like this, you need to split
diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c
index e4af18b93c7d..812dc288bb8c 100644
--- a/drivers/usb/mon/mon_main.c
+++ b/drivers/usb/mon/mon_main.c
@@ -9,12 +9,13 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/usb.h> 11#include <linux/usb.h>
12#include <linux/usb/hcd.h>
12#include <linux/slab.h> 13#include <linux/slab.h>
13#include <linux/notifier.h> 14#include <linux/notifier.h>
14#include <linux/mutex.h> 15#include <linux/mutex.h>
15 16
16#include "usb_mon.h" 17#include "usb_mon.h"
17#include "../core/hcd.h" 18
18 19
19static void mon_stop(struct mon_bus *mbus); 20static void mon_stop(struct mon_bus *mbus);
20static void mon_dissolve(struct mon_bus *mbus, struct usb_bus *ubus); 21static void mon_dissolve(struct mon_bus *mbus, struct usb_bus *ubus);
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index ac17b004909b..1da14bf17a65 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -69,7 +69,7 @@ struct musb_ep;
69#include "musb_regs.h" 69#include "musb_regs.h"
70 70
71#include "musb_gadget.h" 71#include "musb_gadget.h"
72#include "../core/hcd.h" 72#include <linux/usb/hcd.h>
73#include "musb_host.h" 73#include "musb_host.h"
74 74
75 75
diff --git a/drivers/usb/wusbcore/wusbhc.h b/drivers/usb/wusbcore/wusbhc.h
index 759cda55f7c3..3d94c4247f46 100644
--- a/drivers/usb/wusbcore/wusbhc.h
+++ b/drivers/usb/wusbcore/wusbhc.h
@@ -58,9 +58,7 @@
58#include <linux/mutex.h> 58#include <linux/mutex.h>
59#include <linux/kref.h> 59#include <linux/kref.h>
60#include <linux/workqueue.h> 60#include <linux/workqueue.h>
61/* FIXME: Yes, I know: BAD--it's not my fault the USB HC iface is not 61#include <linux/usb/hcd.h>
62 * public */
63#include <linux/../../drivers/usb/core/hcd.h>
64#include <linux/uwb.h> 62#include <linux/uwb.h>
65#include <linux/usb/wusb.h> 63#include <linux/usb/wusb.h>
66 64