Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
u-boot-2015.04
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vesta
u-boot-2015.04
Commits
e51aae38
Commit
e51aae38
authored
18 years ago
by
Bartlomiej Sieka
Browse files
Options
Downloads
Patches
Plain Diff
Prevent USB commands from working when USB is stopped.
parent
7455af41
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG
+2
-0
2 additions, 0 deletions
CHANGELOG
common/cmd_usb.c
+5
-0
5 additions, 0 deletions
common/cmd_usb.c
common/usb.c
+5
-0
5 additions, 0 deletions
common/usb.c
with
12 additions
and
0 deletions
CHANGELOG
+
2
−
0
View file @
e51aae38
...
...
@@ -2,6 +2,8 @@
Changes since U-Boot 1.1.4:
======================================================================
* Prevent USB commands from working when USB is stopped.
* Add rudimentary handling of alternate settings of USB interfaces.
This is in order to fix issues with some USB sticks or knives timing
out during initialisation. Some code readability improvements.
...
...
This diff is collapsed.
Click to expand it.
common/cmd_usb.c
+
5
−
0
View file @
e51aae38
...
...
@@ -444,6 +444,7 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int
i
;
struct
usb_device
*
dev
=
NULL
;
extern
char
usb_started
;
#ifdef CONFIG_USB_STORAGE
block_dev_desc_t
*
stor_dev
;
#endif
...
...
@@ -477,6 +478,10 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
usb_stop
();
return
0
;
}
if
(
!
usb_started
)
{
printf
(
"USB is stopped. Please issue 'usb start' first.
\n
"
);
return
1
;
}
if
(
strncmp
(
argv
[
1
],
"tree"
,
4
)
==
0
)
{
printf
(
"
\n
Device Tree:
\n
"
);
usb_show_tree
(
usb_get_dev_index
(
0
));
...
...
This diff is collapsed.
Click to expand it.
common/usb.c
+
5
−
0
View file @
e51aae38
...
...
@@ -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
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment