]> xenbits.xensource.com Git - people/royger/linux-2.6.18-xen.git/commitdiff
usbfront: fix compile error and disable PM feature
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 8 Oct 2009 07:53:36 +0000 (08:53 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 8 Oct 2009 07:53:36 +0000 (08:53 +0100)
Fix the compilation error of usbfront, and disable bus suspend/resume
by default.

Signed-off-by: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
drivers/xen/Kconfig
drivers/xen/usbfront/Makefile
drivers/xen/usbfront/usbfront-hcd.c
drivers/xen/usbfront/usbfront-hub.c

index a153b5a486b6e947ebff87aa5e7d8be5906462fb..5d405ba85bf572b8ae15d0c572b39b4efe29f591 100644 (file)
@@ -248,6 +248,13 @@ config XEN_USB_FRONTEND_HCD_STATS
        help
          Count the transferred urb status and the RING_FULL occurrence.
 
+config XEN_USB_FRONTEND_HCD_PM
+       bool "HCD suspend/resume support (DO NOT USE)"
+       depends on XEN_USB_FRONTEND
+       default n
+       help
+         Experimental bus suspend/resume feature support.
+
 config XEN_GRANT_DEV
        tristate "User-space granted page access driver"
        default XEN_PRIVILEGED_GUEST
index ad60d46b63d4acc066d03070e9c6b446f122a1ee..034ba965bba16e69da78518d790902a1c0c09195 100644 (file)
@@ -5,3 +5,7 @@ xen-hcd-y   := usbfront-hcd.o xenbus.o
 ifeq ($(CONFIG_XEN_USB_FRONTEND_HCD_STATS),y)
 EXTRA_CFLAGS += -DXENHCD_STATS
 endif
+
+ifeq ($(CONFIG_XEN_USB_FRONTEND_HCD_PM),y)
+EXTRA_CFLAGS += -DXENHCD_PM
+endif
index 54bda26800d4f7a39458f029b9c534722dda3b1f..f7f9ed9aa13efb86a10aa8ab9aa0439a0a22ee86 100644 (file)
@@ -195,10 +195,12 @@ struct hc_driver xen_usb20_hc_driver = {
        /* root hub operations */
        .hub_status_data = xenhcd_hub_status_data,
        .hub_control = xenhcd_hub_control,
+#ifdef XENHCD_PM
 #ifdef CONFIG_PM
        .bus_suspend = xenhcd_bus_suspend,
        .bus_resume = xenhcd_bus_resume,
 #endif
+#endif
 };
 
 struct hc_driver xen_usb11_hc_driver = {
@@ -220,8 +222,10 @@ struct hc_driver xen_usb11_hc_driver = {
        /* root hub operations */
        .hub_status_data = xenhcd_hub_status_data,
        .hub_control = xenhcd_hub_control,
+#ifdef XENHCD_PM
 #ifdef CONFIG_PM
        .bus_suspend = xenhcd_bus_suspend,
        .bus_resume = xenhcd_bus_resume,
 #endif
+#endif
 };
index 1c54f1a3a4123f0ddab27b069bee822f27e44f59..3c4ae3e4331c8c0d2155b17fced7aef44e2ade3a 100644 (file)
@@ -207,6 +207,7 @@ void rhport_reset(struct usbfront_info *info, int portnum)
        info->ports[port].timeout = jiffies + msecs_to_jiffies(10);
 }
 
+#ifdef XENHCD_PM
 #ifdef CONFIG_PM
 static int xenhcd_bus_suspend(struct usb_hcd *hcd)
 {
@@ -217,9 +218,9 @@ static int xenhcd_bus_suspend(struct usb_hcd *hcd)
        ports = info->rh_numports;
 
        spin_lock_irq(&info->lock);
-       if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &info->flags))
+       if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
                ret = -ESHUTDOWN;
-       else if (!info->dead) {
+       else {
                /* suspend any active ports*/
                for (i = 1; i <= ports; i++)
                        rhport_suspend(info, i);
@@ -240,9 +241,9 @@ static int xenhcd_bus_resume(struct usb_hcd *hcd)
        ports = info->rh_numports;
 
        spin_lock_irq(&info->lock);
-       if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &info->flags))
+       if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
                ret = -ESHUTDOWN;
-       else if (!info->dead) {
+       else {
                /* resume any suspended ports*/
                for (i = 1; i <= ports; i++)
                        rhport_resume(info, i);
@@ -252,6 +253,7 @@ static int xenhcd_bus_resume(struct usb_hcd *hcd)
        return ret;
 }
 #endif
+#endif
 
 static void xenhcd_hub_descriptor(struct usbfront_info *info,
                                  struct usb_hub_descriptor *desc)