aboutsummaryrefslogtreecommitdiff
path: root/common/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/usb.c')
-rw-r--r--common/usb.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/common/usb.c b/common/usb.c
index 10e23de6a..4f7c520b3 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -55,7 +55,10 @@
#include <asm/4xx_pci.h>
#endif
-#undef USB_DEBUG
+#ifdef DEBUG
+#define USB_DEBUG
+#define USB_HUB_DEBUG
+#endif
#ifdef USB_DEBUG
#define USB_PRINTF(fmt, args...) printf(fmt , ##args)
@@ -142,10 +145,14 @@ int usb_stop(void)
/*
* disables the asynch behaviour of the control message. This is used for data
* transfers that uses the exclusiv access to the control and bulk messages.
+ * Returns the old value so it can be restored later.
*/
-void usb_disable_asynch(int disable)
+int usb_disable_asynch(int disable)
{
+ int old_value = asynch_allowed;
+
asynch_allowed = !disable;
+ return old_value;
}
@@ -960,8 +967,6 @@ void usb_scan_devices(void)
* Probes device for being a hub and configurate it
*/
-#undef USB_HUB_DEBUG
-
#ifdef USB_HUB_DEBUG
#define USB_HUB_PRINTF(fmt, args...) printf(fmt , ##args)
#else
@@ -1220,7 +1225,7 @@ int usb_hub_configure(struct usb_device *dev)
hub->desc.DeviceRemovable[i] = descriptor->DeviceRemovable[i];
for (i = 0; i < ((hub->desc.bNbrPorts + 1 + 7)/8); i++)
- hub->desc.DeviceRemovable[i] = descriptor->PortPowerCtrlMask[i];
+ hub->desc.PortPowerCtrlMask[i] = descriptor->PortPowerCtrlMask[i];
dev->maxchild = descriptor->bNbrPorts;
USB_HUB_PRINTF("%d ports detected\n", dev->maxchild);