Skip to contentSkip to conversation

USB: split hub.h into ch11.h and merge-in hcd.h, linux-2.6.34-rc5

PATCH In review Eric Lescouet 1 participant 1 message Apr 24, 2010 USB

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 USB: split hub.h into ch11.h and merge-in hcd.h, linux-2.6.34-rc5

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.

---

drivers/usb/core/devio.c +1 -1
diff -Nurp linux-2.6.34-rc5.new/drivers/usb/core/devio.c linux-2.6.34-rc5.new-2/drivers/usb/core/devio.c
@@ -50,7 +50,7 @@
 #include <asm/byteorder.h>
 #include <linux/moduleparam.h>
 #include <linux/usb/hcd.h>	/* for usbcore internals */
-#include <linux/usb/hub.h>
+#include <linux/usb/ch11.h>
 
 #include "usb.h"
 
drivers/usb/core/hcd.c +1 -1
diff -Nurp linux-2.6.34-rc5.new/drivers/usb/core/hcd.c linux-2.6.34-rc5.new-2/drivers/usb/core/hcd.c
@@ -43,7 +43,7 @@
 
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
-#include <linux/usb/hub.h>
+#include <linux/usb/ch11.h>
 
 #include "usb.h"
 
drivers/usb/core/hub.c +1 -1
diff -Nurp linux-2.6.34-rc5.new/drivers/usb/core/hub.c linux-2.6.34-rc5.new-2/drivers/usb/core/hub.c
@@ -24,7 +24,7 @@
 #include <linux/freezer.h>
 #include <linux/pm_runtime.h>
 #include <linux/usb/hcd.h>
-#include <linux/usb/hub.h>
+#include <linux/usb/ch11.h>
 
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
include/linux/usb/ch11.h +172 -0

172 lines not on this page · raw message

include/linux/usb/hcd.h +36 -1
diff -Nurp linux-2.6.34-rc5.new/include/linux/usb/hcd.h linux-2.6.34-rc5.new-2/include/linux/usb/hcd.h
@@ -374,7 +374,42 @@ extern void usb_destroy_configuration(st
  * HCD Root Hub support
  */
 
-#include "hub.h"
+#include "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 \
include/linux/usb/hub.h +0 -205

205 lines not on this page · raw message