aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Lescouet <Eric.Lescouet@virtuallogix.com>2010-04-24 17:38:17 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:30 -0400
commitd20db4b4e938aa8e4e5735b5a1b202de5800400e (patch)
tree7433cdfb9df46cb19016da85682e98a724ae8efb /include
parentd65d7e7ef3dc5e61e4dfaac54ec6d3e97f9a1108 (diff)
USB: split hub.h into ch11.h and merge-in hcd.h
Base on inputs from Alan Stern, split the hub.h header into: - new ch11.h header (most of it) containing constants and structures from chapter 11 of the USB 2.0 spec. - a small remaining part being merged into hcd.h. 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 'include')
-rw-r--r--include/linux/usb/ch11.h (renamed from include/linux/usb/hub.h)47
-rw-r--r--include/linux/usb/hcd.h37
2 files changed, 43 insertions, 41 deletions
diff --git a/include/linux/usb/hub.h b/include/linux/usb/ch11.h
index de8081f065ed..35cb7357ff72 100644
--- a/include/linux/usb/hub.h
+++ b/include/linux/usb/ch11.h
@@ -1,13 +1,14 @@
1#ifndef __LINUX_HUB_H
2#define __LINUX_HUB_H
3
4/* 1/*
5 * Hub protocol and driver data structures. 2 * This file holds Hub protocol constants and data structures that are
3 * defined in chapter 11 (Hub Specification) of the USB 2.0 specification.
6 * 4 *
7 * Some of these are known to the "virtual root hub" code 5 * It is used/shared between the USB core, the HCDs and couple of other USB
8 * in host controller drivers. 6 * drivers.
9 */ 7 */
10 8
9#ifndef __LINUX_HUB_H
10#define __LINUX_HUB_H
11
11#include <linux/list.h> 12#include <linux/list.h>
12#include <linux/workqueue.h> 13#include <linux/workqueue.h>
13#include <linux/compiler.h> /* likely()/unlikely() */ 14#include <linux/compiler.h> /* likely()/unlikely() */
@@ -162,44 +163,10 @@ enum hub_led_mode {
162 INDICATOR_ALT_BLINK, INDICATOR_ALT_BLINK_OFF 163 INDICATOR_ALT_BLINK, INDICATOR_ALT_BLINK_OFF
163} __attribute__ ((packed)); 164} __attribute__ ((packed));
164 165
165struct usb_device;
166
167/* Transaction Translator Think Times, in bits */ 166/* Transaction Translator Think Times, in bits */
168#define HUB_TTTT_8_BITS 0x00 167#define HUB_TTTT_8_BITS 0x00
169#define HUB_TTTT_16_BITS 0x20 168#define HUB_TTTT_16_BITS 0x20
170#define HUB_TTTT_24_BITS 0x40 169#define HUB_TTTT_24_BITS 0x40
171#define HUB_TTTT_32_BITS 0x60 170#define HUB_TTTT_32_BITS 0x60
172 171
173/*
174 * As of USB 2.0, full/low speed devices are segregated into trees.
175 * One type grows from USB 1.1 host controllers (OHCI, UHCI etc).
176 * The other type grows from high speed hubs when they connect to
177 * full/low speed devices using "Transaction Translators" (TTs).
178 *
179 * TTs should only be known to the hub driver, and high speed bus
180 * drivers (only EHCI for now). They affect periodic scheduling and
181 * sometimes control/bulk error recovery.
182 */
183struct usb_tt {
184 struct usb_device *hub; /* upstream highspeed hub */
185 int multi; /* true means one TT per port */
186 unsigned think_time; /* think time in ns */
187
188 /* for control/bulk error recovery (CLEAR_TT_BUFFER) */
189 spinlock_t lock;
190 struct list_head clear_list; /* of usb_tt_clear */
191 struct work_struct clear_work;
192};
193
194struct usb_tt_clear {
195 struct list_head clear_list;
196 unsigned tt;
197 u16 devinfo;
198 struct usb_hcd *hcd;
199 struct usb_host_endpoint *ep;
200};
201
202extern int usb_hub_clear_tt_buffer(struct urb *urb);
203extern void usb_ep0_reinit(struct usb_device *);
204
205#endif /* __LINUX_HUB_H */ 172#endif /* __LINUX_HUB_H */
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index ca228f00b826..d268415b7a40 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -374,7 +374,42 @@ extern void usb_destroy_configuration(struct usb_device *dev);
374 * HCD Root Hub support 374 * HCD Root Hub support
375 */ 375 */
376 376
377#include <linux/usb/hub.h> 377#include <linux/usb/ch11.h>
378
379/*
380 * As of USB 2.0, full/low speed devices are segregated into trees.
381 * One type grows from USB 1.1 host controllers (OHCI, UHCI etc).
382 * The other type grows from high speed hubs when they connect to
383 * full/low speed devices using "Transaction Translators" (TTs).
384 *
385 * TTs should only be known to the hub driver, and high speed bus
386 * drivers (only EHCI for now). They affect periodic scheduling and
387 * sometimes control/bulk error recovery.
388 */
389
390struct usb_device;
391
392struct usb_tt {
393 struct usb_device *hub; /* upstream highspeed hub */
394 int multi; /* true means one TT per port */
395 unsigned think_time; /* think time in ns */
396
397 /* for control/bulk error recovery (CLEAR_TT_BUFFER) */
398 spinlock_t lock;
399 struct list_head clear_list; /* of usb_tt_clear */
400 struct work_struct clear_work;
401};
402
403struct usb_tt_clear {
404 struct list_head clear_list;
405 unsigned tt;
406 u16 devinfo;
407 struct usb_hcd *hcd;
408 struct usb_host_endpoint *ep;
409};
410
411extern int usb_hub_clear_tt_buffer(struct urb *urb);
412extern void usb_ep0_reinit(struct usb_device *);
378 413
379/* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */ 414/* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */
380#define DeviceRequest \ 415#define DeviceRequest \