aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-atapi.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:31 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:31 -0400
commit844b9468523c8c2c45b90df4efcabcbe4926b5ab (patch)
tree64d239e810c6f143f6d3206fc37200af47f9eee0 /drivers/ide/ide-atapi.c
parent2b9efba48283f34083df6bc53f6752fba4e4d409 (diff)
ide: drop 'timeout' and 'expiry' arguments from ide_pc_intr()
* Move idescsi_expiry() to ide-atapi.c. * Move get_timeout() to <linux/ide.h>. * Drop 'timeout' and 'expiry' arguments from ide_pc_intr(). While at it: * idescsi_expiry() -> ide_scsi_expiry() * get_timeout() -> ide_scsi_get_timeout() There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r--drivers/ide/ide-atapi.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 0069c4f08244..184835141412 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -203,9 +203,21 @@ int ide_set_media_lock(ide_drive_t *drive, struct gendisk *disk, int on)
203} 203}
204EXPORT_SYMBOL_GPL(ide_set_media_lock); 204EXPORT_SYMBOL_GPL(ide_set_media_lock);
205 205
206int ide_scsi_expiry(ide_drive_t *drive)
207{
208 struct ide_atapi_pc *pc = drive->pc;
209
210 debug_log("%s called for %lu at %lu\n", __func__,
211 pc->scsi_cmd->serial_number, jiffies);
212
213 pc->flags |= PC_FLAG_TIMEDOUT;
214
215 return 0; /* we do not want the IDE subsystem to retry */
216}
217EXPORT_SYMBOL_GPL(ide_scsi_expiry);
218
206/* TODO: unify the code thus making some arguments go away */ 219/* TODO: unify the code thus making some arguments go away */
207ide_startstop_t ide_pc_intr(ide_drive_t *drive, 220ide_startstop_t ide_pc_intr(ide_drive_t *drive, ide_handler_t *handler,
208 ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry,
209 void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *), 221 void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *),
210 void (*retry_pc)(ide_drive_t *), 222 void (*retry_pc)(ide_drive_t *),
211 int (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned, int)) 223 int (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned, int))
@@ -215,12 +227,22 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive,
215 struct request *rq = hwif->hwgroup->rq; 227 struct request *rq = hwif->hwgroup->rq;
216 const struct ide_tp_ops *tp_ops = hwif->tp_ops; 228 const struct ide_tp_ops *tp_ops = hwif->tp_ops;
217 xfer_func_t *xferfunc; 229 xfer_func_t *xferfunc;
218 unsigned int temp; 230 ide_expiry_t *expiry;
231 unsigned int timeout, temp;
219 u16 bcount; 232 u16 bcount;
220 u8 stat, ireason, scsi = drive->scsi, dsc = 0; 233 u8 stat, ireason, scsi = drive->scsi, dsc = 0;
221 234
222 debug_log("Enter %s - interrupt handler\n", __func__); 235 debug_log("Enter %s - interrupt handler\n", __func__);
223 236
237 if (scsi) {
238 timeout = ide_scsi_get_timeout(pc);
239 expiry = ide_scsi_expiry;
240 } else {
241 timeout = (drive->media == ide_floppy) ? WAIT_FLOPPY_CMD
242 : WAIT_TAPE_CMD;
243 expiry = NULL;
244 }
245
224 if (pc->flags & PC_FLAG_TIMEDOUT) { 246 if (pc->flags & PC_FLAG_TIMEDOUT) {
225 drive->pc_callback(drive, 0); 247 drive->pc_callback(drive, 0);
226 return ide_stopped; 248 return ide_stopped;
@@ -347,9 +369,7 @@ cmd_finished:
347 pc->xferred += temp; 369 pc->xferred += temp;
348 pc->cur_pos += temp; 370 pc->cur_pos += temp;
349 ide_pad_transfer(drive, 0, bcount - temp); 371 ide_pad_transfer(drive, 0, bcount - temp);
350 ide_set_handler(drive, handler, timeout, 372 goto next_irq;
351 expiry);
352 return ide_started;
353 } 373 }
354 debug_log("The device wants to send us more data than " 374 debug_log("The device wants to send us more data than "
355 "expected - allowing transfer\n"); 375 "expected - allowing transfer\n");
@@ -376,7 +396,7 @@ cmd_finished:
376 396
377 debug_log("[cmd %x] transferred %d bytes on that intr.\n", 397 debug_log("[cmd %x] transferred %d bytes on that intr.\n",
378 rq->cmd[0], bcount); 398 rq->cmd[0], bcount);
379 399next_irq:
380 /* And set the interrupt handler again */ 400 /* And set the interrupt handler again */
381 ide_set_handler(drive, handler, timeout, expiry); 401 ide_set_handler(drive, handler, timeout, expiry);
382 return ide_started; 402 return ide_started;