[PATCH 006/229] USB: split hub.h into ch11.h and merge-in hcd.h

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

 



From: Eric Lescouet <Eric.Lescouet@xxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxx>
Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 include/linux/usb/{hub.h => ch11.h} |   47 +++++-----------------------------
 include/linux/usb/hcd.h             |   37 ++++++++++++++++++++++++++-
 2 files changed, 43 insertions(+), 41 deletions(-)
 rename include/linux/usb/{hub.h => ch11.h} (79%)

diff --git a/include/linux/usb/hub.h b/include/linux/usb/ch11.h
similarity index 79%
rename from include/linux/usb/hub.h
rename to include/linux/usb/ch11.h
index de8081f..35cb735 100644
--- a/include/linux/usb/hub.h
+++ b/include/linux/usb/ch11.h
@@ -1,13 +1,14 @@
-#ifndef __LINUX_HUB_H
-#define __LINUX_HUB_H
-
 /*
- * Hub protocol and driver data structures.
+ * This file holds Hub protocol constants and data structures that are
+ * defined in chapter 11 (Hub Specification) of the USB 2.0 specification.
  *
- * Some of these are known to the "virtual root hub" code
- * in host controller drivers.
+ * It is used/shared between the USB core, the HCDs and couple of other USB
+ * drivers.
  */
 
+#ifndef __LINUX_HUB_H
+#define __LINUX_HUB_H
+
 #include <linux/list.h>
 #include <linux/workqueue.h>
 #include <linux/compiler.h>	/* likely()/unlikely() */
@@ -162,44 +163,10 @@ enum hub_led_mode {
 	INDICATOR_ALT_BLINK, INDICATOR_ALT_BLINK_OFF
 } __attribute__ ((packed));
 
-struct usb_device;
-
 /* Transaction Translator Think Times, in bits */
 #define HUB_TTTT_8_BITS		0x00
 #define HUB_TTTT_16_BITS	0x20
 #define HUB_TTTT_24_BITS	0x40
 #define HUB_TTTT_32_BITS	0x60
 
-/*
- * As of USB 2.0, full/low speed devices are segregated into trees.
- * One type grows from USB 1.1 host controllers (OHCI, UHCI etc).
- * The other type grows from high speed hubs when they connect to
- * full/low speed devices using "Transaction Translators" (TTs).
- *
- * TTs should only be known to the hub driver, and high speed bus
- * drivers (only EHCI for now).  They affect periodic scheduling and
- * sometimes control/bulk error recovery.
- */
-struct usb_tt {
-	struct usb_device	*hub;	/* upstream highspeed hub */
-	int			multi;	/* true means one TT per port */
-	unsigned		think_time;	/* think time in ns */
-
-	/* for control/bulk error recovery (CLEAR_TT_BUFFER) */
-	spinlock_t		lock;
-	struct list_head	clear_list;	/* of usb_tt_clear */
-	struct work_struct	clear_work;
-};
-
-struct usb_tt_clear {
-	struct list_head	clear_list;
-	unsigned		tt;
-	u16			devinfo;
-	struct usb_hcd		*hcd;
-	struct usb_host_endpoint	*ep;
-};
-
-extern int usb_hub_clear_tt_buffer(struct urb *urb);
-extern void usb_ep0_reinit(struct usb_device *);
-
 #endif /* __LINUX_HUB_H */
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index ca228f0..d268415 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);
  * HCD Root Hub support
  */
 
-#include <linux/usb/hub.h>
+#include <linux/usb/ch11.h>
+
+/*
+ * As of USB 2.0, full/low speed devices are segregated into trees.
+ * One type grows from USB 1.1 host controllers (OHCI, UHCI etc).
+ * The other type grows from high speed hubs when they connect to
+ * full/low speed devices using "Transaction Translators" (TTs).
+ *
+ * TTs should only be known to the hub driver, and high speed bus
+ * drivers (only EHCI for now).  They affect periodic scheduling and
+ * sometimes control/bulk error recovery.
+ */
+
+struct usb_device;
+
+struct usb_tt {
+	struct usb_device	*hub;	/* upstream highspeed hub */
+	int			multi;	/* true means one TT per port */
+	unsigned		think_time;	/* think time in ns */
+
+	/* for control/bulk error recovery (CLEAR_TT_BUFFER) */
+	spinlock_t		lock;
+	struct list_head	clear_list;	/* of usb_tt_clear */
+	struct work_struct	clear_work;
+};
+
+struct usb_tt_clear {
+	struct list_head	clear_list;
+	unsigned		tt;
+	u16			devinfo;
+	struct usb_hcd		*hcd;
+	struct usb_host_endpoint	*ep;
+};
+
+extern int usb_hub_clear_tt_buffer(struct urb *urb);
+extern void usb_ep0_reinit(struct usb_device *);
 
 /* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */
 #define DeviceRequest \
-- 
1.7.1

--
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