diff options
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r-- | drivers/usb/storage/usb.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 01e43a13a6bf..1599d86154c4 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c | |||
@@ -843,6 +843,15 @@ static int usb_stor_scan_thread(void * __us) | |||
843 | complete_and_exit(&us->scanning_done, 0); | 843 | complete_and_exit(&us->scanning_done, 0); |
844 | } | 844 | } |
845 | 845 | ||
846 | static unsigned int usb_stor_sg_tablesize(struct usb_interface *intf) | ||
847 | { | ||
848 | struct usb_device *usb_dev = interface_to_usbdev(intf); | ||
849 | |||
850 | if (usb_dev->bus->sg_tablesize) { | ||
851 | return usb_dev->bus->sg_tablesize; | ||
852 | } | ||
853 | return SG_ALL; | ||
854 | } | ||
846 | 855 | ||
847 | /* First part of general USB mass-storage probing */ | 856 | /* First part of general USB mass-storage probing */ |
848 | int usb_stor_probe1(struct us_data **pus, | 857 | int usb_stor_probe1(struct us_data **pus, |
@@ -871,6 +880,7 @@ int usb_stor_probe1(struct us_data **pus, | |||
871 | * Allow 16-byte CDBs and thus > 2TB | 880 | * Allow 16-byte CDBs and thus > 2TB |
872 | */ | 881 | */ |
873 | host->max_cmd_len = 16; | 882 | host->max_cmd_len = 16; |
883 | host->sg_tablesize = usb_stor_sg_tablesize(intf); | ||
874 | *pus = us = host_to_us(host); | 884 | *pus = us = host_to_us(host); |
875 | memset(us, 0, sizeof(struct us_data)); | 885 | memset(us, 0, sizeof(struct us_data)); |
876 | mutex_init(&(us->dev_mutex)); | 886 | mutex_init(&(us->dev_mutex)); |