diff options
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index cfa26d56ce60..d8d98cfecada 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -43,7 +43,6 @@ | |||
43 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 43 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #include <linux/slab.h> | ||
47 | #include <linux/module.h> | 46 | #include <linux/module.h> |
48 | #include <linux/mutex.h> | 47 | #include <linux/mutex.h> |
49 | 48 | ||
@@ -73,7 +72,8 @@ | |||
73 | 72 | ||
74 | static const char* host_info(struct Scsi_Host *host) | 73 | static const char* host_info(struct Scsi_Host *host) |
75 | { | 74 | { |
76 | return "SCSI emulation for USB Mass Storage devices"; | 75 | struct us_data *us = host_to_us(host); |
76 | return us->scsi_name; | ||
77 | } | 77 | } |
78 | 78 | ||
79 | static int slave_alloc (struct scsi_device *sdev) | 79 | static int slave_alloc (struct scsi_device *sdev) |
@@ -132,15 +132,15 @@ static int slave_configure(struct scsi_device *sdev) | |||
132 | 132 | ||
133 | if (us->fflags & US_FL_MAX_SECTORS_MIN) | 133 | if (us->fflags & US_FL_MAX_SECTORS_MIN) |
134 | max_sectors = PAGE_CACHE_SIZE >> 9; | 134 | max_sectors = PAGE_CACHE_SIZE >> 9; |
135 | if (queue_max_sectors(sdev->request_queue) > max_sectors) | 135 | if (queue_max_hw_sectors(sdev->request_queue) > max_sectors) |
136 | blk_queue_max_sectors(sdev->request_queue, | 136 | blk_queue_max_hw_sectors(sdev->request_queue, |
137 | max_sectors); | 137 | max_sectors); |
138 | } else if (sdev->type == TYPE_TAPE) { | 138 | } else if (sdev->type == TYPE_TAPE) { |
139 | /* Tapes need much higher max_sector limits, so just | 139 | /* Tapes need much higher max_sector limits, so just |
140 | * raise it to the maximum possible (4 GB / 512) and | 140 | * raise it to the maximum possible (4 GB / 512) and |
141 | * let the queue segment size sort out the real limit. | 141 | * let the queue segment size sort out the real limit. |
142 | */ | 142 | */ |
143 | blk_queue_max_sectors(sdev->request_queue, 0x7FFFFF); | 143 | blk_queue_max_hw_sectors(sdev->request_queue, 0x7FFFFF); |
144 | } | 144 | } |
145 | 145 | ||
146 | /* Some USB host controllers can't do DMA; they have to use PIO. | 146 | /* Some USB host controllers can't do DMA; they have to use PIO. |
@@ -483,7 +483,7 @@ static ssize_t show_max_sectors(struct device *dev, struct device_attribute *att | |||
483 | { | 483 | { |
484 | struct scsi_device *sdev = to_scsi_device(dev); | 484 | struct scsi_device *sdev = to_scsi_device(dev); |
485 | 485 | ||
486 | return sprintf(buf, "%u\n", queue_max_sectors(sdev->request_queue)); | 486 | return sprintf(buf, "%u\n", queue_max_hw_sectors(sdev->request_queue)); |
487 | } | 487 | } |
488 | 488 | ||
489 | /* Input routine for the sysfs max_sectors file */ | 489 | /* Input routine for the sysfs max_sectors file */ |
@@ -493,9 +493,9 @@ static ssize_t store_max_sectors(struct device *dev, struct device_attribute *at | |||
493 | struct scsi_device *sdev = to_scsi_device(dev); | 493 | struct scsi_device *sdev = to_scsi_device(dev); |
494 | unsigned short ms; | 494 | unsigned short ms; |
495 | 495 | ||
496 | if (sscanf(buf, "%hu", &ms) > 0 && ms <= SCSI_DEFAULT_MAX_SECTORS) { | 496 | if (sscanf(buf, "%hu", &ms) > 0) { |
497 | blk_queue_max_sectors(sdev->request_queue, ms); | 497 | blk_queue_max_hw_sectors(sdev->request_queue, ms); |
498 | return strlen(buf); | 498 | return count; |
499 | } | 499 | } |
500 | return -EINVAL; | 500 | return -EINVAL; |
501 | } | 501 | } |
@@ -538,7 +538,7 @@ struct scsi_host_template usb_stor_host_template = { | |||
538 | .slave_configure = slave_configure, | 538 | .slave_configure = slave_configure, |
539 | 539 | ||
540 | /* lots of sg segments can be handled */ | 540 | /* lots of sg segments can be handled */ |
541 | .sg_tablesize = SG_ALL, | 541 | .sg_tablesize = SCSI_MAX_SG_CHAIN_SEGMENTS, |
542 | 542 | ||
543 | /* limit the total size of a transfer to 120 KB */ | 543 | /* limit the total size of a transfer to 120 KB */ |
544 | .max_sectors = 240, | 544 | .max_sectors = 240, |