]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/usb.h
usb: hub: Change USB hub descriptor to match USB 3.0 hubs
[people/ms/u-boot.git] / include / usb.h
index 0b410b6cd10b6cece52ba0748be4ff83b768f573..eb82cc23a8a1e60568bf5e582e945e6b2a0c7ce6 100644 (file)
@@ -130,7 +130,7 @@ struct usb_device {
        int string_langid;              /* language ID for strings */
        int (*irq_handle)(struct usb_device *dev);
        unsigned long irq_status;
-       int irq_act_len;                /* transfered bytes */
+       int irq_act_len;                /* transferred bytes */
        void *privptr;
        /*
         * Child devices -  if this is a hub device
@@ -138,7 +138,7 @@ struct usb_device {
         */
        unsigned long status;
        unsigned long int_pending;      /* 1 bit per ep, used by int_queue */
-       int act_len;                    /* transfered bytes */
+       int act_len;                    /* transferred bytes */
        int maxchild;                   /* Number of ports if hub */
        int portnr;                     /* Port number, 1=first */
 #ifndef CONFIG_DM_USB
@@ -187,7 +187,8 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                        int transfer_len, int interval);
 
-#if defined CONFIG_USB_EHCI || defined CONFIG_USB_MUSB_HOST || defined(CONFIG_DM_USB)
+#if defined CONFIG_USB_EHCI_HCD || defined CONFIG_USB_MUSB_HOST \
+       || defined(CONFIG_DM_USB)
 struct int_queue *create_int_queue(struct usb_device *dev, unsigned long pipe,
        int queuesize, int elementsize, void *buffer, int interval);
 int destroy_int_queue(struct usb_device *dev, struct int_queue *queue);
@@ -228,7 +229,6 @@ int board_usb_cleanup(int index, enum usb_init_type init);
 #ifdef CONFIG_USB_STORAGE
 
 #define USB_MAX_STOR_DEV 7
-block_dev_desc_t *usb_stor_get_dev(int index);
 int usb_stor_scan(int mode);
 int usb_stor_info(void);
 
@@ -546,16 +546,30 @@ struct usb_hub_descriptor {
        unsigned short wHubCharacteristics;
        unsigned char  bPwrOn2PwrGood;
        unsigned char  bHubContrCurrent;
-       unsigned char  DeviceRemovable[(USB_MAXCHILDREN+1+7)/8];
-       unsigned char  PortPowerCtrlMask[(USB_MAXCHILDREN+1+7)/8];
-       /* DeviceRemovable and PortPwrCtrlMask want to be variable-length
-          bitmaps that hold max 255 entries. (bit0 is ignored) */
+       /* 2.0 and 3.0 hubs differ here */
+       union {
+               struct {
+                       /* add 1 bit for hub status change; round to bytes */
+                       __u8 DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];
+                       __u8 PortPowerCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];
+               } __attribute__ ((packed)) hs;
+
+               struct {
+                       __u8 bHubHdrDecLat;
+                       __le16 wHubDelay;
+                       __le16 DeviceRemovable;
+               } __attribute__ ((packed)) ss;
+       } u;
 } __attribute__ ((packed));
 
 
 struct usb_hub_device {
        struct usb_device *pusb_dev;
        struct usb_hub_descriptor desc;
+
+       ulong connect_timeout;          /* Device connection timeout in ms */
+       ulong query_delay;              /* Device query delay in ms */
+       int overcurrent_count[USB_MAXCHILDREN]; /* Over-current counter */
 };
 
 #ifdef CONFIG_DM_USB