summaryrefslogtreecommitdiff
path: root/common/cmd_usb.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-02-16 11:14:33 -0800
committerRemy Bohmer <linux@bohmer.net>2011-02-19 20:32:36 +0100
commit89d48367edbc878f86db3008a4107331ef07f578 (patch)
tree808742d920445274c97d867422762b3b67cc8391 /common/cmd_usb.c
parent96820a35873b4c005f732432c6a168decc9d22b9 (diff)
Add USB host ethernet adapter support
This adds support for using USB Ethernet dongles in host mode. This is just the framework - drivers will come later. A new config option called CONFIG_USB_HOST_ETHER can be defined in board config files to switch this on. The was originally written by NVIDIA and was cleaned up for release by the Chromium authors. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cmd_usb.c')
-rw-r--r--common/cmd_usb.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index b04a8df764d..b5731a7bb8d 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -34,6 +34,9 @@
#ifdef CONFIG_USB_STORAGE
static int usb_stor_curr_dev = -1; /* current device */
#endif
+#ifdef CONFIG_USB_HOST_ETHER
+static int usb_ether_curr_dev = -1; /* current ethernet device */
+#endif
/* some display routines (info command) */
char *usb_get_class_desc(unsigned char dclass)
@@ -522,11 +525,16 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
usb_stop();
printf("(Re)start USB...\n");
i = usb_init();
+ if (i >= 0) {
#ifdef CONFIG_USB_STORAGE
- /* try to recognize storage devices immediately */
- if (i >= 0)
+ /* try to recognize storage devices immediately */
usb_stor_curr_dev = usb_stor_scan(1);
#endif
+#ifdef CONFIG_USB_HOST_ETHER
+ /* try to recognize ethernet devices immediately */
+ usb_ether_curr_dev = usb_host_eth_scan(1);
+#endif
+ }
return 0;
}
if (strncmp(argv[1], "stop", 4) == 0) {