diff options
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index d8d98cfecada..a688b1e686ea 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -113,7 +113,7 @@ static int slave_alloc (struct scsi_device *sdev) | |||
113 | * Let the scanning code know if this target merely sets | 113 | * Let the scanning code know if this target merely sets |
114 | * Peripheral Device Type to 0x1f to indicate no LUN. | 114 | * Peripheral Device Type to 0x1f to indicate no LUN. |
115 | */ | 115 | */ |
116 | if (us->subclass == US_SC_UFI) | 116 | if (us->subclass == USB_SC_UFI) |
117 | sdev->sdev_target->pdt_1f_for_no_lun = 1; | 117 | sdev->sdev_target->pdt_1f_for_no_lun = 1; |
118 | 118 | ||
119 | return 0; | 119 | return 0; |
@@ -176,7 +176,7 @@ static int slave_configure(struct scsi_device *sdev) | |||
176 | /* Disk-type devices use MODE SENSE(6) if the protocol | 176 | /* Disk-type devices use MODE SENSE(6) if the protocol |
177 | * (SubClass) is Transparent SCSI, otherwise they use | 177 | * (SubClass) is Transparent SCSI, otherwise they use |
178 | * MODE SENSE(10). */ | 178 | * MODE SENSE(10). */ |
179 | if (us->subclass != US_SC_SCSI && us->subclass != US_SC_CYP_ATACB) | 179 | if (us->subclass != USB_SC_SCSI && us->subclass != USB_SC_CYP_ATACB) |
180 | sdev->use_10_for_ms = 1; | 180 | sdev->use_10_for_ms = 1; |
181 | 181 | ||
182 | /* Many disks only accept MODE SENSE transfer lengths of | 182 | /* Many disks only accept MODE SENSE transfer lengths of |
@@ -209,6 +209,10 @@ static int slave_configure(struct scsi_device *sdev) | |||
209 | if (us->fflags & US_FL_CAPACITY_HEURISTICS) | 209 | if (us->fflags & US_FL_CAPACITY_HEURISTICS) |
210 | sdev->guess_capacity = 1; | 210 | sdev->guess_capacity = 1; |
211 | 211 | ||
212 | /* Some devices cannot handle READ_CAPACITY_16 */ | ||
213 | if (us->fflags & US_FL_NO_READ_CAPACITY_16) | ||
214 | sdev->no_read_capacity_16 = 1; | ||
215 | |||
212 | /* assume SPC3 or latter devices support sense size > 18 */ | 216 | /* assume SPC3 or latter devices support sense size > 18 */ |
213 | if (sdev->scsi_level > SCSI_SPC_2) | 217 | if (sdev->scsi_level > SCSI_SPC_2) |
214 | us->fflags |= US_FL_SANE_SENSE; | 218 | us->fflags |= US_FL_SANE_SENSE; |
@@ -245,7 +249,7 @@ static int slave_configure(struct scsi_device *sdev) | |||
245 | * capacity will be decremented or is correct. */ | 249 | * capacity will be decremented or is correct. */ |
246 | if (!(us->fflags & (US_FL_FIX_CAPACITY | US_FL_CAPACITY_OK | | 250 | if (!(us->fflags & (US_FL_FIX_CAPACITY | US_FL_CAPACITY_OK | |
247 | US_FL_SCM_MULT_TARG)) && | 251 | US_FL_SCM_MULT_TARG)) && |
248 | us->protocol == US_PR_BULK) | 252 | us->protocol == USB_PR_BULK) |
249 | us->use_last_sector_hacks = 1; | 253 | us->use_last_sector_hacks = 1; |
250 | } else { | 254 | } else { |
251 | 255 | ||
@@ -253,6 +257,10 @@ static int slave_configure(struct scsi_device *sdev) | |||
253 | * or to force 192-byte transfer lengths for MODE SENSE. | 257 | * or to force 192-byte transfer lengths for MODE SENSE. |
254 | * But they do need to use MODE SENSE(10). */ | 258 | * But they do need to use MODE SENSE(10). */ |
255 | sdev->use_10_for_ms = 1; | 259 | sdev->use_10_for_ms = 1; |
260 | |||
261 | /* Some (fake) usb cdrom devices don't like READ_DISC_INFO */ | ||
262 | if (us->fflags & US_FL_NO_READ_DISC_INFO) | ||
263 | sdev->no_read_disc_info = 1; | ||
256 | } | 264 | } |
257 | 265 | ||
258 | /* The CB and CBI transports have no way to pass LUN values | 266 | /* The CB and CBI transports have no way to pass LUN values |
@@ -261,7 +269,7 @@ static int slave_configure(struct scsi_device *sdev) | |||
261 | * scsi_level == 0 (UNKNOWN). Hence such devices must necessarily | 269 | * scsi_level == 0 (UNKNOWN). Hence such devices must necessarily |
262 | * be single-LUN. | 270 | * be single-LUN. |
263 | */ | 271 | */ |
264 | if ((us->protocol == US_PR_CB || us->protocol == US_PR_CBI) && | 272 | if ((us->protocol == USB_PR_CB || us->protocol == USB_PR_CBI) && |
265 | sdev->scsi_level == SCSI_UNKNOWN) | 273 | sdev->scsi_level == SCSI_UNKNOWN) |
266 | us->max_lun = 0; | 274 | us->max_lun = 0; |
267 | 275 | ||