aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-atapi.c16
-rw-r--r--drivers/ide/ide-floppy.c6
-rw-r--r--drivers/ide/ide-tape.c13
3 files changed, 19 insertions, 16 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 608c5bade929..fb27c94aeb0d 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -207,7 +207,7 @@ EXPORT_SYMBOL_GPL(ide_set_media_lock);
207ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, 207ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
208 ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry, 208 ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry,
209 void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *), 209 void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *),
210 void (*retry_pc)(ide_drive_t *), void (*dsc_handle)(ide_drive_t *), 210 void (*retry_pc)(ide_drive_t *),
211 int (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned, int)) 211 int (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned, int))
212{ 212{
213 ide_hwif_t *hwif = drive->hwif; 213 ide_hwif_t *hwif = drive->hwif;
@@ -216,12 +216,12 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
216 xfer_func_t *xferfunc; 216 xfer_func_t *xferfunc;
217 unsigned int temp; 217 unsigned int temp;
218 u16 bcount; 218 u16 bcount;
219 u8 stat, ireason, scsi = drive->scsi; 219 u8 stat, ireason, scsi = drive->scsi, dsc = 0;
220 220
221 debug_log("Enter %s - interrupt handler\n", __func__); 221 debug_log("Enter %s - interrupt handler\n", __func__);
222 222
223 if (pc->flags & PC_FLAG_TIMEDOUT) { 223 if (pc->flags & PC_FLAG_TIMEDOUT) {
224 drive->pc_callback(drive); 224 drive->pc_callback(drive, 0);
225 return ide_stopped; 225 return ide_stopped;
226 } 226 }
227 227
@@ -283,14 +283,12 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
283 } 283 }
284cmd_finished: 284cmd_finished:
285 pc->error = 0; 285 pc->error = 0;
286 if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) && 286
287 (stat & ATA_DSC) == 0) { 287 if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) && (stat & ATA_DSC) == 0)
288 dsc_handle(drive); 288 dsc = 1;
289 return ide_stopped;
290 }
291 289
292 /* Command finished - Call the callback function */ 290 /* Command finished - Call the callback function */
293 drive->pc_callback(drive); 291 drive->pc_callback(drive, dsc);
294 292
295 return ide_stopped; 293 return ide_stopped;
296 } 294 }
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index d36f155470a4..b33080675f6b 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -156,7 +156,7 @@ static void idefloppy_update_buffers(ide_drive_t *drive,
156 idefloppy_end_request(drive, 1, 0); 156 idefloppy_end_request(drive, 1, 0);
157} 157}
158 158
159static void ide_floppy_callback(ide_drive_t *drive) 159static void ide_floppy_callback(ide_drive_t *drive, int dsc)
160{ 160{
161 idefloppy_floppy_t *floppy = drive->driver_data; 161 idefloppy_floppy_t *floppy = drive->driver_data;
162 struct ide_atapi_pc *pc = floppy->pc; 162 struct ide_atapi_pc *pc = floppy->pc;
@@ -223,7 +223,7 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
223 223
224 return ide_pc_intr(drive, floppy->pc, idefloppy_pc_intr, 224 return ide_pc_intr(drive, floppy->pc, idefloppy_pc_intr,
225 WAIT_FLOPPY_CMD, NULL, idefloppy_update_buffers, 225 WAIT_FLOPPY_CMD, NULL, idefloppy_update_buffers,
226 idefloppy_retry_pc, NULL, ide_io_buffers); 226 idefloppy_retry_pc, ide_io_buffers);
227} 227}
228 228
229/* 229/*
@@ -308,7 +308,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive,
308 pc->error = IDEFLOPPY_ERROR_GENERAL; 308 pc->error = IDEFLOPPY_ERROR_GENERAL;
309 309
310 floppy->failed_pc = NULL; 310 floppy->failed_pc = NULL;
311 drive->pc_callback(drive); 311 drive->pc_callback(drive, 0);
312 return ide_stopped; 312 return ide_stopped;
313 } 313 }
314 314
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index f8c84df4a0bc..70b499a617d8 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -522,7 +522,9 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects)
522 return 0; 522 return 0;
523} 523}
524 524
525static void ide_tape_callback(ide_drive_t *drive) 525static void ide_tape_handle_dsc(ide_drive_t *);
526
527static void ide_tape_callback(ide_drive_t *drive, int dsc)
526{ 528{
527 idetape_tape_t *tape = drive->driver_data; 529 idetape_tape_t *tape = drive->driver_data;
528 struct ide_atapi_pc *pc = tape->pc; 530 struct ide_atapi_pc *pc = tape->pc;
@@ -530,6 +532,9 @@ static void ide_tape_callback(ide_drive_t *drive)
530 532
531 debug_log(DBG_PROCS, "Enter %s\n", __func__); 533 debug_log(DBG_PROCS, "Enter %s\n", __func__);
532 534
535 if (dsc)
536 ide_tape_handle_dsc(drive);
537
533 if (tape->failed_pc == pc) 538 if (tape->failed_pc == pc)
534 tape->failed_pc = NULL; 539 tape->failed_pc = NULL;
535 540
@@ -658,7 +663,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
658 663
659 return ide_pc_intr(drive, tape->pc, idetape_pc_intr, WAIT_TAPE_CMD, 664 return ide_pc_intr(drive, tape->pc, idetape_pc_intr, WAIT_TAPE_CMD,
660 NULL, idetape_update_buffers, idetape_retry_pc, 665 NULL, idetape_update_buffers, idetape_retry_pc,
661 ide_tape_handle_dsc, ide_tape_io_buffers); 666 ide_tape_io_buffers);
662} 667}
663 668
664/* 669/*
@@ -743,7 +748,7 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive,
743 pc->error = IDETAPE_ERROR_GENERAL; 748 pc->error = IDETAPE_ERROR_GENERAL;
744 } 749 }
745 tape->failed_pc = NULL; 750 tape->failed_pc = NULL;
746 drive->pc_callback(drive); 751 drive->pc_callback(drive, 0);
747 return ide_stopped; 752 return ide_stopped;
748 } 753 }
749 debug_log(DBG_SENSE, "Retry #%d, cmd = %02X\n", pc->retries, pc->c[0]); 754 debug_log(DBG_SENSE, "Retry #%d, cmd = %02X\n", pc->retries, pc->c[0]);
@@ -805,7 +810,7 @@ static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive)
805 pc->error = IDETAPE_ERROR_GENERAL; 810 pc->error = IDETAPE_ERROR_GENERAL;
806 tape->failed_pc = NULL; 811 tape->failed_pc = NULL;
807 } 812 }
808 drive->pc_callback(drive); 813 drive->pc_callback(drive, 0);
809 return ide_stopped; 814 return ide_stopped;
810} 815}
811 816