aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage
diff options
context:
space:
mode:
authorHuajun Li <huajun.li.lee@gmail.com>2012-01-13 21:16:40 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-24 17:31:04 -0500
commitfd7ff36d6a3f6413f838a2037b957b0e33ba9056 (patch)
tree1681e24405ca91525de31fe96fb6b93183fd292b /drivers/usb/storage
parente73b2db6c9bc5bd9a3c080f286964e594351991a (diff)
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>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r--drivers/usb/storage/usb.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 3dd7da9fd504..58f56775ecde 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -125,6 +125,9 @@ static struct us_unusual_dev us_unusual_dev_list[] = {
125 { } /* Terminating entry */ 125 { } /* Terminating entry */
126}; 126};
127 127
128static struct us_unusual_dev for_dynamic_ids =
129 USUAL_DEV(USB_SC_SCSI, USB_PR_BULK, 0);
130
128#undef UNUSUAL_DEV 131#undef UNUSUAL_DEV
129#undef COMPLIANT_DEV 132#undef COMPLIANT_DEV
130#undef USUAL_DEV 133#undef USUAL_DEV
@@ -1027,8 +1030,10 @@ EXPORT_SYMBOL_GPL(usb_stor_disconnect);
1027static int storage_probe(struct usb_interface *intf, 1030static int storage_probe(struct usb_interface *intf,
1028 const struct usb_device_id *id) 1031 const struct usb_device_id *id)
1029{ 1032{
1033 struct us_unusual_dev *unusual_dev;
1030 struct us_data *us; 1034 struct us_data *us;
1031 int result; 1035 int result;
1036 int size;
1032 1037
1033 /* 1038 /*
1034 * If libusual is configured, let it decide whether a standard 1039 * If libusual is configured, let it decide whether a standard
@@ -1047,8 +1052,19 @@ static int storage_probe(struct usb_interface *intf,
1047 * table, so we use the index of the id entry to find the 1052 * table, so we use the index of the id entry to find the
1048 * corresponding unusual_devs entry. 1053 * corresponding unusual_devs entry.
1049 */ 1054 */
1050 result = usb_stor_probe1(&us, intf, id, 1055
1051 (id - usb_storage_usb_ids) + us_unusual_dev_list); 1056 size = ARRAY_SIZE(us_unusual_dev_list);
1057 if (id >= usb_storage_usb_ids && id < usb_storage_usb_ids + size) {
1058 unusual_dev = (id - usb_storage_usb_ids) + us_unusual_dev_list;
1059 } else {
1060 unusual_dev = &for_dynamic_ids;
1061
1062 US_DEBUGP("%s %s 0x%04x 0x%04x\n", "Use Bulk-Only transport",
1063 "with the Transparent SCSI protocol for dynamic id:",
1064 id->idVendor, id->idProduct);
1065 }
1066
1067 result = usb_stor_probe1(&us, intf, id, unusual_dev);
1052 if (result) 1068 if (result)
1053 return result; 1069 return result;
1054 1070
@@ -1074,7 +1090,6 @@ static struct usb_driver usb_storage_driver = {
1074 .id_table = usb_storage_usb_ids, 1090 .id_table = usb_storage_usb_ids,
1075 .supports_autosuspend = 1, 1091 .supports_autosuspend = 1,
1076 .soft_unbind = 1, 1092 .soft_unbind = 1,
1077 .no_dynamic_id = 1,
1078}; 1093};
1079 1094
1080static int __init usb_stor_init(void) 1095static int __init usb_stor_init(void)