diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/usb/storage/scsiglue.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index d8d98cfecada..13b8bcdf3dba 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; |
@@ -123,7 +123,7 @@ static int slave_configure(struct scsi_device *sdev) | |||
123 | { | 123 | { |
124 | struct us_data *us = host_to_us(sdev->host); | 124 | struct us_data *us = host_to_us(sdev->host); |
125 | 125 | ||
126 | /* Many devices have trouble transfering more than 32KB at a time, | 126 | /* Many devices have trouble transferring more than 32KB at a time, |
127 | * while others have trouble with more than 64K. At this time we | 127 | * while others have trouble with more than 64K. At this time we |
128 | * are limiting both to 32K (64 sectores). | 128 | * are limiting both to 32K (64 sectores). |
129 | */ | 129 | */ |
@@ -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 | ||
@@ -277,7 +285,7 @@ static int slave_configure(struct scsi_device *sdev) | |||
277 | 285 | ||
278 | /* queue a command */ | 286 | /* queue a command */ |
279 | /* This is always called with scsi_lock(host) held */ | 287 | /* This is always called with scsi_lock(host) held */ |
280 | static int queuecommand(struct scsi_cmnd *srb, | 288 | static int queuecommand_lck(struct scsi_cmnd *srb, |
281 | void (*done)(struct scsi_cmnd *)) | 289 | void (*done)(struct scsi_cmnd *)) |
282 | { | 290 | { |
283 | struct us_data *us = host_to_us(srb->device->host); | 291 | struct us_data *us = host_to_us(srb->device->host); |
@@ -307,6 +315,8 @@ static int queuecommand(struct scsi_cmnd *srb, | |||
307 | return 0; | 315 | return 0; |
308 | } | 316 | } |
309 | 317 | ||
318 | static DEF_SCSI_QCMD(queuecommand) | ||
319 | |||
310 | /*********************************************************************** | 320 | /*********************************************************************** |
311 | * Error handling functions | 321 | * Error handling functions |
312 | ***********************************************************************/ | 322 | ***********************************************************************/ |