summaryrefslogtreecommitdiff
path: root/common/usb.c
diff options
context:
space:
mode:
authorBartlomiej Sieka <tur@semihalf.com>2006-08-03 23:20:13 +0200
committerBartlomiej Sieka <tur@semihalf.com>2006-08-03 23:20:13 +0200
commite51aae382979dd838cd5d4027bb21072b7f03a20 (patch)
tree09a2d64cb23c360373fb06a2b6d0b752431e188f /common/usb.c
parent7455af41d19d5e0194e23f3b06f1bf64e3430d62 (diff)
downloadu-boot-imx-e51aae382979dd838cd5d4027bb21072b7f03a20.zip
u-boot-imx-e51aae382979dd838cd5d4027bb21072b7f03a20.tar.gz
u-boot-imx-e51aae382979dd838cd5d4027bb21072b7f03a20.tar.bz2
Prevent USB commands from working when USB is stopped.
Diffstat (limited to 'common/usb.c')
-rw-r--r--common/usb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/usb.c b/common/usb.c
index b1b7aec..0857494 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -72,6 +72,8 @@ static int running;
static int asynch_allowed;
static struct devrequest setup_packet;
+char usb_started; /* flag for the started/stopped USB status */
+
/**********************************************************************
* some forward declerations...
*/
@@ -110,10 +112,12 @@ int usb_init(void)
printf("scanning bus for devices... ");
running=1;
usb_scan_devices();
+ usb_started = 1;
return 0;
}
else {
printf("Error, couldn't init Lowlevel part\n");
+ usb_started = 0;
return -1;
}
}
@@ -124,6 +128,7 @@ int usb_init(void)
int usb_stop(void)
{
asynch_allowed=1;
+ usb_started = 0;
usb_hub_reset();
return usb_lowlevel_stop();
}