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

[cdi-devel] [PATCH 05/10] usb: Store hub and hub_port for each usb_device



+ While not having an immediate use, we will probably need this later on
  (e.g. for device reset after enumeration, or whenever we will
  implement plugging/unplugging support).

Signed-off-by: Max Reitz <max@xxxxxxxxxx>
---
 usb/usb.c | 2 ++
 usb/usb.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/usb/usb.c b/usb/usb.c
index 489f362..c7a56d3 100644
--- a/usb/usb.c
+++ b/usb/usb.c
@@ -167,6 +167,8 @@ static usb_device_t *enumerate(usb_hub_t *hub, int hub_port,
 
     dev->hc = hub->hc;
     dev->speed = speed;
+    dev->hub = hub;
+    dev->hub_port = hub_port;
 
     if (speed < CDI_USB_HIGH_SPEED && hub->ldev) {
         if (hub->ldev->dev->speed < CDI_USB_HIGH_SPEED) {
diff --git a/usb/usb.h b/usb/usb.h
index 27dc061..9f1f4ac 100644
--- a/usb/usb.h
+++ b/usb/usb.h
@@ -54,6 +54,8 @@ typedef struct usb_device {
     int id;
     cdi_usb_speed_t speed;
 
+    usb_hub_t *hub;
+    int hub_port;
     int tt_addr, tt_port;
 
     // First index: OUT (0) / IN (1)
-- 
2.6.4