diff options
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 5715291ba540..e1072d52d641 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -72,12 +72,27 @@ static const char* host_info(struct Scsi_Host *host) | |||
72 | 72 | ||
73 | static int slave_alloc (struct scsi_device *sdev) | 73 | static int slave_alloc (struct scsi_device *sdev) |
74 | { | 74 | { |
75 | struct us_data *us = host_to_us(sdev->host); | ||
76 | |||
75 | /* | 77 | /* |
76 | * Set the INQUIRY transfer length to 36. We don't use any of | 78 | * Set the INQUIRY transfer length to 36. We don't use any of |
77 | * the extra data and many devices choke if asked for more or | 79 | * the extra data and many devices choke if asked for more or |
78 | * less than 36 bytes. | 80 | * less than 36 bytes. |
79 | */ | 81 | */ |
80 | sdev->inquiry_len = 36; | 82 | sdev->inquiry_len = 36; |
83 | |||
84 | /* | ||
85 | * The UFI spec treates the Peripheral Qualifier bits in an | ||
86 | * INQUIRY result as reserved and requires devices to set them | ||
87 | * to 0. However the SCSI spec requires these bits to be set | ||
88 | * to 3 to indicate when a LUN is not present. | ||
89 | * | ||
90 | * Let the scanning code know if this target merely sets | ||
91 | * Peripheral Device Type to 0x1f to indicate no LUN. | ||
92 | */ | ||
93 | if (us->subclass == US_SC_UFI) | ||
94 | sdev->sdev_target->pdt_1f_for_no_lun = 1; | ||
95 | |||
81 | return 0; | 96 | return 0; |
82 | } | 97 | } |
83 | 98 | ||
@@ -112,13 +127,11 @@ static int slave_configure(struct scsi_device *sdev) | |||
112 | if (sdev->scsi_level < SCSI_2) | 127 | if (sdev->scsi_level < SCSI_2) |
113 | sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; | 128 | sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; |
114 | 129 | ||
115 | /* According to the technical support people at Genesys Logic, | 130 | /* Many devices have trouble transfering more than 32KB at a time, |
116 | * devices using their chips have problems transferring more than | 131 | * while others have trouble with more than 64K. At this time we |
117 | * 32 KB at a time. In practice people have found that 64 KB | 132 | * are limiting both to 32K (64 sectores). |
118 | * works okay and that's what Windows does. But we'll be | 133 | */ |
119 | * conservative; people can always use the sysfs interface to | 134 | if ((us->flags & US_FL_MAX_SECTORS_64) && |
120 | * increase max_sectors. */ | ||
121 | if (le16_to_cpu(us->pusb_dev->descriptor.idVendor) == USB_VENDOR_ID_GENESYS && | ||
122 | sdev->request_queue->max_sectors > 64) | 135 | sdev->request_queue->max_sectors > 64) |
123 | blk_queue_max_sectors(sdev->request_queue, 64); | 136 | blk_queue_max_sectors(sdev->request_queue, 64); |
124 | 137 | ||