Skip to contentSkip to conversation

usbfront: fix compile error and disable PM feature

PATCH In review Noboru Iwamatsu 1 participant 2 messages Oct 8, 2009 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usbfront: fix compile error and disable PM feature

Hi,

Attached patch fixes the compilation error of the update of usbfront that I've posted.
And, bus suspend/resume feature is disabled by default.

Regards,
Noboru

drivers/xen/Kconfig +7 -0
diff -r ccfd8d171c1b -r ba13757d92ce drivers/xen/Kconfig
@@ -248,6 +248,13 @@
 	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
drivers/xen/usbfront/Makefile +4 -0
diff -r ccfd8d171c1b -r ba13757d92ce drivers/xen/usbfront/Makefile
@@ -5,3 +5,7 @@
 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
drivers/xen/usbfront/usbfront-hcd.c +4 -0
diff -r ccfd8d171c1b -r ba13757d92ce drivers/xen/usbfront/usbfront-hcd.c
@@ -195,10 +195,12 @@
 	/* 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 @@
 	/* 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
 };
drivers/xen/usbfront/usbfront-hub.c +6 -4
diff -r ccfd8d171c1b -r ba13757d92ce drivers/xen/usbfront/usbfront-hub.c
@@ -207,6 +207,7 @@
 	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 @@
 	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 @@
 	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 @@
 	return ret;
 }
 #endif
+#endif
 
 static void xenhcd_hub_descriptor(struct usbfront_info *info,
 				  struct usb_hub_descriptor *desc)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel