usb: Re-enable usb-storage support dynamic id
Enable usb-storage support dynamic id again by using a fixed id entry that describes a device using the Bulk-Only transport with the Transparent SCSI protocol. Signed-off-by: Huajun Li <huajun.li.lee@gmail.com> Reviewed-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Родитель
e73b2db6c9
Коммит
fd7ff36d6a
|
@ -125,6 +125,9 @@ static struct us_unusual_dev us_unusual_dev_list[] = {
|
||||||
{ } /* Terminating entry */
|
{ } /* Terminating entry */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct us_unusual_dev for_dynamic_ids =
|
||||||
|
USUAL_DEV(USB_SC_SCSI, USB_PR_BULK, 0);
|
||||||
|
|
||||||
#undef UNUSUAL_DEV
|
#undef UNUSUAL_DEV
|
||||||
#undef COMPLIANT_DEV
|
#undef COMPLIANT_DEV
|
||||||
#undef USUAL_DEV
|
#undef USUAL_DEV
|
||||||
|
@ -1027,8 +1030,10 @@ EXPORT_SYMBOL_GPL(usb_stor_disconnect);
|
||||||
static int storage_probe(struct usb_interface *intf,
|
static int storage_probe(struct usb_interface *intf,
|
||||||
const struct usb_device_id *id)
|
const struct usb_device_id *id)
|
||||||
{
|
{
|
||||||
|
struct us_unusual_dev *unusual_dev;
|
||||||
struct us_data *us;
|
struct us_data *us;
|
||||||
int result;
|
int result;
|
||||||
|
int size;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If libusual is configured, let it decide whether a standard
|
* If libusual is configured, let it decide whether a standard
|
||||||
|
@ -1047,8 +1052,19 @@ static int storage_probe(struct usb_interface *intf,
|
||||||
* table, so we use the index of the id entry to find the
|
* table, so we use the index of the id entry to find the
|
||||||
* corresponding unusual_devs entry.
|
* corresponding unusual_devs entry.
|
||||||
*/
|
*/
|
||||||
result = usb_stor_probe1(&us, intf, id,
|
|
||||||
(id - usb_storage_usb_ids) + us_unusual_dev_list);
|
size = ARRAY_SIZE(us_unusual_dev_list);
|
||||||
|
if (id >= usb_storage_usb_ids && id < usb_storage_usb_ids + size) {
|
||||||
|
unusual_dev = (id - usb_storage_usb_ids) + us_unusual_dev_list;
|
||||||
|
} else {
|
||||||
|
unusual_dev = &for_dynamic_ids;
|
||||||
|
|
||||||
|
US_DEBUGP("%s %s 0x%04x 0x%04x\n", "Use Bulk-Only transport",
|
||||||
|
"with the Transparent SCSI protocol for dynamic id:",
|
||||||
|
id->idVendor, id->idProduct);
|
||||||
|
}
|
||||||
|
|
||||||
|
result = usb_stor_probe1(&us, intf, id, unusual_dev);
|
||||||
if (result)
|
if (result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
@ -1074,7 +1090,6 @@ static struct usb_driver usb_storage_driver = {
|
||||||
.id_table = usb_storage_usb_ids,
|
.id_table = usb_storage_usb_ids,
|
||||||
.supports_autosuspend = 1,
|
.supports_autosuspend = 1,
|
||||||
.soft_unbind = 1,
|
.soft_unbind = 1,
|
||||||
.no_dynamic_id = 1,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init usb_stor_init(void)
|
static int __init usb_stor_init(void)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче