|
@@ -843,6 +843,15 @@ static int usb_stor_scan_thread(void * __us)
|
|
|
complete_and_exit(&us->scanning_done, 0);
|
|
|
}
|
|
|
|
|
|
+static unsigned int usb_stor_sg_tablesize(struct usb_interface *intf)
|
|
|
+{
|
|
|
+ struct usb_device *usb_dev = interface_to_usbdev(intf);
|
|
|
+
|
|
|
+ if (usb_dev->bus->sg_tablesize) {
|
|
|
+ return usb_dev->bus->sg_tablesize;
|
|
|
+ }
|
|
|
+ return SG_ALL;
|
|
|
+}
|
|
|
|
|
|
/* First part of general USB mass-storage probing */
|
|
|
int usb_stor_probe1(struct us_data **pus,
|
|
@@ -871,6 +880,7 @@ int usb_stor_probe1(struct us_data **pus,
|
|
|
* Allow 16-byte CDBs and thus > 2TB
|
|
|
*/
|
|
|
host->max_cmd_len = 16;
|
|
|
+ host->sg_tablesize = usb_stor_sg_tablesize(intf);
|
|
|
*pus = us = host_to_us(host);
|
|
|
memset(us, 0, sizeof(struct us_data));
|
|
|
mutex_init(&(us->dev_mutex));
|