From 7455af41d19d5e0194e23f3b06f1bf64e3430d62 Mon Sep 17 00:00:00 2001 From: Bartlomiej Sieka Date: Wed, 2 Aug 2006 00:54:18 +0200 Subject: Add rudimentary handling of alternate settings of USB interfaces - to fix problems with some USB storage devices. Some code readability improvements. --- common/cmd_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/cmd_usb.c') diff --git a/common/cmd_usb.c b/common/cmd_usb.c index fdfd042..fcc6662 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -186,7 +186,7 @@ void usb_display_conf_desc(struct usb_config_descriptor *config,struct usb_devic void usb_display_if_desc(struct usb_interface_descriptor *ifdesc,struct usb_device *dev) { printf(" Interface: %d\n",ifdesc->bInterfaceNumber); - printf(" - Alternate Settings %d, Endpoints: %d\n",ifdesc->bAlternateSetting,ifdesc->bNumEndpoints); + printf(" - Alternate Setting %d, Endpoints: %d\n",ifdesc->bAlternateSetting,ifdesc->bNumEndpoints); printf(" - Class "); usb_display_class_sub(ifdesc->bInterfaceClass,ifdesc->bInterfaceSubClass,ifdesc->bInterfaceProtocol); printf("\n"); -- cgit v1.1 From e51aae382979dd838cd5d4027bb21072b7f03a20 Mon Sep 17 00:00:00 2001 From: Bartlomiej Sieka Date: Thu, 3 Aug 2006 23:20:13 +0200 Subject: Prevent USB commands from working when USB is stopped. --- common/cmd_usb.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common/cmd_usb.c') diff --git a/common/cmd_usb.c b/common/cmd_usb.c index fcc6662..28c05aa 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -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("\nDevice Tree:\n"); usb_show_tree(usb_get_dev_index(0)); -- cgit v1.1