Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[pandora-kernel.git] / drivers / usb / core / hub.h
index 0f8e82a..889c0f3 100644 (file)
  */
 #define USB_PORT_FEAT_CONNECTION       0
 #define USB_PORT_FEAT_ENABLE           1
-#define USB_PORT_FEAT_SUSPEND          2
+#define USB_PORT_FEAT_SUSPEND          2       /* L2 suspend */
 #define USB_PORT_FEAT_OVER_CURRENT     3
 #define USB_PORT_FEAT_RESET            4
+#define USB_PORT_FEAT_L1               5       /* L1 suspend */
 #define USB_PORT_FEAT_POWER            8
 #define USB_PORT_FEAT_LOWSPEED         9
+/* This value was never in Table 11-17 */
 #define USB_PORT_FEAT_HIGHSPEED                10
+/* This value is also fake */
+#define USB_PORT_FEAT_SUPERSPEED       11
 #define USB_PORT_FEAT_C_CONNECTION     16
 #define USB_PORT_FEAT_C_ENABLE         17
 #define USB_PORT_FEAT_C_SUSPEND                18
 #define USB_PORT_FEAT_C_RESET          20
 #define USB_PORT_FEAT_TEST              21
 #define USB_PORT_FEAT_INDICATOR         22
+#define USB_PORT_FEAT_C_PORT_L1         23
 
-/* 
+/*
  * Hub Status and Hub Change results
  * See USB 2.0 spec Table 11-19 and Table 11-20
  */
 struct usb_port_status {
        __le16 wPortStatus;
-       __le16 wPortChange;     
+       __le16 wPortChange;
 } __attribute__ ((packed));
 
-/* 
+/*
  * wPortStatus bit field
  * See USB 2.0 spec Table 11-21
  */
@@ -73,7 +78,8 @@ struct usb_port_status {
 #define USB_PORT_STAT_SUSPEND          0x0004
 #define USB_PORT_STAT_OVERCURRENT      0x0008
 #define USB_PORT_STAT_RESET            0x0010
-/* bits 5 to 7 are reserved */
+#define USB_PORT_STAT_L1               0x0020
+/* bits 6 to 7 are reserved */
 #define USB_PORT_STAT_POWER            0x0100
 #define USB_PORT_STAT_LOW_SPEED                0x0200
 #define USB_PORT_STAT_HIGH_SPEED        0x0400
@@ -81,7 +87,7 @@ struct usb_port_status {
 #define USB_PORT_STAT_INDICATOR         0x1000
 /* bits 13 to 15 are reserved */
 
-/* 
+/*
  * wPortChange bit field
  * See USB 2.0 spec Table 11-22
  * Bits 0 to 4 shown, bits 5 to 15 are reserved
@@ -91,9 +97,10 @@ struct usb_port_status {
 #define USB_PORT_STAT_C_SUSPEND                0x0004
 #define USB_PORT_STAT_C_OVERCURRENT    0x0008
 #define USB_PORT_STAT_C_RESET          0x0010
+#define USB_PORT_STAT_C_L1             0x0020
 
 /*
- * wHubCharacteristics (masks) 
+ * wHubCharacteristics (masks)
  * See USB 2.0 spec Table 11-13, offset 3
  */
 #define HUB_CHAR_LPSM          0x0003 /* D1 .. D0 */
@@ -119,8 +126,8 @@ struct usb_hub_status {
 #define HUB_CHANGE_OVERCURRENT 0x0002
 
 
-/* 
- * Hub descriptor 
+/*
+ * Hub descriptor
  * See USB 2.0 spec Table 11-13
  */
 
@@ -134,7 +141,7 @@ struct usb_hub_descriptor {
        __le16 wHubCharacteristics;
        __u8  bPwrOn2PwrGood;
        __u8  bHubContrCurrent;
-               /* add 1 bit for hub status change; round to bytes */
+               /* add 1 bit for hub status change; round to bytes */
        __u8  DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];
        __u8  PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];
 } __attribute__ ((packed));
@@ -190,47 +197,7 @@ struct usb_tt_clear {
        u16                     devinfo;
 };
 
-extern void usb_hub_tt_clear_buffer (struct usb_device *dev, int pipe);
-
-struct usb_hub {
-       struct device           *intfdev;       /* the "interface" device */
-       struct usb_device       *hdev;
-       struct urb              *urb;           /* for interrupt polling pipe */
-
-       /* buffer for urb ... with extra space in case of babble */
-       char                    (*buffer)[8];
-       dma_addr_t              buffer_dma;     /* DMA address for buffer */
-       union {
-               struct usb_hub_status   hub;
-               struct usb_port_status  port;
-       }                       *status;        /* buffer for status reports */
-
-       int                     error;          /* last reported error */
-       int                     nerrors;        /* track consecutive errors */
-
-       struct list_head        event_list;     /* hubs w/data or errs ready */
-       unsigned long           event_bits[1];  /* status change bitmask */
-       unsigned long           change_bits[1]; /* ports with logical connect
-                                                       status change */
-       unsigned long           busy_bits[1];   /* ports being reset or
-                                                       resumed */
-#if USB_MAXCHILDREN > 31 /* 8*sizeof(unsigned long) - 1 */
-#error event_bits[] is too short!
-#endif
-
-       struct usb_hub_descriptor *descriptor;  /* class descriptor */
-       struct usb_tt           tt;             /* Transaction Translator */
-
-       unsigned                mA_per_port;    /* current for each child */
-
-       unsigned                limited_power:1;
-       unsigned                quiescing:1;
-       unsigned                activating:1;
-       unsigned                resume_root_hub:1;
-
-       unsigned                has_indicators:1;
-       enum hub_led_mode       indicator[USB_MAXCHILDREN];
-       struct work_struct      leds;
-};
+extern void usb_hub_tt_clear_buffer(struct usb_device *dev, int pipe);
+extern void usb_ep0_reinit(struct usb_device *);
 
 #endif /* __LINUX_HUB_H */