patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / drivers / usb / core / hcd.h
index 5714364..f56fa80 100644 (file)
@@ -74,6 +74,8 @@ struct usb_hcd {      /* usb_bus.hcpriv points to this */
         */
        struct hc_driver        *driver;        /* hw-specific hooks */
        unsigned                saw_irq : 1;
+       unsigned                can_wakeup:1;   /* hw supports wakeup? */
+       unsigned                remote_wakeup:1;/* sw should use wakeup? */
        int                     irq;            /* irq allocated */
        void                    *regs;          /* device memory/io */
 
@@ -94,7 +96,7 @@ struct usb_hcd {      /* usb_bus.hcpriv points to this */
 #      define  USB_STATE_RUNNING       (__ACTIVE)
 #      define  USB_STATE_QUIESCING     (__SUSPEND|__TRANSIENT|__ACTIVE)
 #      define  USB_STATE_RESUMING      (__SUSPEND|__TRANSIENT)
-#      define  USB_STATE_SUSPENDED     (__SUSPEND)
+#      define  HCD_STATE_SUSPENDED     (__SUSPEND)
 
 #define        HCD_IS_RUNNING(state) ((state) & __ACTIVE)
 #define        HCD_IS_SUSPENDED(state) ((state) & __SUSPEND)
@@ -241,13 +243,13 @@ extern void usb_hc_died (struct usb_hcd *hcd);
 extern struct usb_device *usb_alloc_dev(struct usb_device *parent,
                                        struct usb_bus *, unsigned port);
 extern int usb_new_device(struct usb_device *dev);
-extern void usb_choose_address(struct usb_device *dev);
 extern void usb_disconnect(struct usb_device **);
+extern void usb_choose_address(struct usb_device *dev);
+extern void usb_release_address(struct usb_device *dev);
 
 /* exported to hub driver ONLY to support usb_reset_device () */
 extern int usb_get_configuration(struct usb_device *dev);
 extern void usb_destroy_configuration(struct usb_device *dev);
-extern int usb_set_address(struct usb_device *dev);
 
 /* use these only before the device's address has been set */
 #define usb_snddefctrl(dev)            ((PIPE_CONTROL << 30))
@@ -327,7 +329,7 @@ extern int usb_check_bandwidth (struct usb_device *dev, struct urb *urb);
 #define HS_USECS(bytes) NS_TO_US ( ((55 * 8 * 2083)/1000) \
        + ((2083UL * (3167 + BitTime (bytes)))/1000) \
        + USB2_HOST_DELAY)
-#define HS_USECS_ISO(bytes) NS_TO_US ( ((long)(38 * 8 * 2.083)) \
+#define HS_USECS_ISO(bytes) NS_TO_US ( ((38 * 8 * 2083)/1000) \
        + ((2083UL * (3167 + BitTime (bytes)))/1000) \
        + USB2_HOST_DELAY)
 
@@ -344,9 +346,16 @@ extern void usb_deregister_bus (struct usb_bus *);
 extern int usb_register_root_hub (struct usb_device *usb_dev,
                struct device *parent_dev);
 
-/* for portability to 2.4, hcds should call this */
 static inline int hcd_register_root (struct usb_hcd *hcd)
 {
+       /* hcd->driver->start() reported can_wakeup, probably with
+        * assistance from board's boot firmware.
+        * NOTE:  normal devices won't enable wakeup by default.
+        */
+       if (hcd->can_wakeup)
+               dev_dbg (hcd->self.controller, "supports USB remote wakeup\n");
+       hcd->remote_wakeup = hcd->can_wakeup;
+
        return usb_register_root_hub (
                hcd_to_bus (hcd)->root_hub, hcd->self.controller);
 }