diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/cmd_usb.c | 12 | ||||
| -rw-r--r-- | common/usb.c | 6 | 
2 files changed, 15 insertions, 3 deletions
| diff --git a/common/cmd_usb.c b/common/cmd_usb.c index b04a8df76..b5731a7bb 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) { diff --git a/common/usb.c b/common/usb.c index 44a435af6..4f7c520b3 100644 --- a/common/usb.c +++ b/common/usb.c @@ -145,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;  } |