mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 21:21:37 +00:00
Revert "usb_storage : scan all interfaces to find a storage device"
This reverts commit cd749658d5
.
The conflicts with this commit are hard for me to figure out. I will re-apply
it later.
This commit is contained in:
parent
051081323f
commit
7fc2c1ea7b
1 changed files with 17 additions and 28 deletions
|
@ -168,30 +168,6 @@ static unsigned int usb_get_max_lun(struct us_data *us)
|
||||||
return (len > 0) ? *result : 0;
|
return (len > 0) ? *result : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int usb_storage_register(struct usb_device *dev, unsigned char iface)
|
|
||||||
{
|
|
||||||
int lun, max_lun, start = usb_max_devs;
|
|
||||||
int nb_dev = 0;
|
|
||||||
|
|
||||||
if (!usb_storage_probe(dev, iface, &usb_stor[usb_max_devs]))
|
|
||||||
return nb_dev;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* OK, it's a storage device. Iterate over its LUNs
|
|
||||||
* and populate `usb_dev_desc'.
|
|
||||||
*/
|
|
||||||
max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]);
|
|
||||||
for (lun = 0; lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV; lun++) {
|
|
||||||
usb_dev_desc[usb_max_devs].lun = lun;
|
|
||||||
if (usb_stor_get_info(dev, &usb_stor[start],
|
|
||||||
&usb_dev_desc[usb_max_devs]) == 1) {
|
|
||||||
nb_dev++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nb_dev;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* scan the usb and reports device info
|
* scan the usb and reports device info
|
||||||
* to the user if mode = 1
|
* to the user if mode = 1
|
||||||
|
@ -199,7 +175,7 @@ static int usb_storage_register(struct usb_device *dev, unsigned char iface)
|
||||||
*/
|
*/
|
||||||
int usb_stor_scan(int mode)
|
int usb_stor_scan(int mode)
|
||||||
{
|
{
|
||||||
unsigned char i, iface;
|
unsigned char i;
|
||||||
struct usb_device *dev;
|
struct usb_device *dev;
|
||||||
|
|
||||||
if (mode == 1)
|
if (mode == 1)
|
||||||
|
@ -225,10 +201,23 @@ int usb_stor_scan(int mode)
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
break; /* no more devices available */
|
break; /* no more devices available */
|
||||||
|
|
||||||
for (iface = 0; iface < dev->config.no_of_if; iface++) {
|
if (usb_storage_probe(dev, 0, &usb_stor[usb_max_devs])) {
|
||||||
usb_max_devs += usb_storage_register(dev, iface);
|
/* OK, it's a storage device. Iterate over its LUNs
|
||||||
}
|
* and populate `usb_dev_desc'.
|
||||||
|
*/
|
||||||
|
int lun, max_lun, start = usb_max_devs;
|
||||||
|
|
||||||
|
max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]);
|
||||||
|
for (lun = 0;
|
||||||
|
lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV;
|
||||||
|
lun++) {
|
||||||
|
usb_dev_desc[usb_max_devs].lun = lun;
|
||||||
|
if (usb_stor_get_info(dev, &usb_stor[start],
|
||||||
|
&usb_dev_desc[usb_max_devs]) == 1) {
|
||||||
|
usb_max_devs++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/* if storage device */
|
/* if storage device */
|
||||||
if (usb_max_devs == USB_MAX_STOR_DEV) {
|
if (usb_max_devs == USB_MAX_STOR_DEV) {
|
||||||
printf("max USB Storage Device reached: %d stopping\n",
|
printf("max USB Storage Device reached: %d stopping\n",
|
||||||
|
|
Loading…
Add table
Reference in a new issue